00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef AKONADI_STANDARDCALENDARACTIONMANAGER_H
00023 #define AKONADI_STANDARDCALENDARACTIONMANAGER_H
00024
00025 #include "akonadi-calendar_export.h"
00026
00027 #include <akonadi/standardactionmanager.h>
00028
00029 #include <QtCore/QObject>
00030
00031
00032 #undef CreateEvent
00033
00034 class KAction;
00035 class KActionCollection;
00036 class QItemSelectionModel;
00037 class QWidget;
00038
00039 namespace Akonadi
00040 {
00041
00042 class Item;
00049 class AKONADI_CALENDAR_EXPORT StandardCalendarActionManager : public QObject
00050 {
00051 Q_OBJECT
00052
00053 public:
00057 enum Type {
00058 CreateEvent = StandardActionManager::LastType + 1,
00059 CreateTodo,
00060 CreateSubTodo,
00061 CreateJournal,
00062 EditIncidence,
00063 LastType
00064 };
00065
00072 explicit StandardCalendarActionManager( KActionCollection *actionCollection, QWidget *parent = 0 );
00073
00077 ~StandardCalendarActionManager();
00078
00084 void setCollectionSelectionModel( QItemSelectionModel *selectionModel );
00085
00090 void setItemSelectionModel( QItemSelectionModel* selectionModel );
00091
00097 KAction* createAction( Type type );
00098
00104 KAction* createAction( StandardActionManager::Type type );
00105
00110 void createAllActions();
00111
00115 KAction* action( Type type ) const;
00116
00120 KAction* action( StandardActionManager::Type type ) const;
00121
00134 void setActionText( StandardActionManager::Type type, const KLocalizedString &text );
00135
00143 void interceptAction( Type type, bool intercept = true );
00144
00152 void interceptAction( StandardActionManager::Type type, bool intercept = true );
00153
00158 Akonadi::Collection::List selectedCollections() const;
00159
00164 Akonadi::Item::List selectedItems() const;
00165
00169 void setContextText( StandardActionManager::Type type, StandardActionManager::TextContext context, const QString &text );
00170
00174 void setContextText( StandardActionManager::Type type, StandardActionManager::TextContext context, const KLocalizedString &text );
00175
00176 void setCollectionPropertiesPageNames( const QStringList &names );
00177
00178 Q_SIGNALS:
00184 void actionStateUpdated();
00185
00186 private:
00187
00188 class Private;
00189 Private* const d;
00190
00191 Q_PRIVATE_SLOT( d, void slotCreateEvent() )
00192 Q_PRIVATE_SLOT( d, void slotCreateTodo() )
00193 Q_PRIVATE_SLOT( d, void slotCreateSubTodo() )
00194 Q_PRIVATE_SLOT( d, void slotCreateJournal() )
00195 Q_PRIVATE_SLOT( d, void slotEditIncidence() )
00196 Q_PRIVATE_SLOT( d, void updateActions() )
00197
00198 };
00199
00200 }
00201
00202 #endif