]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/views/dolphinview.h
Merge remote-tracking branch 'fork/work/zakharafoniam/useful-groups'
[dolphin.git] / src / views / dolphinview.h
index 0b0c83487680725a6aaadd20919994f23542b911..d50c932df409b67cd7460732864879dfe4d0aa7d 100644 (file)
@@ -14,7 +14,7 @@
 
 #include "config-dolphin.h"
 #include <KFileItem>
-#include <KIO/Job>
+#include <KIO/StatJob>
 #include <kio/fileundomanager.h>
 #include <kparts/part.h>
 
@@ -51,6 +51,8 @@ class QRegularExpression;
  * - show hidden files
  * - show previews
  * - enable grouping
+ * - grouping order
+ * - grouping type
  */
 class DOLPHIN_EXPORT DolphinView : public QWidget
 {
@@ -205,12 +207,34 @@ public:
      */
     void resetZoomLevel();
 
+    /**
+     * Updates the view properties of the current URL to the
+     * sorting given by \a role.
+     */
     void setSortRole(const QByteArray &role);
     QByteArray sortRole() const;
 
+    /**
+     * Updates the view properties of the current URL to the
+     * sort order given by \a order.
+     */
     void setSortOrder(Qt::SortOrder order);
     Qt::SortOrder sortOrder() const;
 
+    /**
+     * Updates the view properties of the current URL to the
+     * grouping given by \a role.
+     */
+    void setGroupRole(const QByteArray &role);
+    QByteArray groupRole() const;
+
+    /**
+     * Updates the view properties of the current URL to the
+     * sort order given by \a order.
+     */
+    void setGroupOrder(Qt::SortOrder order);
+    Qt::SortOrder groupOrder() const;
+
     /** Sets a separate sorting with folders first (true) or a mixed sorting of files and folders (false). */
     void setSortFoldersFirst(bool foldersFirst);
     bool sortFoldersFirst() const;
@@ -349,6 +373,18 @@ public:
      */
     bool isFolderWritable() const;
 
+    /**
+     * @returns the height of the scrollbar at the bottom of the view or zero if no such scroll bar is visible.
+     */
+    int horizontalScrollBarHeight() const;
+
+    /**
+     * Set the offset for any view items that small statusbar would otherwise
+     * cover. For example, in compact view this is used to make sure no
+     * item is covered by statusbar.
+     */
+    void setStatusBarOffset(int offset);
+
 public Q_SLOTS:
 
     void reload();
@@ -514,6 +550,12 @@ Q_SIGNALS:
     /** Is emitted if the sort order (ascending or descending) has been changed. */
     void sortOrderChanged(Qt::SortOrder order);
 
+    /** Is emitted if the grouping by name, size or date has been changed. */
+    void groupRoleChanged(const QByteArray &role);
+
+    /** Is emitted if the group order (ascending or descending) has been changed. */
+    void groupOrderChanged(Qt::SortOrder order);
+
     /**
      * Is emitted if the sorting of files and folders (separate with folders
      * first or mixed) has been changed.
@@ -559,7 +601,7 @@ Q_SIGNALS:
      * Is emitted if an error message with the content \a msg
      * should be shown.
      */
-    void errorMessage(const QString &msg);
+    void errorMessage(const QString &message, const int kioErrorCode);
 
     /**
      * Is emitted if an "operation completed" message with the content \a msg
@@ -657,6 +699,12 @@ Q_SIGNALS:
      */
     void currentDirectoryRemoved();
 
+    /**
+     * Emitted when the view's background is double-clicked.
+     * Used to trigger an user configured action.
+     */
+    void doubleClickViewBackground(Qt::MouseButton button);
+
 protected:
     /** Changes the zoom level if Control is pressed during a wheel event. */
     void wheelEvent(QWheelEvent *event) override;
@@ -678,15 +726,15 @@ private Q_SLOTS:
     void slotViewContextMenuRequested(const QPointF &pos);
     void slotHeaderContextMenuRequested(const QPointF &pos);
     void slotHeaderColumnWidthChangeFinished(const QByteArray &role, qreal current);
-    void slotSidePaddingWidthChanged(qreal width);
+    void slotSidePaddingWidthChanged(qreal leftPaddingWidth, qreal rightPaddingWidth);
     void slotItemHovered(int index);
     void slotItemUnhovered(int index);
     void slotItemDropEvent(int index, QGraphicsSceneDragDropEvent *event);
     void slotModelChanged(KItemModelBase *current, KItemModelBase *previous);
     void slotMouseButtonPressed(int itemIndex, Qt::MouseButtons buttons);
-    void slotRenameDialogRenamingFinished(const QList<QUrl> &urls);
     void slotSelectedItemTextPressed(int index);
     void slotItemCreatedFromJob(KIO::Job *, const QUrl &, const QUrl &to);
+    void slotItemLinkCreatedFromJob(KIO::Job *, const QUrl &, const QString &, const QUrl &to);
     void slotIncreaseZoom();
     void slotDecreaseZoom();
     void slotSwipeUp();
@@ -724,18 +772,6 @@ private Q_SLOTS:
      */
     void slotStatJobResult(KJob *job);
 
-    /**
-     * Updates the view properties of the current URL to the
-     * sorting given by \a role.
-     */
-    void updateSortRole(const QByteArray &role);
-
-    /**
-     * Updates the view properties of the current URL to the
-     * sort order given by \a order.
-     */
-    void updateSortOrder(Qt::SortOrder order);
-
     /**
      * Updates the view properties of the current URL to the
      * sorting of files and folders (separate with folders first or mixed) given by \a foldersFirst.
@@ -829,7 +865,7 @@ private Q_SLOTS:
 
     void slotTwoClicksRenamingTimerTimeout();
 
-    void onDirectoryLoadingCompleted();
+    void onDirectoryLoadingCompletedAfterJob();
 
 private:
     void loadDirectory(const QUrl &url, bool reload = false);
@@ -853,6 +889,11 @@ private:
      */
     void applyModeToView();
 
+    /**
+     * Changes the current view based on the content of the directory.
+     */
+    void applyDynamicView();
+
     enum Selection { HasSelection, NoSelection };
     /**
      * Helper method for DolphinView::requestStatusBarText().