]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/views/dolphinview.h
GIT_SILENT Sync po/docbooks with svn
[dolphin.git] / src / views / dolphinview.h
index 21ca49c241b215915496643ce5c07e03835000ef..f491b6dd563ad9f79b07d27051d1eccdf6bb5d1f 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>
 
@@ -205,9 +205,17 @@ 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;
 
@@ -344,6 +352,23 @@ public:
     /** Activates the view if the item list container gets focus. */
     bool eventFilter(QObject *watched, QEvent *event) override;
 
+    /**
+     * Returns whether the folder represented by the current URL is writable.
+     */
+    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();
@@ -452,6 +477,12 @@ Q_SIGNALS:
      */
     void itemActivated(const KFileItem &item);
 
+    /**
+     * Is emitted when clicking on a file with the middle mouse button.
+     * @note: This will not be emitted for folders or file archives that will/can be opened like folders.
+     */
+    void fileMiddleClickActivated(const KFileItem &item);
+
     /**
      * Is emitted when multiple items have been activated by e. g.
      * context menu open with.
@@ -548,7 +579,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
@@ -646,6 +677,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;
@@ -667,15 +704,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();
@@ -713,18 +750,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.
@@ -818,6 +843,8 @@ private Q_SLOTS:
 
     void slotTwoClicksRenamingTimerTimeout();
 
+    void onDirectoryLoadingCompletedAfterJob();
+
 private:
     void loadDirectory(const QUrl &url, bool reload = false);
 
@@ -840,6 +867,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().
@@ -872,7 +904,7 @@ private:
     /**
      * Updates m_isFolderWritable dependent on whether the folder represented by
      * the current URL is writable. If the state has changed, the signal
-     * writeableStateChanged() will be emitted.
+     * writeStateChanged() will be emitted.
      */
     void updateWritableState();