X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fcontextmenuactionprovider.h;h=e894cd159a2fd3f5305a9a44a17707470776bec0;hp=5bd7f6d7a41d81c9581ca6f57338c68395d5fd2b;hb=694f9bfbf7f1af19108461c7e00d133e55082bce;hpb=61c8d84d1c849373e0f115dc748ed45cff95287d diff --git a/src/uisupport/contextmenuactionprovider.h b/src/uisupport/contextmenuactionprovider.h index 5bd7f6d7..e894cd15 100644 --- a/src/uisupport/contextmenuactionprovider.h +++ b/src/uisupport/contextmenuactionprovider.h @@ -23,55 +23,57 @@ #include "networkmodelcontroller.h" -class ContextMenuActionProvider : public NetworkModelController { - Q_OBJECT +class ContextMenuActionProvider : public NetworkModelController +{ + Q_OBJECT public: - ContextMenuActionProvider(QObject *parent = 0); - virtual ~ContextMenuActionProvider(); + ContextMenuActionProvider(QObject *parent = 0); + virtual ~ContextMenuActionProvider(); - //! Provide a list of actions applying to the given item - /** - * Note that this list ist not persistent, hence it should only be used immediately after - * calling this function (e.g. in a context menu). Optionally one can provide a QObject and a slot - * (that should take a QAction * as parameter) that is invoked for actions that require external - * handling. - * @param index The item index in the NetworkModel - * @param receiver The optional object that is notified for actions that need to be handled externally. - * The action type will be stored in the QAction's data(). - * @param slot The receiving slot name; should be "mySlot" rather than SLOT(mySlot(QAction *)) - * @return A list of actions applying to the given item - */ - void addActions(QMenu *, const QModelIndex &index, QObject *receiver = 0, const char *slot = 0, bool allowBufferHide = false); - void addActions(QMenu *, const QList &indexList, QObject *receiver = 0, const char *slot = 0, bool allowBufferHide = false); - void addActions(QMenu *, BufferId id, QObject *receiver = 0, const char *slot = 0); - void addActions(QMenu *, MessageFilter *filter, BufferId msgBuffer, QObject *receiver = 0, const char *slot = 0); - void addActions(QMenu *, MessageFilter *filter, BufferId msgBuffer, const QString &chanOrNick, QObject *receiver = 0, const char *slot = 0); + //! Provide a list of actions applying to the given item + /** + * Note that this list ist not persistent, hence it should only be used immediately after + * calling this function (e.g. in a context menu). Optionally one can provide a QObject and a slot + * (that should take a QAction * as parameter) that is invoked for actions that require external + * handling. + * @param index The item index in the NetworkModel + * @param receiver The optional object that is notified for actions that need to be handled externally. + * The action type will be stored in the QAction's data(). + * @param slot The receiving slot name; should be "mySlot" rather than SLOT(mySlot(QAction *)) + * @return A list of actions applying to the given item + */ + void addActions(QMenu *, const QModelIndex &index, QObject *receiver = 0, const char *slot = 0, bool allowBufferHide = false); + void addActions(QMenu *, const QList &indexList, QObject *receiver = 0, const char *slot = 0, bool allowBufferHide = false); + void addActions(QMenu *, BufferId id, QObject *receiver = 0, const char *slot = 0); + void addActions(QMenu *, MessageFilter *filter, BufferId msgBuffer, QObject *receiver = 0, const char *slot = 0); + void addActions(QMenu *, MessageFilter *filter, BufferId msgBuffer, const QString &chanOrNick, QObject *receiver = 0, const char *slot = 0); private: - void addActions(QMenu *, const QList &indexList, MessageFilter *filter, const QString &chanOrNick, - QObject *receiver, const char *slot, bool allowBufferHide); + void addActions(QMenu *, const QList &indexList, MessageFilter *filter, const QString &chanOrNick, + QObject *receiver, const char *slot, bool allowBufferHide); - Action * addAction(ActionType, QMenu *, bool condition = true); - Action * addAction(Action * , QMenu *, bool condition = true); - Action * addAction(ActionType, QMenu *, const QModelIndex &index, ItemActiveStates requiredActiveState = QFlags(ActiveState | InactiveState)); - Action * addAction(Action * , QMenu *, const QModelIndex &index, ItemActiveStates requiredActiveState = QFlags(ActiveState | InactiveState)); + Action *addAction(ActionType, QMenu *, bool condition = true); + Action *addAction(Action *, QMenu *, bool condition = true); + Action *addAction(ActionType, QMenu *, const QModelIndex &index, ItemActiveStates requiredActiveState = QFlags(ActiveState | InactiveState)); + Action *addAction(Action *, QMenu *, const QModelIndex &index, ItemActiveStates requiredActiveState = QFlags(ActiveState | InactiveState)); - void addHideEventsMenu(QMenu *, BufferId bufferId); - void addHideEventsMenu(QMenu *, MessageFilter *msgFilter); - void addHideEventsMenu(QMenu *, int filter = -1); - void addIgnoreMenu(QMenu *menu, const QString &hostmask, const QMap &ignoreMap); + void addHideEventsMenu(QMenu *, BufferId bufferId); + void addHideEventsMenu(QMenu *, MessageFilter *msgFilter); + void addHideEventsMenu(QMenu *, int filter = -1); + void addIgnoreMenu(QMenu *menu, const QString &hostmask, const QMap &ignoreMap); - void addNetworkItemActions(QMenu *, const QModelIndex &); - void addBufferItemActions(QMenu *, const QModelIndex &, bool isCustomBufferView = false); - void addIrcUserActions(QMenu *, const QModelIndex &); + void addNetworkItemActions(QMenu *, const QModelIndex &); + void addBufferItemActions(QMenu *, const QModelIndex &, bool isCustomBufferView = false); + void addIrcUserActions(QMenu *, const QModelIndex &); - Action *_hideEventsMenuAction; - Action *_nickCtcpMenuAction; - Action *_nickModeMenuAction; - Action *_nickIgnoreMenuAction; - QList _ignoreDescriptions; + Action *_hideEventsMenuAction; + Action *_nickCtcpMenuAction; + Action *_nickModeMenuAction; + Action *_nickIgnoreMenuAction; + QList _ignoreDescriptions; }; + #endif