]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kitemviews/kitemlistcontroller.h
Modernize: Use override where possible
[dolphin.git] / src / kitemviews / kitemlistcontroller.h
index 4d5fee3450fa8e391dc881f1878e057e863290b0..ff0171a02697fe6bb6f762dce4f48281f855e045 100644 (file)
 #ifndef KITEMLISTCONTROLLER_H
 #define KITEMLISTCONTROLLER_H
 
-#include <libdolphin_export.h>
+#include "dolphin_export.h"
+
+#include "kitemset.h"
 
 #include <QObject>
-#include <QPixmap>
 #include <QPointF>
-#include <QSet>
-
+class QTimer;
 class KItemModelBase;
 class KItemListKeyboardSearchManager;
 class KItemListSelectionManager;
@@ -43,7 +43,6 @@ class QGraphicsSceneWheelEvent;
 class QHideEvent;
 class QInputMethodEvent;
 class QKeyEvent;
-class QMimeData;
 class QShowEvent;
 class QTransform;
 
@@ -57,10 +56,9 @@ class QTransform;
  * @see KItemModelBase
  * @see KItemListSelectionManager
  */
-class LIBDOLPHINPRIVATE_EXPORT KItemListController : public QObject
+class DOLPHIN_EXPORT KItemListController : public QObject
 {
     Q_OBJECT
-    Q_ENUMS(SelectionBehavior)
     Q_PROPERTY(KItemModelBase* model READ model WRITE setModel)
     Q_PROPERTY(KItemListView *view READ view WRITE setView)
     Q_PROPERTY(SelectionBehavior selectionBehavior READ selectionBehavior WRITE setSelectionBehavior)
@@ -73,6 +71,7 @@ public:
         SingleSelection,
         MultiSelection
     };
+    Q_ENUM(SelectionBehavior)
 
     enum AutoActivationBehavior {
         ActivationAndExpansion,
@@ -90,7 +89,7 @@ public:
      * @param parent Optional parent object.
      */
     KItemListController(KItemModelBase* model, KItemListView* view, QObject* parent = 0);
-    virtual ~KItemListController();
+    ~KItemListController() override;
 
     void setModel(KItemModelBase* model);
     KItemModelBase* model() const;
@@ -129,8 +128,8 @@ public:
 
     /**
      * If set to true, the signals itemActivated() and itemsActivated() are emitted
-     * after a single-click of the left mouse button. If set to false (the default), 
-     * the setting from KGlobalSettings::singleClick() is used.
+     * after a single-click of the left mouse button. If set to false (the default),
+     * the setting from style()->styleHint(QStyle::SH_ItemView_ActivateItemOnSingleClick) is used.
      */
     void setSingleClickActivationEnforced(bool singleClick);
     bool singleClickActivationEnforced() const;
@@ -165,7 +164,7 @@ signals:
      * Is emitted if more than one item has been activated by pressing Return/Enter
      * when having a selection.
      */
-    void itemsActivated(const QSet<int>& indexes);
+    void itemsActivated(const KItemSet& indexes);
 
     void itemMiddleClicked(int index);
 
@@ -230,9 +229,16 @@ signals:
      */
     void aboveItemDropEvent(int index, QGraphicsSceneDragDropEvent* event);
 
+    /**
+     * Is emitted if the Escape key is pressed.
+     */
+    void escapePressed();
+
     void modelChanged(KItemModelBase* current, KItemModelBase* previous);
     void viewChanged(KItemListView* current, KItemListView* previous);
 
+    void selectedItemTextPressed(int index);
+
 private slots:
     void slotViewScrollOffsetChanged(qreal current, qreal previous);
 
@@ -321,7 +327,7 @@ private:
      * the current selection it is remembered in m_oldSelection before the
      * rubberband gets activated.
      */
-    QSet<int> m_oldSelection;
+    KItemSet m_oldSelection;
 
     /**
      * Assuming a view is given with a vertical scroll-orientation, grouped items and