]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kitemviews/kitemlistcontroller.h
Context menu cleanups
[dolphin.git] / src / kitemviews / kitemlistcontroller.h
index 01d1b94081638d969ada51100fb8ac00e49da85e..d6205ea0aec8846083ec1ffa5772c4df81eaa1d1 100644 (file)
 #include <QSet>
 
 class KItemModelBase;
+class KItemListKeyboardSearchManager;
 class KItemListSelectionManager;
 class KItemListView;
+class KItemListWidget;
 class QGraphicsSceneHoverEvent;
 class QGraphicsSceneDragDropEvent;
 class QGraphicsSceneMouseEvent;
@@ -104,7 +106,24 @@ public:
     virtual bool processEvent(QEvent* event, const QTransform& transform);
 
 signals:
-    void itemClicked(int index, Qt::MouseButton button);
+    void itemActivated(int index);
+    void itemMiddleClicked(int index);
+
+    /**
+     * 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.
@@ -120,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
@@ -132,18 +158,32 @@ private slots:
      */
     void slotRubberBandChanged();
 
+    void slotChangeCurrentItem(const QString& text, bool searchFromNextItem);
+
 private:
     /**
-     * Creates a QDrag object to start a drag-operation.
+     * 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.
+     */
+    KItemListWidget* widgetForPos(const QPointF& pos) const;
+
 private:
-    bool m_dragging;
     SelectionBehavior m_selectionBehavior;
     KItemModelBase* m_model;
     KItemListView* m_view;
     KItemListSelectionManager* m_selectionManager;
+    KItemListKeyboardSearchManager* m_keyboardManager;
     int m_pressedIndex;
     QPointF m_pressedMousePos;