23#include "kmfilteraction.h"
26#include <tqguardedptr.h>
31template <
typename T>
class TQValueVector;
32template <
typename T>
class TQValueList;
34class KMFilterMgr:
public TQObject
40 KMFilterMgr(
bool popFilter =
false);
41 virtual ~KMFilterMgr();
46 enum FilterSet { NoSet = 0x0, Inbound = 0x1, Outbound = 0x2, Explicit = 0x4,
47 All = Inbound|Outbound|Explicit };
50 void readConfig(
void);
53 void writeConfig(
bool withSync=
true);
58 void openDialog( TQWidget *parent,
bool checkForEmptyFilterList =
true );
62 void createFilter(
const TQCString & field,
const TQString & value );
64 bool beginFiltering(KMMsgBase *msgBase)
const;
65 int moveMessage(KMMessage *msg)
const;
66 void endFiltering(KMMsgBase *msgBase)
const;
73 bool atLeastOneFilterAppliesTo(
unsigned int accountID )
const;
79 bool atLeastOneIncomingFilterAppliesTo(
unsigned int accountID )
const;
83 bool atLeastOneOnlineImapFolderTarget();
87 const TQString createUniqueName(
const TQString & name );
92 void appendFilters(
const TQValueList<KMFilter*> &filters,
93 bool replaceIfNameExists =
false );
97 void setFilters(
const TQValueList<KMFilter*> &filters );
100 const TQValueList<KMFilter*> & filters()
const {
return mFilters; }
116 int process( KMMessage * msg, FilterSet aSet = Inbound,
117 bool account =
false, uint accountId = 0 );
123 int process( KMMessage * msg,
const KMFilter * filter );
127 int process( TQ_UINT32 serNum,
const KMFilter * filter );
138 void deref(
bool force =
false);
144 int tempOpenFolder(KMFolder* aFolder);
148 void beginUpdate() {}
162 bool folderRemoved(KMFolder* aFolder, KMFolder* aNewFolder);
166 void folderCreated(KMFolder*) {}
169 void setShowLaterMsgs(
bool show ) {
174 bool showLaterMsgs()
const {
178 void slotFolderRemoved( KMFolder *aFolder );
181 void filterListUpdated();
184 int processPop( KMMessage *msg )
const;
186 bool isMatching( TQ_UINT32 serNum,
const KMFilter *filter );
188 TQGuardedPtr<KMFilterDlg> mEditDialog;
189 TQValueVector<KMFolder *> mOpenFolders;
190 TQValueList<KMFilter *> mFilters;
193 bool mDirtyBufferedFolderTarget;
194 bool mBufferedFolderTarget;