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

akonadi

  • sources
  • kde-4.12
  • kdepimlibs
  • 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 
30 class KAction;
31 class KActionCollection;
32 class KLocalizedString;
33 class QItemSelectionModel;
34 class QWidget;
35 class QMenu;
36 
37 namespace Akonadi {
38 
39 class FavoriteCollectionsModel;
40 
126 class AKONADI_EXPORT StandardActionManager : public QObject
127 {
128  Q_OBJECT
129  public:
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 
355  Q_SIGNALS:
361  void actionStateUpdated();
362 
363  private:
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::StandardActionManager::Type
Type
Describes the supported actions.
Definition: standardactionmanager.h:133
Akonadi::StandardActionManager::MoveItemsToTrash
Moves the selected items to trash and marks them as deleted, needs EntityDeletedAttribute.
Definition: standardactionmanager.h:163
Akonadi::StandardActionManager::TextContext
TextContext
Describes the text context that can be customized.
Definition: standardactionmanager.h:177
Akonadi::StandardActionManager::MoveToTrashRestoreItemAlternative
Helper type for MoveToTrashRestoreItem, do not create directly. Use this to override texts of the res...
Definition: standardactionmanager.h:169
Akonadi::StandardActionManager::MoveItemToMenu
Menu allowing to move item into a collection.
Definition: standardactionmanager.h:148
Akonadi::StandardActionManager::CreateCollection
Creates an collection.
Definition: standardactionmanager.h:134
Akonadi::StandardActionManager::MessageBoxAlternativeText
An alternative text of a message box.
Definition: standardactionmanager.h:182
Akonadi::StandardActionManager::MoveCollectionsToTrash
Moves the selected collection to trash and marks it as deleted, needs EntityDeletedAttribute.
Definition: standardactionmanager.h:162
Akonadi::StandardActionManager::ErrorMessageTitle
The window title of an error message.
Definition: standardactionmanager.h:183
Akonadi::StandardActionManager::CopyItems
Copies the selected items.
Definition: standardactionmanager.h:139
Akonadi::StandardActionManager
Manages generic actions for collection and item views.
Definition: standardactionmanager.h:126
Akonadi::StandardActionManager::CopyCollectionToDialog
Copy a collection into another collection, select the target in a dialog.
Definition: standardactionmanager.h:157
Akonadi::Collection
Represents a collection of PIM items.
Definition: collection.h:75
Akonadi::StandardActionManager::ResourceProperties
Provides the resource properties.
Definition: standardactionmanager.h:154
Akonadi::StandardActionManager::CutItems
Cuts the selected items.
Definition: standardactionmanager.h:150
Akonadi::StandardActionManager::RestoreItemsFromTrash
Restores the selected items from trash, needs EntityDeletedAttribute.
Definition: standardactionmanager.h:165
Akonadi::StandardActionManager::ToggleWorkOffline
Toggles the work offline state of all resources.
Definition: standardactionmanager.h:156
Akonadi::StandardActionManager::RestoreCollectionsFromTrash
Restores the selected collection from trash, needs EntityDeletedAttribute.
Definition: standardactionmanager.h:164
Akonadi::StandardActionManager::MoveToTrashRestoreCollectionAlternative
Helper type for MoveToTrashRestoreCollection, do not create directly. Use this to override texts of t...
Definition: standardactionmanager.h:167
Akonadi::StandardActionManager::Paste
Paste collections or items.
Definition: standardactionmanager.h:140
Akonadi::StandardActionManager::CollectionProperties
Provides collection properties.
Definition: standardactionmanager.h:138
Akonadi::StandardActionManager::RemoveFromFavoriteCollections
Remove the collection from the favorite collections model.
Definition: standardactionmanager.h:144
Akonadi::StandardActionManager::CopyItemToDialog
Copy an item into a collection, select the target in a dialog.
Definition: standardactionmanager.h:159
Akonadi::StandardActionManager::AddToFavoriteCollections
Add the collection to the favorite collections model.
Definition: standardactionmanager.h:143
Akonadi::StandardActionManager::MessageBoxTitle
The window title of a message box.
Definition: standardactionmanager.h:180
Akonadi::StandardActionManager::SynchronizeCollectionsRecursive
Synchronizes collections in a recursive way.
Definition: standardactionmanager.h:161
Akonadi::StandardActionManager::CopyCollectionToMenu
Menu allowing to quickly copy a collection into another collection.
Definition: standardactionmanager.h:146
Akonadi::StandardActionManager::CutCollections
Cuts the selected collections.
Definition: standardactionmanager.h:151
Akonadi::StandardActionManager::DialogTitle
The window title of a dialog.
Definition: standardactionmanager.h:178
Akonadi::StandardActionManager::CopyItemToMenu
Menu allowing to quickly copy an item into a collection.
Definition: standardactionmanager.h:147
Akonadi::StandardActionManager::SynchronizeResources
Synchronizes the selected resources.
Definition: standardactionmanager.h:155
Akonadi::StandardActionManager::DeleteResources
Deletes the selected resources.
Definition: standardactionmanager.h:153
Akonadi::StandardActionManager::CopyCollections
Copies the selected collections.
Definition: standardactionmanager.h:135
Akonadi::StandardActionManager::MessageBoxText
The text of a message box.
Definition: standardactionmanager.h:181
Akonadi::StandardActionManager::DialogText
The text of a dialog.
Definition: standardactionmanager.h:179
Akonadi::StandardActionManager::MoveToTrashRestoreItem
Move Item to Trash or Restore it from Trash, needs EntityDeletedAttribute.
Definition: standardactionmanager.h:168
Akonadi::StandardActionManager::CreateResource
Creates a new resource.
Definition: standardactionmanager.h:152
Akonadi::StandardActionManager::MoveItemToDialog
Move an item into a collection, select the target in a dialog.
Definition: standardactionmanager.h:160
Akonadi::StandardActionManager::MoveCollectionToDialog
Move a collection into another collection, select the target in a dialog.
Definition: standardactionmanager.h:158
Akonadi::StandardActionManager::SynchronizeCollections
Synchronizes collections.
Definition: standardactionmanager.h:137
Akonadi::StandardActionManager::MoveToTrashRestoreCollection
Move Collection to Trash or Restore it from Trash, needs EntityDeletedAttribute.
Definition: standardactionmanager.h:166
Akonadi::StandardActionManager::ManageLocalSubscriptions
Manages local subscriptions.
Definition: standardactionmanager.h:142
Akonadi::Collection::List
QList< Collection > List
Describes a list of collections.
Definition: collection.h:81
Akonadi::StandardActionManager::DeleteItems
Deletes the selected items.
Definition: standardactionmanager.h:141
Akonadi::StandardActionManager::DeleteCollections
Deletes the selected collections.
Definition: standardactionmanager.h:136
Akonadi::StandardActionManager::MoveCollectionToMenu
Menu allowing to move a collection into another collection.
Definition: standardactionmanager.h:149
Akonadi::FavoriteCollectionsModel
A model that lists a set of favorite collections.
Definition: favoritecollectionsmodel.h:65
Akonadi::StandardActionManager::RenameFavoriteCollection
Rename the collection of the favorite collections model.
Definition: standardactionmanager.h:145
Akonadi::StandardActionManager::SynchronizeFavoriteCollections
Synchronize favorite collections.
Definition: standardactionmanager.h:170
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:00:28 by doxygen 1.8.7 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 API Reference

Skip menu "kdepimlibs API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kldap
  • kmbox
  • kmime
  • kpimidentities
  • kpimtextedit
  • kresources
  • ktnef
  • kxmlrpcclient
  • microblog

Search



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