summaryrefslogtreecommitdiffabout
path: root/kaddressbook/filter.h
authorzautrix <zautrix>2005-01-16 14:10:42 (UTC)
committer zautrix <zautrix>2005-01-16 14:10:42 (UTC)
commitde5f08d69c716f85cc92f20700cd24fb1ad41295 (patch) (unidiff)
tree0a4f5dbbdb4fc24215ab85fa4b5e073d0e8104ef /kaddressbook/filter.h
parent3f61f5a339e9c0c67c17b16214abded0d123f246 (diff)
downloadkdepimpi-de5f08d69c716f85cc92f20700cd24fb1ad41295.zip
kdepimpi-de5f08d69c716f85cc92f20700cd24fb1ad41295.tar.gz
kdepimpi-de5f08d69c716f85cc92f20700cd24fb1ad41295.tar.bz2
added AB filter settings
Diffstat (limited to 'kaddressbook/filter.h') (more/less context) (show whitespace changes)
-rw-r--r--kaddressbook/filter.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/kaddressbook/filter.h b/kaddressbook/filter.h
index cf2c0a1..26870d7 100644
--- a/kaddressbook/filter.h
+++ b/kaddressbook/filter.h
@@ -18,48 +18,51 @@
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#ifndef FILTER_H 24#ifndef FILTER_H
25#define FILTER_H 25#define FILTER_H
26 26
27#include <qstring.h> 27#include <qstring.h>
28#include <qstringlist.h> 28#include <qstringlist.h>
29#include <qvaluelist.h> 29#include <qvaluelist.h>
30 30
31#include <kabc/addressee.h> 31#include <kabc/addressee.h>
32#include <kconfig.h> 32#include <kconfig.h>
33 33
34/** 34/**
35 Filter for AddressBook related objects (Addressees) 35 Filter for AddressBook related objects (Addressees)
36 36
37 @todo This class should be switched to use shared data. 37 @todo This class should be switched to use shared data.
38 */ 38 */
39class Filter 39class Filter
40{ 40{
41 public: 41 public:
42 enum { ShowPublic = 1, ShowPrivate = 2, ShowConfidential = 4};
43 void setCriteria(int c) { mCriteria = c ;}
44 int criteria() const { return mCriteria;}
42 typedef QValueList<Filter> List; 45 typedef QValueList<Filter> List;
43 46
44 enum MatchRule { Matching = 0, NotMatching = 1 }; 47 enum MatchRule { Matching = 0, NotMatching = 1 };
45 48
46 Filter(); 49 Filter();
47 Filter( const QString& name ); 50 Filter( const QString& name );
48 ~Filter(); 51 ~Filter();
49 52
50 /** 53 /**
51 Set the name of the filter. 54 Set the name of the filter.
52 */ 55 */
53 void setName( const QString &name ); 56 void setName( const QString &name );
54 57
55 /** 58 /**
56 @return The name of the filter. 59 @return The name of the filter.
57 */ 60 */
58 const QString &name() const; 61 const QString &name() const;
59 62
60 /** 63 /**
61 @return Whether the filter is an internal one. 64 @return Whether the filter is an internal one.
62 */ 65 */
63 bool isInternal() const; 66 bool isInternal() const;
64 67
65 /** 68 /**
@@ -122,32 +125,33 @@ class Filter
122 125
123 /** 126 /**
124 Restores a list of filters from a config file. 127 Restores a list of filters from a config file.
125 128
126 @param config The config file to read from. 129 @param config The config file to read from.
127 @param baseGroup The base group name to be used to find the filters 130 @param baseGroup The base group name to be used to find the filters
128 131
129 @return The list of filters. 132 @return The list of filters.
130 */ 133 */
131 static Filter::List restore( KConfig *config, QString baseGroup ); 134 static Filter::List restore( KConfig *config, QString baseGroup );
132 135
133 /** 136 /**
134 Sets the filter rule. If the rule is Filter::Matching (default), 137 Sets the filter rule. If the rule is Filter::Matching (default),
135 then the filter will return true on items that match the filter. 138 then the filter will return true on items that match the filter.
136 If the rule is Filter::NotMatching, then the filter will return 139 If the rule is Filter::NotMatching, then the filter will return
137 true on items that do not match the filter. 140 true on items that do not match the filter.
138 */ 141 */
139 void setMatchRule( MatchRule rule ); 142 void setMatchRule( MatchRule rule );
140 143
141 /** @return The current match rule. 144 /** @return The current match rule.
142 */ 145 */
143 MatchRule matchRule() const; 146 MatchRule matchRule() const;
144 147
145 private: 148 private:
149 int mCriteria;
146 QString mName; 150 QString mName;
147 QStringList mCategoryList; 151 QStringList mCategoryList;
148 MatchRule mMatchRule; 152 MatchRule mMatchRule;
149 bool mEnabled; 153 bool mEnabled;
150 bool mInternal; 154 bool mInternal;
151}; 155};
152 156
153#endif 157#endif