akonadi
preprocessorbase.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef AKONADI_PREPROCESSORBASE_H
00023 #define AKONADI_PREPROCESSORBASE_H
00024
00025 #include "akonadi_export.h"
00026
00027 #include <akonadi/agentbase.h>
00028 #include <akonadi/collection.h>
00029 #include <akonadi/item.h>
00030
00031 namespace Akonadi
00032 {
00033
00034 class ItemFetchScope;
00035
00036 class PreprocessorBasePrivate;
00037
00055 class AKONADI_EXPORT PreprocessorBase : public AgentBase
00056 {
00057 Q_OBJECT
00058
00059 public:
00063 enum ProcessingResult
00064 {
00069 ProcessingCompleted,
00070
00078 ProcessingDelayed,
00079
00085 ProcessingFailed,
00086
00095 ProcessingRefused
00096 };
00097
00116 virtual ProcessingResult processItem( const Item &item ) = 0;
00117
00129 void finishProcessing( ProcessingResult result );
00130
00142 void setFetchScope( const ItemFetchScope &fetchScope );
00143
00156 ItemFetchScope &fetchScope();
00157
00158 protected:
00164 PreprocessorBase( const QString &id );
00165
00169 virtual ~PreprocessorBase();
00170
00171 private:
00172
00173 Q_DECLARE_PRIVATE( PreprocessorBase )
00174
00175
00176 };
00177
00178 }
00179
00180 #ifndef AKONADI_PREPROCESSOR_MAIN
00181
00184 #define AKONADI_PREPROCESSOR_MAIN( preProcessorClass ) \
00185 int main( int argc, char **argv ) \
00186 { \
00187 return Akonadi::PreprocessorBase::init<preProcessorClass>( argc, argv ); \
00188 }
00189 #endif
00190
00191 #endif