6 #ifndef _kmsearchpattern_h_
7 #define _kmsearchpattern_h_
10 #include <tqptrlist.h>
12 #include <tqcstring.h>
13 #include "kmmsgbase.h"
22 const int FILTER_MAX_RULES=8;
42 FuncContains=0, FuncContainsNot,
43 FuncEquals, FuncNotEqual,
44 FuncRegExp, FuncNotRegExp,
45 FuncIsGreater, FuncIsLessOrEqual,
46 FuncIsLess, FuncIsGreaterOrEqual,
47 FuncIsInAddressbook, FuncIsNotInAddressbook,
48 FuncIsInCategory, FuncIsNotInCategory,
49 FuncHasAttachment, FuncHasNoAttachment};
51 const TQString & contents=TQString() );
60 const TQString & contents=TQString() );
63 const char * function,
88 const DwBoyerMoore * headerField=0,
89 int headerLen=-1 ) const;
95 virtual bool isEmpty() const = 0;
107 void writeConfig( TDEConfig * config, int aIdx ) const;
126 TQCString field() const { return mField; }
136 void setContents( const TQString & aContents ) { mContents = aContents; }
142 static Function configValueToFunc( const char * str );
143 static TQString functionToString( Function function );
163 const TQString & contents=TQString() );
177 const DwBoyerMoore * headerField=0,
178 int headerLen=-1 ) const;
184 const DwBoyerMoore *mBmHeaderField;
198 const TQString & contents=TQString() );
205 const TQString & msgContents ) const;
211 struct MessageStatus {
212 const char * const text;
213 const char * const icon;
217 static const MessageStatus StatusValues[] = {
218 { I18N_NOOP( "Important" ), "kmmsgflag" },
219 { I18N_NOOP( "New" ), "kmmsgnew" },
220 { I18N_NOOP( "Unread" ), "kmmsgunseen" },
221 { I18N_NOOP( "Read" ), "kmmsgread" },
222 { I18N_NOOP( "Old" ), 0 },
223 { I18N_NOOP( "Deleted" ), "kmmsgdel" },
224 { I18N_NOOP( "Replied" ), "kmmsgreplied" },
225 { I18N_NOOP( "Forwarded" ), "kmmsgforwarded" },
226 { I18N_NOOP( "Queued" ), "kmmsgqueued" },
227 { I18N_NOOP( "Sent" ), "kmmsgsent" },
228 { I18N_NOOP( "Watched" ), "kmmsgwatched" },
229 { I18N_NOOP( "Ignored" ), "kmmsgignored" },
230 { I18N_NOOP( "Spam" ), "kmmsgspam" },
231 { I18N_NOOP( "Ham" ), "kmmsgham" },
232 { I18N_NOOP( "To Do" ), "kmmsgtodo" },
233 { I18N_NOOP( "Invitation" ), "kmmsginvitation" },
234 { I18N_NOOP( "Has Attachment"), "kmmsgattachment" }
237 enum StatusValueTypes {
253 StatusInvitation = 15,
254 StatusHasAttachment = 16
257 static const int StatusValueCount =
258 sizeof( StatusValues ) / sizeof( MessageStatus );
262 static const int StatusValueCountWithoutHidden = StatusValueCount - 1;
274 const TQString & contents=TQString() );
281 const DwBoyerMoore *,
283 static KMMsgStatus statusFromEnglishName( const TQString&);
341 bool matches( const DwString & str, bool ignoreBody = false ) const;
342 bool matches( TQ_UINT32 sernum, bool ignoreBody = false ) const;
376 TQString name() const { return mName; }
379 void setName( const TQString & newName ) { mName = newName ; }
400 void importLegacyConfig( const TDEConfig * config );
|