00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef FILTERITEMCRITERIA_H
00019 #define FILTERITEMCRITERIA_H
00020
00021
00022 #include <qstring.h>
00023 #include <qregexp.h>
00024
00025
00026 #include <kapplication.h>
00027 #include <kconfig.h>
00028 #include <kdebug.h>
00029 #include <KConfigGroup>
00030
00031
00032 #include "types.h"
00033 #include "constants.h"
00034
00041 class FilterItemCriteria{
00042
00043 public:
00044
00050 FilterItemCriteria( uint FilterNr, uint CritNr );
00051
00055 ~FilterItemCriteria();
00056
00067 bool check( QString from, QString to, uint size, QString subject, QStringList header, QString account ) const;
00068
00072 void print() const;
00073
00074 private:
00075
00079 enum Source_Type{ SrcFrom, SrcTo, SrcSize, SrcSubject, SrcHeader, SrcAccount };
00080
00084 Source_Type source;
00085
00089 enum TextCondition_Type{ TxtCondContains, TxtCondNotContains, TxtCondEqual, TxtCondNotEqual, TxtCondRegExpr, TxtCondNotRegExpr };
00090
00094 enum NumCondition_Type{ NumCondEqual, NumCondNotEqual, NumCondGreater, NumCondGreaterEqual, NumCondLess, NumCondLessEqual };
00095
00099 TextCondition_Type txtCondition;
00100
00104 NumCondition_Type numCondition;
00105
00109 QString txtValue;
00110
00114 uint numValue;
00115
00119 bool cs;
00120
00124 uint FilterNumber;
00125
00129 uint CriteriaNumber;
00130
00131 protected:
00132
00138 bool checkText( QString value ) const;
00139
00145 bool checkNum( uint value ) const;
00146
00152 bool checkTextList( QStringList list ) const;
00153 };
00154
00155 #endif