filter.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef FILTER_H
00025 #define FILTER_H
00026
00027 #include <qstring.h>
00028 #include <qstringlist.h>
00029 #include <qvaluelist.h>
00030
00031 #include <kabc/addressee.h>
00032 #include <kconfig.h>
00033
00039 class Filter
00040 {
00041 public:
00042 typedef QValueList<Filter> List;
00043
00044 enum MatchRule { Matching = 0, NotMatching = 1 };
00045
00046 Filter();
00047 Filter( const QString& name );
00048 ~Filter();
00049
00053 void setName( const QString &name );
00054
00058 const QString &name() const;
00059
00063 bool isInternal() const;
00064
00072 void apply( KABC::Addressee::List &addresseeList );
00073
00080 bool filterAddressee( const KABC::Addressee &a );
00081
00085 void setEnabled( bool on );
00086
00090 bool isEnabled() const;
00091
00095 void setCategories( const QStringList &list );
00096
00100 const QStringList &categories() const;
00101
00105 void save( KConfig *config );
00106
00110 void restore( KConfig *config );
00111
00121 static void save( KConfig *config, QString baseGroup, Filter::List &list );
00122
00131 static Filter::List restore( KConfig *config, QString baseGroup );
00132
00139 void setMatchRule( MatchRule rule );
00140
00143 MatchRule matchRule() const;
00144
00145 private:
00146 QString mName;
00147 QStringList mCategoryList;
00148 MatchRule mMatchRule;
00149 bool mEnabled;
00150 bool mInternal;
00151 };
00152
00153 #endif
This file is part of the documentation for kaddressbook Library Version 3.2.2.