32 #ifndef actionscheduler_h
33 #define actionscheduler_h
35 #include "kmfilteraction.h"
37 #include "kmfiltermgr.h"
38 #include "kmcommands.h"
41 #include <tqguardedptr.h>
49 class ActionScheduler :
public TQObject
55 enum ReturnCode { ResultOk, ResultError, ResultCriticalError };
57 ActionScheduler(KMFilterMgr::FilterSet set,
58 TQValueList<KMFilter*> filters,
65 void setAutoDestruct(
bool );
68 void setAlwaysMatch(
bool );
71 void setDefaultDestinationFolder(
KMFolder* );
79 void setFilterList( TQValueList<KMFilter*> filters );
82 void setAccountId( uint
id ) { mAccountId = id; mAccount =
true; }
85 void clearAccountId() { mAccountId = 0; mAccount =
false; }
88 void execFilters(
const TQValueList<TQ_UINT32> serNums);
89 void execFilters(
const TQPtrList<KMMsgBase> msgList);
90 void execFilters(KMMsgBase* msgBase);
91 void execFilters(TQ_UINT32 serNum);
93 static TQString debug();
94 static bool isEnabled();
100 bool ignoreChanges(
bool ignore );
104 void result(ReturnCode);
105 void filtered(TQ_UINT32);
112 void copyMessageFinished( KMCommand *command );
115 KMMsgBase* messageBase(TQ_UINT32 serNum);
119 void folderClosedOrExpunged();
121 int tempOpenFolder(
KMFolder* aFolder);
122 void tempCloseFolders();
127 void msgAdded(
KMFolder*, TQ_UINT32 );
128 void enqueue(TQ_UINT32 serNum);
131 void processMessage();
133 void filterMessage();
135 void moveMessageFinished( KMCommand *command );
140 static TQValueList<ActionScheduler*> *schedulerList;
141 static KMFolderMgr *tempFolderMgr;
142 static int refCount, count;
143 static bool sEnabled, sEnabledChecked;
144 TQValueListIterator<TQ_UINT32> mMessageIt;
145 TQValueListIterator<KMFilter> mFilterIt;
146 TQValueList<TQ_UINT32> mSerNums, mFetchSerNums;
147 TQValueList<TQGuardedPtr<KMFolder> > mOpenFolders;
148 TQValueList<KMFilter> mFilters, mQueuedFilters;
150 KMFilterMgr::FilterSet mSet;
152 TQGuardedPtr<KMFolder> mSrcFolder, mDestFolder;
153 bool mExecuting, mExecutingLock, mFetchExecuting;
154 bool mUnget, mFetchUnget;
156 bool mFiltersAreQueued;
161 TQ_UINT32 mOriginalSerNum;
162 bool mDeleteSrcFolder;
164 TQTimer *finishTimer, *fetchMessageTimer, *tempCloseFoldersTimer;
165 TQTimer *processMessageTimer, *filterMessageTimer;
166 TQTimer *timeOutTimer, *fetchTimeOutTimer;
167 TQTime timeOutTime, fetchTimeOutTime;
168 KMCommand *lastCommand;
Abstract base class for KMail's filter actions.
ReturnCode
Possible return codes of process: