]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kitemviews/kitemlistcontroller.h
Merge remote-tracking branch 'origin/KDE/4.11'
[dolphin.git] / src / kitemviews / kitemlistcontroller.h
index 6e8e3d367142dca128149967071918aa34a184bc..4d5fee3450fa8e391dc881f1878e057e863290b0 100644 (file)
@@ -30,8 +30,6 @@
 #include <QPointF>
 #include <QSet>
 
-#include <QAccessible>
-
 class KItemModelBase;
 class KItemListKeyboardSearchManager;
 class KItemListSelectionManager;
@@ -66,6 +64,8 @@ class LIBDOLPHINPRIVATE_EXPORT KItemListController : public QObject
     Q_PROPERTY(KItemModelBase* model READ model WRITE setModel)
     Q_PROPERTY(KItemListView *view READ view WRITE setView)
     Q_PROPERTY(SelectionBehavior selectionBehavior READ selectionBehavior WRITE setSelectionBehavior)
+    Q_PROPERTY(AutoActivationBehavior autoActivationBehavior READ autoActivationBehavior WRITE setAutoActivationBehavior)
+    Q_PROPERTY(MouseDoubleClickAction mouseDoubleClickAction READ mouseDoubleClickAction WRITE setMouseDoubleClickAction)
 
 public:
     enum SelectionBehavior {
@@ -74,6 +74,16 @@ public:
         MultiSelection
     };
 
+    enum AutoActivationBehavior {
+        ActivationAndExpansion,
+        ExpansionOnly
+    };
+
+    enum MouseDoubleClickAction {
+        ActivateAndExpandItem,
+        ActivateItemOnly
+    };
+
     /**
      * @param model  Model of the controller. The ownership is passed to the controller.
      * @param view   View of the controller. The ownership is passed to the controller.
@@ -93,6 +103,12 @@ public:
     void setSelectionBehavior(SelectionBehavior behavior);
     SelectionBehavior selectionBehavior() const;
 
+    void setAutoActivationBehavior(AutoActivationBehavior behavior);
+    AutoActivationBehavior autoActivationBehavior() const;
+
+    void setMouseDoubleClickAction(MouseDoubleClickAction action);
+    MouseDoubleClickAction mouseDoubleClickAction() const;
+
     /**
      * Sets the delay in milliseconds when dragging an object above an item
      * until the item gets activated automatically. A value of -1 indicates
@@ -113,12 +129,11 @@ 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, a double-click
-     * is required. Per 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 KGlobalSettings::singleClick() is used.
      */
-    void setSingleClickActivation(bool singleClick);
-    bool singleClickActivation() const;
+    void setSingleClickActivationEnforced(bool singleClick);
+    bool singleClickActivationEnforced() const;
 
     virtual bool showEvent(QShowEvent* event);
     virtual bool hideEvent(QHideEvent* event);
@@ -285,10 +300,12 @@ private:
     void updateExtendedSelectionRegion();
 
 private:
-    bool m_singleClickActivation;
+    bool m_singleClickActivationEnforced;
     bool m_selectionTogglePressed;
     bool m_clearSelectionIfItemsAreNotDragged;
     SelectionBehavior m_selectionBehavior;
+    AutoActivationBehavior m_autoActivationBehavior;
+    MouseDoubleClickAction m_mouseDoubleClickAction;
     KItemModelBase* m_model;
     KItemListView* m_view;
     KItemListSelectionManager* m_selectionManager;