Akonadi::StandardCalendarActionManager Class

Manages calendar specific actions for collection and item views. More...

Header: #include <Akonadi/StandardCalendarActionManager>
CMake: find_package(KPim6AkonadiCalendar REQUIRED)
target_link_libraries(mytarget PRIVATE KPim6::AkonadiCalendar)
Inherits: QObject

Public Types

enum Type { CreateEvent, CreateTodo, CreateSubTodo, CreateJournal, EditIncidence, LastType }

Public Functions

StandardCalendarActionManager(KActionCollection *actionCollection, QWidget *parent = nullptr)
virtual ~StandardCalendarActionManager() override
QAction *action(Akonadi::StandardActionManager::Type type) const
QAction *action(Akonadi::StandardCalendarActionManager::Type type) const
QAction *createAction(Akonadi::StandardActionManager::Type type)
QAction *createAction(Akonadi::StandardCalendarActionManager::Type type)
void createAllActions()
void interceptAction(Akonadi::StandardActionManager::Type type, bool intercept = true)
void interceptAction(Akonadi::StandardCalendarActionManager::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 setCollectionSelectionModel(QItemSelectionModel *selectionModel)
void setContextText(Akonadi::StandardActionManager::Type type, Akonadi::StandardActionManager::TextContext context, const KLocalizedString &text)
void setItemSelectionModel(QItemSelectionModel *selectionModel)

Signals

Detailed Description

Author: Casey Link <unnamedrambler@gmail.com>

Member Type Documentation

enum StandardCalendarActionManager::Type

Describes the supported actions.

Member Function Documentation

[explicit] StandardCalendarActionManager::StandardCalendarActionManager(KActionCollection *actionCollection, QWidget *parent = nullptr)

Creates a new standard calendar action manager.

actionCollection The action collection to operate on. parent The parent widget.

[override virtual noexcept] StandardCalendarActionManager::~StandardCalendarActionManager()

Destroys the standard calendar action manager.

QAction *StandardCalendarActionManager::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 *StandardCalendarActionManager::action(Akonadi::StandardCalendarActionManager::Type type) const

Returns the action of the given type, 0 if it has not been created (yet).

[signal] void StandardCalendarActionManager::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 *StandardCalendarActionManager::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 *StandardCalendarActionManager::createAction(Akonadi::StandardCalendarActionManager::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 StandardCalendarActionManager::createAllActions()

Convenience method to create all standard actions.

See also createAction().

void StandardCalendarActionManager::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 StandardCalendarActionManager::interceptAction(Akonadi::StandardCalendarActionManager::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 StandardCalendarActionManager::selectedCollections() const

Returns the list of collections that are currently selected. The list is empty if no collection is currently selected.

Akonadi::Item::List StandardCalendarActionManager::selectedItems() const

Returns the list of items that are currently selected. The list is empty if no item is currently selected.

void StandardCalendarActionManager::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 StandardCalendarActionManager::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 StandardCalendarActionManager::setContextText(Akonadi::StandardActionManager::Type type, Akonadi::StandardActionManager::TextContext context, const KLocalizedString &text)

Sets the text of the action type for the given context.

void StandardCalendarActionManager::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