00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef AKONADI_STANDARDMAILACTIONMANAGER_H
00023 #define AKONADI_STANDARDMAILACTIONMANAGER_H
00024
00025 #include "akonadi-kmime_export.h"
00026
00027 #include <akonadi/standardactionmanager.h>
00028
00029 #include <QtCore/QObject>
00030
00031 class KAction;
00032 class KActionCollection;
00033 class KJob;
00034 class QItemSelectionModel;
00035 class QWidget;
00036
00037 namespace Akonadi {
00038
00039 class Item;
00040
00047 class AKONADI_KMIME_EXPORT StandardMailActionManager : public QObject
00048 {
00049 Q_OBJECT
00050
00051 public:
00055 enum Type {
00056 MarkMailAsRead = StandardActionManager::LastType + 1,
00057 MarkMailAsUnread,
00058 MarkMailAsImportant,
00059 MarkMailAsActionItem,
00060 MarkAllMailAsRead,
00061 MarkAllMailAsUnread,
00062 MarkAllMailAsImportant,
00063 MarkAllMailAsActionItem,
00064 MoveToTrash,
00065 MoveAllToTrash,
00066 RemoveDuplicates,
00067 EmptyAllTrash,
00068 EmptyTrash,
00069 LastType
00070 };
00071
00078 explicit StandardMailActionManager( KActionCollection *actionCollection, QWidget *parent = 0 );
00079
00083 ~StandardMailActionManager();
00084
00090 void setCollectionSelectionModel( QItemSelectionModel *selectionModel );
00091
00096 void setItemSelectionModel( QItemSelectionModel* selectionModel );
00097
00103 KAction* createAction( Type type );
00104
00110 KAction* createAction( StandardActionManager::Type type );
00111
00116 void createAllActions();
00117
00121 KAction* action( Type type ) const;
00122
00126 KAction* action( StandardActionManager::Type type ) const;
00127
00140 void setActionText( StandardActionManager::Type type, const KLocalizedString &text );
00141
00149 void interceptAction( Type type, bool intercept = true );
00150
00158 void interceptAction( StandardActionManager::Type type, bool intercept = true );
00159
00164 Akonadi::Collection::List selectedCollections() const;
00165
00170 Akonadi::Item::List selectedItems() const;
00171
00178 void setFavoriteCollectionsModel( FavoriteCollectionsModel *favoritesModel );
00179
00186 void setFavoriteSelectionModel( QItemSelectionModel *selectionModel );
00187
00188 void setCollectionPropertiesPageNames( const QStringList &names );
00189
00190 Q_SIGNALS:
00196 void actionStateUpdated();
00197
00198 private:
00199
00200 class Private;
00201 Private* const d;
00202
00203 Q_PRIVATE_SLOT( d, void updateActions() )
00204 Q_PRIVATE_SLOT( d, void slotMarkAs() )
00205 Q_PRIVATE_SLOT( d, void slotMarkAllAs() )
00206 Q_PRIVATE_SLOT( d, void slotMoveToTrash() )
00207 Q_PRIVATE_SLOT( d, void slotMoveAllToTrash() )
00208 Q_PRIVATE_SLOT( d, void slotRemoveDuplicates() )
00209 Q_PRIVATE_SLOT( d, void slotEmptyAllTrash() )
00210 Q_PRIVATE_SLOT( d, void slotEmptyTrash() )
00211 Q_PRIVATE_SLOT( d, void slotMailLocalSubscription() )
00212
00213 };
00214
00215 }
00216
00217 #endif