00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef AKONADI_AGENTACTIONMANAGER_H
00021 #define AKONADI_AGENTACTIONMANAGER_H
00022
00023 #include "akonadi_export.h"
00024
00025 #include <akonadi/agentinstance.h>
00026
00027 #include <QtCore/QObject>
00028
00029 class KAction;
00030 class KActionCollection;
00031 class QItemSelectionModel;
00032 class QWidget;
00033
00034 namespace Akonadi {
00035
00042 class AKONADI_EXPORT AgentActionManager : public QObject
00043 {
00044 Q_OBJECT
00045 public:
00049 enum Type {
00050 CreateAgentInstance,
00051 DeleteAgentInstance,
00052 ConfigureAgentInstance,
00053 LastType
00054 };
00055
00059 enum TextContext {
00060 DialogTitle,
00061 DialogText,
00062 MessageBoxTitle,
00063 MessageBoxText,
00064 MessageBoxAlternativeText,
00065 ErrorMessageTitle,
00066 ErrorMessageText
00067 };
00068
00075 explicit AgentActionManager( KActionCollection *actionCollection, QWidget *parent = 0 );
00076
00080 ~AgentActionManager();
00081
00086 void setSelectionModel( QItemSelectionModel *model );
00087
00091 void setMimeTypeFilter( const QStringList &mimeTypes );
00092
00096 void setCapabilityFilter( const QStringList &capabilities );
00097
00103 KAction* createAction( Type type );
00104
00109 void createAllActions();
00110
00114 KAction* action( Type type ) const;
00115
00125 void interceptAction( Type type, bool intercept = true );
00126
00133 Akonadi::AgentInstance::List selectedAgentInstances() const;
00134
00140 void setContextText( Type type, TextContext context, const QString &text );
00141
00142 Q_SIGNALS:
00148 void actionStateUpdated();
00149
00150 private:
00151
00152 class Private;
00153 Private* const d;
00154
00155 Q_PRIVATE_SLOT( d, void updateActions() )
00156
00157 Q_PRIVATE_SLOT( d, void slotCreateAgentInstance() )
00158 Q_PRIVATE_SLOT( d, void slotDeleteAgentInstance() )
00159 Q_PRIVATE_SLOT( d, void slotConfigureAgentInstance() )
00160
00161 Q_PRIVATE_SLOT( d, void slotAgentInstanceCreationResult(KJob*) )
00162
00163 };
00164
00165 }
00166
00167 #endif