X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/85aec92f819eae5a6189bd3ec25cff44dce3ae19..b1c9b5126d:/src/dolphincontroller.h diff --git a/src/dolphincontroller.h b/src/dolphincontroller.h index 542f21b3b..29dd7dfb1 100644 --- a/src/dolphincontroller.h +++ b/src/dolphincontroller.h @@ -121,9 +121,11 @@ public: * should be invoked by the view implementation when a context * menu should be opened. The abstract Dolphin view itself * takes care itself to get the selected items depending from - * \a pos. + * \a pos. It is possible to define a custom list of actions for + * the context menu by \a customActions. */ - void triggerContextMenuRequest(const QPoint& pos); + void triggerContextMenuRequest(const QPoint& pos, + const QList& customActions = QList()); /** * Requests an activation of the view and emits the signal @@ -210,6 +212,16 @@ public: /** Emits the signal hideToolTip(). */ void emitHideToolTip(); + /** + * Emits the signal itemTriggered() for the item \a item. + * The method can be used by the view implementations to + * trigger an item directly without mouse interaction. + * If the item triggering is done by the mouse, it is recommended + * to use QAbstractItemView::triggerItem(), as this will check + * the used mouse buttons to execute the correct action. + */ + void emitItemTriggered(const KFileItem& item); + /** * Returns the file item for the proxy index \a index of the view \a view. */ @@ -220,8 +232,9 @@ public slots: * Emits the signal itemTriggered() if the file item for the index \a index * is not null and the left mouse button has been pressed. If the item is * null, the signal itemEntered() is emitted. - * The method should be invoked by the controller parent whenever the - * user has triggered an item. + * The method should be invoked by the view implementations whenever the + * user has triggered an item with the mouse (see + * QAbstractItemView::clicked() or QAbstractItemView::doubleClicked()). */ void triggerItem(const QModelIndex& index); @@ -261,12 +274,14 @@ signals: /** * Is emitted if a context menu should be opened (see triggerContextMenuRequest()). * The abstract Dolphin view connects to this signal and will open the context menu. - * @param pos Position relative to the view widget where the - * context menu should be opened. It is recommended - * to get the corresponding model index from - * this position. + * @param pos Position relative to the view widget where the + * context menu should be opened. It is recommended + * to get the corresponding model index from + * this position. + * @param customActions List of actions that is added to the context menu when + * the menu is opened above the viewport. */ - void requestContextMenu(const QPoint& pos); + void requestContextMenu(const QPoint& pos, QList customActions); /** * Is emitted if the view has been activated by e. g. a mouse click. @@ -359,7 +374,7 @@ private slots: private: int m_zoomLevel; - Qt::MouseButtons m_mouseButtons; // TODO: this is a workaround until Qt-issue 176832 has been fixed + static Qt::MouseButtons m_mouseButtons; // TODO: this is a workaround until Qt-issue 176832 has been fixed KUrl m_url; DolphinView* m_dolphinView; QAbstractItemView* m_itemView;