23 #include "kmsearchpattern.h"
24 #include "kmpopheaders.h"
26 #include <tdeshortcut.h>
28 #include <tqptrlist.h>
37 const int FILTER_MAX_ACTIONS = 8;
54 enum ReturnCode { NoResult, GoOn, CriticalError };
65 enum AccountType { All, ButImap, Checked };
70 KMFilter( TDEConfig* aConfig=0 ,
bool popFilter =
false);
73 KMFilter(
const KMFilter & other );
79 TQString name()
const {
80 return mPattern.name();
94 ReturnCode execActions(
KMMessage* msg,
bool& stopIt )
const ;
98 bool requiresBody(KMMsgBase* msgBase);
101 KMPopFilterAction action();
104 void setAction(
const KMPopFilterAction aAction);
110 void writeConfig( TDEConfig* config )
const;
116 void readConfig( TDEConfig* config );
122 bool isEmpty()
const;
127 TQPtrList<KMFilterAction>* actions() {
return &mActions; }
130 const TQPtrList<KMFilterAction>* actions()
const {
return &mActions; }
146 void setApplyOnOutbound(
bool aApply=
true ) { bApplyOnOutbound = aApply; }
152 bool applyOnOutbound()
const {
return bApplyOnOutbound; }
158 void setApplyOnInbound(
bool aApply=
true ) { bApplyOnInbound = aApply; }
164 bool applyOnInbound()
const {
return bApplyOnInbound; }
170 void setApplyOnExplicit(
bool aApply=
true ) { bApplyOnExplicit = aApply; }
176 bool applyOnExplicit()
const {
return bApplyOnExplicit; }
185 void setApplicability( AccountType aApply=All ) { mApplicability = aApply; }
193 AccountType applicability()
const {
return mApplicability; }
201 void setApplyOnAccount( uint
id,
bool aApply=
true );
207 bool applyOnAccount( uint
id )
const;
209 void setStopProcessingHere(
bool aStop ) { bStopProcessingHere = aStop; }
210 bool stopProcessingHere()
const {
return bStopProcessingHere; }
214 void setConfigureShortcut(
bool aShort ) {
215 bConfigureShortcut = aShort;
216 bConfigureToolbar = bConfigureToolbar && bConfigureShortcut;
223 bool configureShortcut()
const {
return bConfigureShortcut; }
229 void setConfigureToolbar(
bool aTool ) {
230 bConfigureToolbar = aTool && bConfigureShortcut;
237 bool configureToolbar()
const {
return bConfigureToolbar; }
243 void setShortcut(
const TDEShortcut & shortcut ) { mShortcut = shortcut; };
248 const TDEShortcut & shortcut()
const {
return mShortcut; }
254 void setIcon( TQString icon ) { mIcon = icon; }
259 TQString icon()
const {
return mIcon; }
274 const TQString asString()
const;
278 bool isPopFilter()
const {
286 void setAutoNaming(
bool useAutomaticNames ) {
287 bAutoNaming = useAutomaticNames;
292 bool isAutoNaming()
const {
return bAutoNaming; }
296 TQPtrList<KMFilterAction> mActions;
297 TQValueList<int> mAccounts;
298 KMPopFilterAction mAction;
300 TDEShortcut mShortcut;
302 bool bApplyOnInbound : 1;
303 bool bApplyOnOutbound : 1;
304 bool bApplyOnExplicit : 1;
305 bool bStopProcessingHere : 1;
306 bool bConfigureShortcut : 1;
307 bool bConfigureToolbar : 1;
308 bool bAutoNaming : 1;
309 AccountType mApplicability;
Abstract base class for KMail's filter actions.
This class is an abstraction of a search over messages.