]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kitemviews/kitemlistcontroller.h
Context menu cleanups
[dolphin.git] / src / kitemviews / kitemlistcontroller.h
index 2e33948aa7fa5ab1bfdd1e45428e93f7745d6ded..d6205ea0aec8846083ec1ffa5772c4df81eaa1d1 100644 (file)
@@ -34,6 +34,7 @@ class KItemModelBase;
 class KItemListKeyboardSearchManager;
 class KItemListSelectionManager;
 class KItemListView;
+class KItemListWidget;
 class QGraphicsSceneHoverEvent;
 class QGraphicsSceneDragDropEvent;
 class QGraphicsSceneMouseEvent;
@@ -107,12 +108,28 @@ public:
 signals:
     void itemActivated(int index);
     void itemMiddleClicked(int index);
-    void contextMenuRequested(int index, const QPointF& pos);
+
+    /**
+     * Emitted if a context-menu is requested for the item with
+     * the index \a index. It is assured that the index is valid.
+     */
+    void itemContextMenuRequested(int index, const QPointF& pos);
+
+    /**
+     * Emitted if a context-menu is requested for the KItemListView.
+     */
+    void viewContextMenuRequested(const QPointF& pos);
+
+    /**
+     * Emitted if a context-menu is requested for the header of the KItemListView.
+     */
+    void headerContextMenuRequested(const QPointF& pos);
 
     /**
      * Is emitted if the item with the index \p index gets hovered.
      */
     void itemHovered(int index);
+
     /**
      * Is emitted if the item with the index \p index gets unhovered.
      * It is assured that the signal itemHovered() for this index
@@ -122,11 +139,18 @@ signals:
 
     void itemExpansionToggleClicked(int index);
 
+    /**
+     * Is emitted if a drop event is done above the item with the index
+     * \a index. If \a index is < 0 the drop event is done above an
+     * empty area of the view.
+     */
+    void itemDropEvent(int index, QGraphicsSceneDragDropEvent* event);
+
     void modelChanged(KItemModelBase* current, KItemModelBase* previous);
     void viewChanged(KItemListView* current, KItemListView* previous);
 
 private slots:
-    void slotViewOffsetChanged(qreal current, qreal previous);
+    void slotViewScrollOffsetChanged(qreal current, qreal previous);
 
     /**
      * Is invoked when the rubberband boundaries have been changed and will select
@@ -134,18 +158,27 @@ private slots:
      */
     void slotRubberBandChanged();
 
-    void slotKeyboardActivationRequested(const QString& text, bool searchFromNextItem);
+    void slotChangeCurrentItem(const QString& text, bool searchFromNextItem);
 
 private:
     /**
-     * Creates a QDrag object to start a drag-operation.
-     * @return True if the QDrag object has been created. If false is returned
-     *         there is no implementation available for KItemModelBase::createMimeData().
+     * Creates a QDrag object and initiates a drag-operation.
+     */
+    void startDragging();
+
+    /**
+     * @return Widget that is currently in the hovered state. 0 is returned
+     *         if no widget is marked as hovered.
+     */
+    KItemListWidget* hoveredWidget() const;
+
+    /**
+     * @return Widget that is below the position \a pos. 0 is returned
+     *         if no widget is below the position.
      */
-    bool startDragging();
+    KItemListWidget* widgetForPos(const QPointF& pos) const;
 
 private:
-    bool m_dragging;
     SelectionBehavior m_selectionBehavior;
     KItemModelBase* m_model;
     KItemListView* m_view;