Akonadi::StandardContactActionManager Class
Manages contact specific actions for collection and item views. More...
| Header: | #include <Akonadi/StandardContactActionManager> |
| CMake: | find_package(KPim6AkonadiContactWidgets REQUIRED)target_link_libraries(mytarget PRIVATE KPim6::AkonadiContactWidgets) |
| Inherits: | QObject |
Public Types
| enum | Type { CreateContact, CreateContactGroup, EditItem, LastType } |
Public Functions
| StandardContactActionManager(KActionCollection *actionCollection, QWidget *parent = nullptr) | |
| virtual | ~StandardContactActionManager() override |
| QAction * | action(Akonadi::StandardActionManager::Type type) const |
| QAction * | action(Akonadi::StandardContactActionManager::Type type) const |
| QAction * | createAction(Akonadi::StandardActionManager::Type type) |
| QAction * | createAction(Akonadi::StandardContactActionManager::Type type) |
| void | createAllActions() |
| void | interceptAction(Akonadi::StandardActionManager::Type type, bool intercept = true) |
| void | interceptAction(Akonadi::StandardContactActionManager::Type type, bool intercept = true) |
| Akonadi::Collection::List | selectedCollections() const |
| Akonadi::Item::List | selectedItems() const |
| void | setActionText(Akonadi::StandardActionManager::Type type, const KLocalizedString &text) |
| void | setCollectionPropertiesPageNames(const QStringList &names) |
| void | setCollectionSelectionModel(QItemSelectionModel *selectionModel) |
| void | setItemSelectionModel(QItemSelectionModel *selectionModel) |
Signals
| void | actionStateUpdated() |
Detailed Description
Author: Tobias Koenig <tokoe@kde.org>
Member Type Documentation
enum StandardContactActionManager::Type
Describes the supported actions.
Member Function Documentation
[explicit] StandardContactActionManager::StandardContactActionManager(KActionCollection *actionCollection, QWidget *parent = nullptr)
Creates a new standard contact action manager.
actionCollection The action collection to operate on. parent The parent widget.
[override virtual noexcept] StandardContactActionManager::~StandardContactActionManager()
Destroys the standard contact action manager.
QAction *StandardContactActionManager::action(Akonadi::StandardActionManager::Type type) const
Returns the action of the given type, 0 if it has not been created (yet). type the type of action to return
QAction *StandardContactActionManager::action(Akonadi::StandardContactActionManager::Type type) const
Returns the action of the given type, 0 if it has not been created (yet).
[signal] void StandardContactActionManager::actionStateUpdated()
This signal is emitted whenever the action state has been updated. In case you have special needs for changing the state of some actions, connect to this signal and adjust the action state.
QAction *StandardContactActionManager::createAction(Akonadi::StandardActionManager::Type type)
Creates the action of the given type and adds it to the action collection specified in the constructor if it does not exist yet. The action is connected to its default implementation provided by this class. type the type of action to create
QAction *StandardContactActionManager::createAction(Akonadi::StandardContactActionManager::Type type)
Creates the action of the given type and adds it to the action collection specified in the constructor if it does not exist yet. The action is connected to its default implementation provided by this class. type the type of action to create
void StandardContactActionManager::createAllActions()
Convenience method to create all standard actions.
See also createAction().
void StandardContactActionManager::interceptAction(Akonadi::StandardActionManager::Type type, bool intercept = true)
Sets whether the default implementation for the given action type shall be executed when the action is triggered.
intercept If \ false, the default implementation will be executed, if \ true no action is taken.
void StandardContactActionManager::interceptAction(Akonadi::StandardContactActionManager::Type type, bool intercept = true)
Sets whether the default implementation for the given action type shall be executed when the action is triggered.
intercept If \ false, the default implementation will be executed, if \ true no action is taken.
Akonadi::Collection::List StandardContactActionManager::selectedCollections() const
Returns the list of collections that are currently selected. The list is empty if no collection is currently selected.
Akonadi::Item::List StandardContactActionManager::selectedItems() const
Returns the list of items that are currently selected. The list is empty if no item is currently selected.
void StandardContactActionManager::setActionText(Akonadi::StandardActionManager::Type type, const KLocalizedString &text)
Sets the label of the action type to text, which is used during updating the action state and substituted according to the number of selected objects. This is mainly useful to customize the label of actions that can operate on multiple objects.
Example:
acctMgr->setActionText( Akonadi::StandardActionManager::CopyItems,
ki18np( "Copy Item", "Copy %1 Items" ) );
void StandardContactActionManager::setCollectionPropertiesPageNames(const QStringList &names)
names the list of names to set as collection properties page names
void StandardContactActionManager::setCollectionSelectionModel(QItemSelectionModel *selectionModel)
Sets the collection selection model based on which the collection related actions should operate. If none is set, all collection actions will be disabled. selectionModel the selection model for collections
void StandardContactActionManager::setItemSelectionModel(QItemSelectionModel *selectionModel)
Sets the item selection model based on which the item related actions should operate. If none is set, all item actions will be disabled. selectionModel the selection model for items