]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/selectionmanager.h
* Use Nepomuk for getting the meta data instead of KFileMetaInfo.
[dolphin.git] / src / selectionmanager.h
index 1bf4f8b8c2a05a110d5dac4c6ad2b6d3dd0b66f9..080a94267f06a4cad5d61fe32f7534f358d2a9b8 100644 (file)
@@ -28,9 +28,11 @@ class DolphinSortFilterProxyModel;
 class QAbstractItemView;
 class QModelIndex;
 class QAbstractButton;
+class QItemSelection;
+class SelectionToggle;
 
 /**
- * @brief Allows to select and deselect items for the single-click mode.
+ * @brief Allows to select and deselect items for item views.
  *
  * Whenever an item is hovered by the mouse, a toggle button is shown
  * which allows to select/deselect the current item.
@@ -43,6 +45,13 @@ public:
     SelectionManager(QAbstractItemView* parent);
     virtual ~SelectionManager();
 
+public slots:
+    /**
+     * Resets the selection manager so that the toggle button gets
+     * invisible.
+     */
+    void reset();
+
 signals:
     /** Is emitted if the selection has been changed by the toggle button. */
     void selectionChanged();
@@ -50,17 +59,18 @@ signals:
 private slots:
     void slotEntered(const QModelIndex& index);
     void slotViewportEntered();
-    void slotSelectionChanged();
     void setItemSelected(bool selected);
+    void slotRowsRemoved(const QModelIndex& parent, int start, int end);
+    void slotSelectionChanged(const QItemSelection& selected, const QItemSelection& deselected);
 
 private:
-    KFileItem itemForIndex(const QModelIndex& index) const;
-    const QModelIndex indexForItem(const KFileItem& item) const;
+    KUrl urlForIndex(const QModelIndex& index) const;
+    const QModelIndex indexForUrl(const KUrl& url) const;
 
 private:
     QAbstractItemView* m_view;
-    QAbstractButton* m_button;
-    KFileItem m_item;
+    SelectionToggle* m_toggle;
+    bool m_connected;
 };
 
 #endif