• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.14.10 API Reference
  • KDE Home
  • Contact Us
 

akonadi

  • akonadi
standardactionmanager.h
1/*
2 Copyright (c) 2008 Volker Krause <vkrause@kde.org>
3
4 This library is free software; you can redistribute it and/or modify it
5 under the terms of the GNU Library General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or (at your
7 option) any later version.
8
9 This library is distributed in the hope that it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12 License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to the
16 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 02110-1301, USA.
18*/
19
20#ifndef AKONADI_STANDARDACTIONMANAGER_H
21#define AKONADI_STANDARDACTIONMANAGER_H
22
23#include "akonadi_export.h"
24
25#include <QtCore/QObject>
26
27#include <akonadi/collection.h>
28#include <akonadi/item.h>
29
30class KAction;
31class KActionCollection;
32class KLocalizedString;
33class QItemSelectionModel;
34class QWidget;
35class QMenu;
36
37namespace Akonadi {
38
39class FavoriteCollectionsModel;
40
126class AKONADI_EXPORT StandardActionManager : public QObject
127{
128 Q_OBJECT
129public:
133 enum Type {
134 CreateCollection,
135 CopyCollections,
136 DeleteCollections,
137 SynchronizeCollections,
138 CollectionProperties,
139 CopyItems,
140 Paste,
141 DeleteItems,
142 ManageLocalSubscriptions,
143 AddToFavoriteCollections,
144 RemoveFromFavoriteCollections,
145 RenameFavoriteCollection,
146 CopyCollectionToMenu,
147 CopyItemToMenu,
148 MoveItemToMenu,
149 MoveCollectionToMenu,
150 CutItems,
151 CutCollections,
152 CreateResource,
153 DeleteResources,
154 ResourceProperties,
155 SynchronizeResources,
156 ToggleWorkOffline,
157 CopyCollectionToDialog,
158 MoveCollectionToDialog,
159 CopyItemToDialog,
160 MoveItemToDialog,
161 SynchronizeCollectionsRecursive,
162 MoveCollectionsToTrash,
163 MoveItemsToTrash,
164 RestoreCollectionsFromTrash,
165 RestoreItemsFromTrash,
166 MoveToTrashRestoreCollection,
167 MoveToTrashRestoreCollectionAlternative,
168 MoveToTrashRestoreItem,
169 MoveToTrashRestoreItemAlternative,
170 SynchronizeFavoriteCollections,
171 LastType
172 };
173
177 enum TextContext {
178 DialogTitle,
179 DialogText,
180 MessageBoxTitle,
181 MessageBoxText,
182 MessageBoxAlternativeText,
183 ErrorMessageTitle,
184 ErrorMessageText
185 };
186
193 explicit StandardActionManager(KActionCollection *actionCollection, QWidget *parent = 0);
194
198 ~StandardActionManager();
199
207 void setCollectionSelectionModel(QItemSelectionModel *selectionModel);
208
215 void setItemSelectionModel(QItemSelectionModel *selectionModel);
216
225 void setFavoriteCollectionsModel(FavoriteCollectionsModel *favoritesModel);
226
235 void setFavoriteSelectionModel(QItemSelectionModel *selectionModel);
236
244 KAction *createAction(Type type);
245
250 void createAllActions();
251
256 KAction *action(Type type) const;
257
271 void setActionText(Type type, const KLocalizedString &text);
272
283 void interceptAction(Type type, bool intercept = true);
284
291 Akonadi::Collection::List selectedCollections() const;
292
299 Akonadi::Item::List selectedItems() const;
300
309 void setContextText(Type type, TextContext context, const QString &text);
310
319 void setContextText(Type type, TextContext context, const KLocalizedString &text);
320
327 void setMimeTypeFilter(const QStringList &mimeTypes);
328
335 void setCapabilityFilter(const QStringList &capabilities);
336
344 void setCollectionPropertiesPageNames(const QStringList &names);
345
353 void createActionFolderMenu(QMenu *menu, Type type);
354
355Q_SIGNALS:
361 void actionStateUpdated();
362
363private:
364 //@cond PRIVATE
365 class Private;
366 Private *const d;
367
368 Q_PRIVATE_SLOT( d, void updateActions() )
369#ifndef QT_NO_CLIPBOARD
370 Q_PRIVATE_SLOT( d, void clipboardChanged(QClipboard::Mode) )
371#endif
372 Q_PRIVATE_SLOT( d, void collectionSelectionChanged() )
373 Q_PRIVATE_SLOT( d, void favoriteSelectionChanged() )
374
375 Q_PRIVATE_SLOT( d, void slotCreateCollection() )
376 Q_PRIVATE_SLOT( d, void slotCopyCollections() )
377 Q_PRIVATE_SLOT( d, void slotCutCollections() )
378 Q_PRIVATE_SLOT( d, void slotDeleteCollection() )
379 Q_PRIVATE_SLOT( d, void slotMoveCollectionToTrash() )
380 Q_PRIVATE_SLOT( d, void slotMoveItemToTrash() )
381 Q_PRIVATE_SLOT( d, void slotRestoreCollectionFromTrash() )
382 Q_PRIVATE_SLOT( d, void slotRestoreItemFromTrash() )
383 Q_PRIVATE_SLOT( d, void slotTrashRestoreCollection() )
384 Q_PRIVATE_SLOT( d, void slotTrashRestoreItem() )
385 Q_PRIVATE_SLOT( d, void slotSynchronizeCollection() )
386 Q_PRIVATE_SLOT( d, void slotSynchronizeCollectionRecursive() )
387 Q_PRIVATE_SLOT( d, void slotSynchronizeFavoriteCollections() )
388 Q_PRIVATE_SLOT( d, void slotCollectionProperties() )
389 Q_PRIVATE_SLOT( d, void slotCopyItems() )
390 Q_PRIVATE_SLOT( d, void slotCutItems() )
391 Q_PRIVATE_SLOT( d, void slotPaste() )
392 Q_PRIVATE_SLOT( d, void slotDeleteItems() )
393 Q_PRIVATE_SLOT( d, void slotDeleteItemsDeferred(const Akonadi::Item::List &) )
394 Q_PRIVATE_SLOT( d, void slotLocalSubscription() )
395 Q_PRIVATE_SLOT( d, void slotAddToFavorites() )
396 Q_PRIVATE_SLOT( d, void slotRemoveFromFavorites() )
397 Q_PRIVATE_SLOT( d, void slotRenameFavorite() )
398 Q_PRIVATE_SLOT( d, void slotCopyCollectionTo() )
399 Q_PRIVATE_SLOT( d, void slotMoveCollectionTo() )
400 Q_PRIVATE_SLOT( d, void slotCopyItemTo() )
401 Q_PRIVATE_SLOT( d, void slotMoveItemTo() )
402 Q_PRIVATE_SLOT( d, void slotCopyCollectionTo(QAction*) )
403 Q_PRIVATE_SLOT( d, void slotMoveCollectionTo(QAction*) )
404 Q_PRIVATE_SLOT( d, void slotCopyItemTo(QAction*) )
405 Q_PRIVATE_SLOT( d, void slotMoveItemTo(QAction*) )
406 Q_PRIVATE_SLOT( d, void slotCreateResource() )
407 Q_PRIVATE_SLOT( d, void slotDeleteResource() )
408 Q_PRIVATE_SLOT( d, void slotResourceProperties() )
409 Q_PRIVATE_SLOT( d, void slotSynchronizeResource() )
410 Q_PRIVATE_SLOT( d, void slotToggleWorkOffline(bool) )
411
412 Q_PRIVATE_SLOT( d, void collectionCreationResult(KJob*) )
413 Q_PRIVATE_SLOT( d, void collectionDeletionResult(KJob*) )
414 Q_PRIVATE_SLOT( d, void moveCollectionToTrashResult(KJob*) )
415 Q_PRIVATE_SLOT( d, void moveItemToTrashResult(KJob*) )
416 Q_PRIVATE_SLOT( d, void itemDeletionResult(KJob*) )
417 Q_PRIVATE_SLOT( d, void resourceCreationResult(KJob*) )
418 Q_PRIVATE_SLOT( d, void pasteResult(KJob*) )
419
420 Q_PRIVATE_SLOT( d, void enableAction(int, bool) )
421 Q_PRIVATE_SLOT( d, void updatePluralLabel(int, int) )
422 Q_PRIVATE_SLOT( d, void updateAlternatingAction(int) )
423 Q_PRIVATE_SLOT( d, bool isFavoriteCollection(const Akonadi::Collection&) )
424
425 Q_PRIVATE_SLOT( d, void aboutToShowMenu() )
426 //@endcond
427};
428
429}
430
431#endif
Akonadi::Collection
Represents a collection of PIM items.
Definition: collection.h:76
Akonadi::Collection::List
QList< Collection > List
Describes a list of collections.
Definition: collection.h:81
Akonadi::FavoriteCollectionsModel
A model that lists a set of favorite collections.
Definition: favoritecollectionsmodel.h:67
Akonadi::StandardActionManager
Manages generic actions for collection and item views.
Definition: standardactionmanager.h:127
Akonadi::StandardActionManager::actionStateUpdated
void actionStateUpdated()
This signal is emitted whenever the action state has been updated.
Akonadi::StandardActionManager::setCollectionSelectionModel
void setCollectionSelectionModel(QItemSelectionModel *selectionModel)
Sets the collection selection model based on which the collection related actions should operate.
Akonadi::StandardActionManager::setItemSelectionModel
void setItemSelectionModel(QItemSelectionModel *selectionModel)
Sets the item selection model based on which the item related actions should operate.
Akonadi::StandardActionManager::createAction
KAction * createAction(Type type)
Creates the action of the given type and adds it to the action collection specified in the constructo...
Akonadi::StandardActionManager::action
KAction * action(Type type) const
Returns the action of the given type, 0 if it has not been created (yet).
Akonadi::StandardActionManager::setContextText
void setContextText(Type type, TextContext context, const QString &text)
Sets the text of the action type for the given context.
Akonadi::StandardActionManager::Type
Type
Describes the supported actions.
Definition: standardactionmanager.h:133
Akonadi::StandardActionManager::CreateResource
@ CreateResource
Creates a new resource.
Definition: standardactionmanager.h:152
Akonadi::StandardActionManager::CreateCollection
@ CreateCollection
Creates an collection.
Definition: standardactionmanager.h:134
Akonadi::StandardActionManager::MoveToTrashRestoreItem
@ MoveToTrashRestoreItem
Move Item to Trash or Restore it from Trash, needs EntityDeletedAttribute.
Definition: standardactionmanager.h:168
Akonadi::StandardActionManager::SynchronizeResources
@ SynchronizeResources
Synchronizes the selected resources.
Definition: standardactionmanager.h:155
Akonadi::StandardActionManager::RemoveFromFavoriteCollections
@ RemoveFromFavoriteCollections
Remove the collection from the favorite collections model.
Definition: standardactionmanager.h:144
Akonadi::StandardActionManager::DeleteItems
@ DeleteItems
Deletes the selected items.
Definition: standardactionmanager.h:141
Akonadi::StandardActionManager::CopyCollectionToDialog
@ CopyCollectionToDialog
Copy a collection into another collection, select the target in a dialog.
Definition: standardactionmanager.h:157
Akonadi::StandardActionManager::SynchronizeCollections
@ SynchronizeCollections
Synchronizes collections.
Definition: standardactionmanager.h:137
Akonadi::StandardActionManager::MoveCollectionToDialog
@ MoveCollectionToDialog
Move a collection into another collection, select the target in a dialog.
Definition: standardactionmanager.h:158
Akonadi::StandardActionManager::CopyItemToMenu
@ CopyItemToMenu
Menu allowing to quickly copy an item into a collection.
Definition: standardactionmanager.h:147
Akonadi::StandardActionManager::RenameFavoriteCollection
@ RenameFavoriteCollection
Rename the collection of the favorite collections model.
Definition: standardactionmanager.h:145
Akonadi::StandardActionManager::SynchronizeFavoriteCollections
@ SynchronizeFavoriteCollections
Synchronize favorite collections.
Definition: standardactionmanager.h:170
Akonadi::StandardActionManager::ResourceProperties
@ ResourceProperties
Provides the resource properties.
Definition: standardactionmanager.h:154
Akonadi::StandardActionManager::CutItems
@ CutItems
Cuts the selected items.
Definition: standardactionmanager.h:150
Akonadi::StandardActionManager::DeleteCollections
@ DeleteCollections
Deletes the selected collections.
Definition: standardactionmanager.h:136
Akonadi::StandardActionManager::MoveToTrashRestoreCollection
@ MoveToTrashRestoreCollection
Move Collection to Trash or Restore it from Trash, needs EntityDeletedAttribute.
Definition: standardactionmanager.h:166
Akonadi::StandardActionManager::ToggleWorkOffline
@ ToggleWorkOffline
Toggles the work offline state of all resources.
Definition: standardactionmanager.h:156
Akonadi::StandardActionManager::ManageLocalSubscriptions
@ ManageLocalSubscriptions
Manages local subscriptions.
Definition: standardactionmanager.h:142
Akonadi::StandardActionManager::CutCollections
@ CutCollections
Cuts the selected collections.
Definition: standardactionmanager.h:151
Akonadi::StandardActionManager::CopyCollectionToMenu
@ CopyCollectionToMenu
Menu allowing to quickly copy a collection into another collection.
Definition: standardactionmanager.h:146
Akonadi::StandardActionManager::MoveItemToMenu
@ MoveItemToMenu
Menu allowing to move item into a collection.
Definition: standardactionmanager.h:148
Akonadi::StandardActionManager::AddToFavoriteCollections
@ AddToFavoriteCollections
Add the collection to the favorite collections model.
Definition: standardactionmanager.h:143
Akonadi::StandardActionManager::SynchronizeCollectionsRecursive
@ SynchronizeCollectionsRecursive
Synchronizes collections in a recursive way.
Definition: standardactionmanager.h:161
Akonadi::StandardActionManager::MoveItemsToTrash
@ MoveItemsToTrash
Moves the selected items to trash and marks them as deleted, needs EntityDeletedAttribute.
Definition: standardactionmanager.h:163
Akonadi::StandardActionManager::CopyCollections
@ CopyCollections
Copies the selected collections.
Definition: standardactionmanager.h:135
Akonadi::StandardActionManager::Paste
@ Paste
Paste collections or items.
Definition: standardactionmanager.h:140
Akonadi::StandardActionManager::CollectionProperties
@ CollectionProperties
Provides collection properties.
Definition: standardactionmanager.h:138
Akonadi::StandardActionManager::MoveToTrashRestoreCollectionAlternative
@ MoveToTrashRestoreCollectionAlternative
Helper type for MoveToTrashRestoreCollection, do not create directly. Use this to override texts of t...
Definition: standardactionmanager.h:167
Akonadi::StandardActionManager::DeleteResources
@ DeleteResources
Deletes the selected resources.
Definition: standardactionmanager.h:153
Akonadi::StandardActionManager::RestoreItemsFromTrash
@ RestoreItemsFromTrash
Restores the selected items from trash, needs EntityDeletedAttribute.
Definition: standardactionmanager.h:165
Akonadi::StandardActionManager::MoveToTrashRestoreItemAlternative
@ MoveToTrashRestoreItemAlternative
Helper type for MoveToTrashRestoreItem, do not create directly. Use this to override texts of the res...
Definition: standardactionmanager.h:169
Akonadi::StandardActionManager::RestoreCollectionsFromTrash
@ RestoreCollectionsFromTrash
Restores the selected collection from trash, needs EntityDeletedAttribute.
Definition: standardactionmanager.h:164
Akonadi::StandardActionManager::CopyItems
@ CopyItems
Copies the selected items.
Definition: standardactionmanager.h:139
Akonadi::StandardActionManager::MoveCollectionToMenu
@ MoveCollectionToMenu
Menu allowing to move a collection into another collection.
Definition: standardactionmanager.h:149
Akonadi::StandardActionManager::MoveItemToDialog
@ MoveItemToDialog
Move an item into a collection, select the target in a dialog.
Definition: standardactionmanager.h:160
Akonadi::StandardActionManager::CopyItemToDialog
@ CopyItemToDialog
Copy an item into a collection, select the target in a dialog.
Definition: standardactionmanager.h:159
Akonadi::StandardActionManager::MoveCollectionsToTrash
@ MoveCollectionsToTrash
Moves the selected collection to trash and marks it as deleted, needs EntityDeletedAttribute.
Definition: standardactionmanager.h:162
Akonadi::StandardActionManager::setCapabilityFilter
void setCapabilityFilter(const QStringList &capabilities)
Sets the capability filter that will be used when creating new resources.
Akonadi::StandardActionManager::createActionFolderMenu
void createActionFolderMenu(QMenu *menu, Type type)
Create a popup menu.
Akonadi::StandardActionManager::createAllActions
void createAllActions()
Convenience method to create all standard actions.
Akonadi::StandardActionManager::setActionText
void setActionText(Type type, const KLocalizedString &text)
Sets the label of the action type to text, which is used during updating the action state and substit...
Akonadi::StandardActionManager::setFavoriteCollectionsModel
void setFavoriteCollectionsModel(FavoriteCollectionsModel *favoritesModel)
Sets the favorite collections model based on which the collection relatedactions should operate.
Akonadi::StandardActionManager::setCollectionPropertiesPageNames
void setCollectionPropertiesPageNames(const QStringList &names)
Sets the page names of the config pages that will be used by the built-in collection properties dialo...
Akonadi::StandardActionManager::interceptAction
void interceptAction(Type type, bool intercept=true)
Sets whether the default implementation for the given action type shall be executed when the action i...
Akonadi::StandardActionManager::StandardActionManager
StandardActionManager(KActionCollection *actionCollection, QWidget *parent=0)
Creates a new standard action manager.
Akonadi::StandardActionManager::setMimeTypeFilter
void setMimeTypeFilter(const QStringList &mimeTypes)
Sets the mime type filter that will be used when creating new resources.
Akonadi::StandardActionManager::selectedCollections
Akonadi::Collection::List selectedCollections() const
Returns the list of collections that are currently selected.
Akonadi::StandardActionManager::selectedItems
Akonadi::Item::List selectedItems() const
Returns the list of items that are currently selected.
Akonadi::StandardActionManager::~StandardActionManager
~StandardActionManager()
Destroys the standard action manager.
Akonadi::StandardActionManager::setContextText
void setContextText(Type type, TextContext context, const KLocalizedString &text)
Sets the text of the action type for the given context.
Akonadi::StandardActionManager::TextContext
TextContext
Describes the text context that can be customized.
Definition: standardactionmanager.h:177
Akonadi::StandardActionManager::MessageBoxText
@ MessageBoxText
The text of a message box.
Definition: standardactionmanager.h:181
Akonadi::StandardActionManager::DialogText
@ DialogText
The text of a dialog.
Definition: standardactionmanager.h:179
Akonadi::StandardActionManager::MessageBoxTitle
@ MessageBoxTitle
The window title of a message box.
Definition: standardactionmanager.h:180
Akonadi::StandardActionManager::DialogTitle
@ DialogTitle
The window title of a dialog.
Definition: standardactionmanager.h:178
Akonadi::StandardActionManager::ErrorMessageTitle
@ ErrorMessageTitle
The window title of an error message.
Definition: standardactionmanager.h:183
Akonadi::StandardActionManager::MessageBoxAlternativeText
@ MessageBoxAlternativeText
An alternative text of a message box.
Definition: standardactionmanager.h:182
Akonadi::StandardActionManager::setFavoriteSelectionModel
void setFavoriteSelectionModel(QItemSelectionModel *selectionModel)
Sets the favorite collection selection model based on which the favorite collection related actions s...
Akonadi
FreeBusyManager::Singleton.
Definition: actionstatemanager_p.h:28
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu Jul 21 2022 00:00:00 by doxygen 1.9.5 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

akonadi

Skip menu "akonadi"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Modules
  • Related Pages

kdepimlibs-4.14.10 API Reference

Skip menu "kdepimlibs-4.14.10 API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal