]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/views/dolphinview.h
Add Selection Mode
[dolphin.git] / src / views / dolphinview.h
index d1ecf74ba754d4b37356d2ebf4f89866ab326fb3..37af971379d429c4cd371882a61d1bb2e096e18c 100644 (file)
@@ -23,6 +23,8 @@
 #include <QUrl>
 #include <QWidget>
 
+#include <memory>
+
 typedef KIO::FileUndoManager::CommandType CommandType;
 class QVBoxLayout;
 class DolphinItemListView;
@@ -36,6 +38,7 @@ class ViewProperties;
 class QLabel;
 class QGraphicsSceneDragDropEvent;
 class QHelpEvent;
+class QProxyStyle;
 class QRegularExpression;
 
 /**
@@ -106,8 +109,11 @@ public:
      * (GeneralSettings::globalViewProps() returns false), then the
      * changed view mode will be stored automatically.
      */
-    void setMode(Mode mode);
-    Mode mode() const;
+    void setViewMode(Mode mode);
+    Mode viewMode() const;
+
+    void setSelectionMode(bool enabled);
+    bool selectionMode() const;
 
     /**
      * Turns on the file preview for the all files of the current directory,
@@ -599,6 +605,13 @@ Q_SIGNALS:
      */
     void goForwardRequested();
 
+    /**
+     * Is emitted when the selection mode is requested for the current view.
+     * This typically happens on press and hold.
+     * @see KItemListController::longPress()
+     */
+    void selectionModeRequested();
+
     /**
      * Is emitted when the user wants to move the focus to another view.
      */
@@ -916,6 +929,9 @@ private:
     QLabel* m_placeholderLabel;
     QTimer* m_showLoadingPlaceholderTimer;
 
+    /// Used for selection mode. @see setSelectionMode()
+    std::unique_ptr<QProxyStyle> m_proxyStyle;
+
     // For unit tests
     friend class TestBase;
     friend class DolphinDetailsViewTest;