X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/214ee5de3fab8db92db116496b73200e466b41de..abf17941f7:/src/dolphinview.h diff --git a/src/dolphinview.h b/src/dolphinview.h index cc9f11dc1..cffa52880 100644 --- a/src/dolphinview.h +++ b/src/dolphinview.h @@ -36,6 +36,7 @@ #include #include +class DolphinController; class FilterBar; class KUrl; class KDirModel; @@ -53,7 +54,7 @@ class ViewProperties; /** * @short Represents a view for the directory content - * including the navigation bar and status bar. + * including the navigation bar, filter bar and status bar. * * View modes for icons and details are supported. Currently * Dolphin allows to have up to two views inside the main window. @@ -94,9 +95,12 @@ public: enum Sorting { SortByName = 0, - SortBySize = 1, - SortByDate = 2, - MaxSortEnum = SortByDate + SortBySize, + SortByDate, + SortByPermissions, + SortByOwner, + SortByGroup, + MaxSortEnum = SortByGroup }; DolphinView(DolphinMainWindow* mainwindow, @@ -110,14 +114,17 @@ public: /** * Sets the current active URL. * The signals UrlNavigator::urlChanged() and UrlNavigator::historyChanged() - * are submitted. + * are emitted. */ void setUrl(const KUrl& url); /** Returns the current active URL. */ const KUrl& url() const; - void requestActivation(); + /** + * Returns true if the view is active and hence all actions are + * applied to this view. + */ bool isActive() const; /** @@ -234,13 +241,6 @@ public: */ KFileItem* fileItem(const QModelIndex index) const; - /** - * Opens the context menu for the item indicated by \a fileInfo - * on the position \a pos. If 0 is passed for the file info, a context - * menu for the viewport is opened. - */ - void openContextMenu(KFileItem* fileInfo, const QPoint& pos); - /** * Renames the filename of the source URL by the new file name. * If the new file name already exists, a dialog is opened which @@ -327,11 +327,6 @@ public: /** Reloads the current directory. */ void reload(); - /** - * Declare this View as the activeview of the mainWindow() - */ - void declareViewActive(); - public slots: /** * Popups the filter bar above the status bar if \a show is true. @@ -345,6 +340,12 @@ public slots: */ void updateStatusBar(); + /** + * Requests the main window to set this view as active view, which + * means that all actions are applied to this view. + */ + void requestActivation(); + signals: /** Is emitted if URL of the view has been changed to \a url. */ void urlChanged(const KUrl& url); @@ -369,7 +370,7 @@ signals: /** * Is emitted if information of an item is requested to be shown e. g. in the sidebar. - * It the U is empty, no item information request is pending. + * It the URL is empty, no item information request is pending. */ void requestItemInfo(const KUrl& url); @@ -403,6 +404,12 @@ private slots: */ void updateItemCount(); + /** + * Restores the x- and y-position of the contents if the + * current view is part of the history. + */ + void restoreContentsPos(); + /** Shows the information \a msg inside the statusbar. */ void showInfoMessage(const QString& msg); @@ -418,6 +425,51 @@ private slots: */ void changeNameFilter(const QString& nameFilter); + /** + * Opens the context menu on position \a pos. The position + * is used to check whether the context menu is related to an + * item or to the viewport. + */ + void openContextMenu(const QPoint& pos); + + /** + * Drops the URLs \a urls at the position \a pos. + * The position is used to check whether the dropping + * is done above an item or above the viewport. + */ + void dropUrls(const KUrl::List& urls, + const QPoint& pos); + + /** + * Drops the URLs \a urls at the + * destination \a destination. + */ + void dropUrls(const KUrl::List& urls, + const KUrl& destination); + /** + * Updates the view properties of the current URL to the + * sorting given by \a sorting. + */ + void updateSorting(DolphinView::Sorting sorting); + + /** + * Updates the view properties of the current URL to the + * sort order given by \a order. + */ + void updateSortOrder(Qt::SortOrder order); + + /** + * Emits the signal contentsMoved with the current coordinates + * of the viewport as parameters. + */ + void emitContentsMoved(); + + /** + * Updates the activation state of the view by checking whether + * the currently active view is this view. + */ + void updateActivationState(); + private: void startDirLister(const KUrl& url, bool reload = false); @@ -439,11 +491,6 @@ private: */ void createView(); - /** - * Returns the column index used in the KDirModel depending on \a sorting. - */ - int columnIndex(Sorting sorting) const; - /** * Selects all items by using the selection flags \a flags. This is a helper * method for the slots DolphinView::selectAll() and DolphinView::invertSelection(). @@ -468,6 +515,7 @@ private: QVBoxLayout* m_topLayout; UrlNavigator* m_urlNavigator; + DolphinController* m_controller; DolphinIconsView* m_iconsView; DolphinDetailsView* m_detailsView;