Akonadi::StandardMailActionManager Class
class Akonadi::StandardMailActionManagerManages emails specific actions for collection and item views. More...
| Header: | #include <Akonadi/StandardMailActionManager> |
| CMake: | find_package(KPim6AkonadiMime REQUIRED)target_link_libraries(mytarget PRIVATE KPim6::AkonadiMime) |
| Inherits: | QObject |
Public Types
| enum | Type { MarkMailAsRead, MarkMailAsUnread, MarkMailAsImportant, MarkMailAsActionItem, MarkAllMailAsRead, …, LastType } |
Public Functions
| StandardMailActionManager(KActionCollection *actionCollection, QWidget *parent = nullptr) | |
| virtual | ~StandardMailActionManager() override |
| QAction * | action(Akonadi::StandardActionManager::Type type) const |
| QAction * | action(Akonadi::StandardMailActionManager::Type type) const |
| QAction * | createAction(Akonadi::StandardActionManager::Type type) |
| QAction * | createAction(Akonadi::StandardMailActionManager::Type type) |
| void | createAllActions() |
| virtual void | executeMarkAsCommand(Akonadi::MessageStatus targetStatus, const Akonadi::Item::List &items, bool invert) |
| virtual void | executeMarkAsCommand(Akonadi::MessageStatus targetStatus, const Akonadi::Collection::List &items, bool invert, bool recursive) |
| void | interceptAction(Akonadi::StandardActionManager::Type type, bool intercept = true) |
| void | interceptAction(Akonadi::StandardMailActionManager::Type type, bool intercept = true) |
| void | markAllItemsAs(const QByteArray &typeStr, const Akonadi::Collection::List &collections, bool checkIntercept = true) |
| void | markItemsAs(const QByteArray &typeStr, const Akonadi::Item::List &items, bool checkIntercept = 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 | setFavoriteCollectionsModel(Akonadi::FavoriteCollectionsModel *favoritesModel) |
| void | setFavoriteSelectionModel(QItemSelectionModel *selectionModel) |
| void | setItemSelectionModel(QItemSelectionModel *selectionModel) |
| void | setItems(const Item::List &selectedItems) |
| Akonadi::StandardActionManager * | standardActionManager() const |
Signals
| void | actionStateUpdated() |
Detailed Description
Author: Andras Mantia <amantia@kde.org>
Member Type Documentation
enum StandardMailActionManager::Type
Describes the supported actions.
Member Function Documentation
[explicit] StandardMailActionManager::StandardMailActionManager(KActionCollection *actionCollection, QWidget *parent = nullptr)
Creates a new standard mail action manager.
actionCollection The action collection to operate on. parent The parent widget.
[override virtual noexcept] StandardMailActionManager::~StandardMailActionManager()
Destroys the standard mail action manager.
QAction *StandardMailActionManager::action(Akonadi::StandardActionManager::Type type) const
Returns the action of the given type, 0 if it has not been created (yet). type action type
QAction *StandardMailActionManager::action(Akonadi::StandardMailActionManager::Type type) const
Returns the action of the given type, 0 if it has not been created (yet). type action type
[signal] void StandardMailActionManager::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 *StandardMailActionManager::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 action type
QAction *StandardMailActionManager::createAction(Akonadi::StandardMailActionManager::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 action type
void StandardMailActionManager::createAllActions()
Convenience method to create all standard actions.
See also createAction().
[virtual] void StandardMailActionManager::executeMarkAsCommand(Akonadi::MessageStatus targetStatus, const Akonadi::Item::List &items, bool invert)
executeMarkAsCommand targetStatus items invert
[virtual] void StandardMailActionManager::executeMarkAsCommand(Akonadi::MessageStatus targetStatus, const Akonadi::Collection::List &items, bool invert, bool recursive)
executeMarkAsCommand targetStatus items invert recursive
void StandardMailActionManager::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.
type action type intercept If \ false, the default implementation will be executed, if \ true no action is taken.
void StandardMailActionManager::interceptAction(Akonadi::StandardMailActionManager::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 StandardMailActionManager::markAllItemsAs(const QByteArray &typeStr, const Akonadi::Collection::List &collections, bool checkIntercept = true)
Marks all items in the given collections as having the specified message status. typeStr the message status type string collections the collections to mark checkIntercept whether to check if the action is intercepted
void StandardMailActionManager::markItemsAs(const QByteArray &typeStr, const Akonadi::Item::List &items, bool checkIntercept = true)
Marks the given items as having the specified message status. typeStr the message status type string items the items to mark checkIntercept whether to check if the action is intercepted
Akonadi::Collection::List StandardMailActionManager::selectedCollections() const
Returns the list of collections that are currently selected. The list is empty if no collection is currently selected.
Akonadi::Item::List StandardMailActionManager::selectedItems() const
Returns the list of items that are currently selected. The list is empty if no item is currently selected.
void StandardMailActionManager::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" ) );
type action type text localized text for action
void StandardMailActionManager::setCollectionPropertiesPageNames(const QStringList &names)
Sets the collection properties page names. names the list of property page names
void StandardMailActionManager::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 selection model for collections
void StandardMailActionManager::setFavoriteCollectionsModel(Akonadi::FavoriteCollectionsModel *favoritesModel)
Sets the favorite collections model based on which the collection relatedactions should operate. If none is set, the "Add to Favorite Folders" action will be disabled.
favoritesModel model for a user's favorite mail collections
void StandardMailActionManager::setFavoriteSelectionModel(QItemSelectionModel *selectionModel)
Sets the favorite collection selection model based on which the favorite collection related actions should operate. If none is set, all favorite modifications actions will be disabled.
selection model for favorite collections
void StandardMailActionManager::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 selection model for items
void StandardMailActionManager::setItems(const Item::List &selectedItems)
Sets the list of items that are currently selected. selectedItems the items to set as selected
Akonadi::StandardActionManager *StandardMailActionManager::standardActionManager() const
Returns the standard action manager instance.