-rw-r--r-- | kabc/distributionlist.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/kabc/distributionlist.h b/kabc/distributionlist.h index c81e543..8d21a17 100644 --- a/kabc/distributionlist.h +++ b/kabc/distributionlist.h | |||
@@ -1,83 +1,86 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of libkabc. | 2 | This file is part of libkabc. |
3 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> | 3 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> |
4 | 4 | ||
5 | This library is free software; you can redistribute it and/or | 5 | This library is free software; you can redistribute it and/or |
6 | modify it under the terms of the GNU Library General Public | 6 | modify it under the terms of the GNU Library General Public |
7 | License as published by the Free Software Foundation; either | 7 | License as published by the Free Software Foundation; either |
8 | version 2 of the License, or (at your option) any later version. | 8 | version 2 of the License, or (at your option) any later version. |
9 | 9 | ||
10 | This library is distributed in the hope that it will be useful, | 10 | This library is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Library General Public License for more details. | 13 | Library General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Library General Public License | 15 | You should have received a copy of the GNU Library General Public License |
16 | along with this library; see the file COPYING.LIB. If not, write to | 16 | along with this library; see the file COPYING.LIB. If not, write to |
17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
18 | Boston, MA 02111-1307, USA. | 18 | Boston, MA 02111-1307, USA. |
19 | */ | 19 | */ |
20 | 20 | ||
21 | #ifndef KABC_DISTRIBUTIONLIST_H | 21 | #ifndef KABC_DISTRIBUTIONLIST_H |
22 | #define KABC_DISTRIBUTIONLIST_H | 22 | #define KABC_DISTRIBUTIONLIST_H |
23 | 23 | ||
24 | //#include <kdirwatch.h> | 24 | //#include <kdirwatch.h> |
25 | 25 | ||
26 | #include "addressbook.h" | 26 | #include "addressbook.h" |
27 | //Added by qt3to4: | ||
28 | #include <Q3ValueList> | ||
29 | #include <Q3PtrList> | ||
27 | 30 | ||
28 | namespace KABC { | 31 | namespace KABC { |
29 | 32 | ||
30 | class DistributionListManager; | 33 | class DistributionListManager; |
31 | 34 | ||
32 | /** | 35 | /** |
33 | @short Distribution list of email addresses | 36 | @short Distribution list of email addresses |
34 | 37 | ||
35 | This class represents a list of email addresses. Each email address is | 38 | This class represents a list of email addresses. Each email address is |
36 | associated with an address book entry. If the address book entry changes, the | 39 | associated with an address book entry. If the address book entry changes, the |
37 | entry in the distribution list is automatically updated. | 40 | entry in the distribution list is automatically updated. |
38 | */ | 41 | */ |
39 | class DistributionList | 42 | class DistributionList |
40 | { | 43 | { |
41 | public: | 44 | public: |
42 | /** | 45 | /** |
43 | @short Distribution List Entry | 46 | @short Distribution List Entry |
44 | 47 | ||
45 | This class represents an entry of a distribution list. It consists of an | 48 | This class represents an entry of a distribution list. It consists of an |
46 | addressee and an email address. If the email address is null, the | 49 | addressee and an email address. If the email address is null, the |
47 | preferred email address of the addressee is used. | 50 | preferred email address of the addressee is used. |
48 | */ | 51 | */ |
49 | struct Entry | 52 | struct Entry |
50 | { | 53 | { |
51 | typedef QValueList<Entry> List; | 54 | typedef Q3ValueList<Entry> List; |
52 | 55 | ||
53 | Entry() {} | 56 | Entry() {} |
54 | Entry( const Addressee &_addressee, const QString &_email ) : | 57 | Entry( const Addressee &_addressee, const QString &_email ) : |
55 | addressee( _addressee ), email( _email ) {} | 58 | addressee( _addressee ), email( _email ) {} |
56 | 59 | ||
57 | Addressee addressee; | 60 | Addressee addressee; |
58 | QString email; | 61 | QString email; |
59 | }; | 62 | }; |
60 | 63 | ||
61 | /** | 64 | /** |
62 | Create distribution list object. | 65 | Create distribution list object. |
63 | 66 | ||
64 | @param manager Managing object of this list. | 67 | @param manager Managing object of this list. |
65 | @param name Name of this list. | 68 | @param name Name of this list. |
66 | */ | 69 | */ |
67 | DistributionList( DistributionListManager *manager, const QString &name ); | 70 | DistributionList( DistributionListManager *manager, const QString &name ); |
68 | 71 | ||
69 | /** | 72 | /** |
70 | Destructor. | 73 | Destructor. |
71 | */ | 74 | */ |
72 | ~DistributionList(); | 75 | ~DistributionList(); |
73 | 76 | ||
74 | /** | 77 | /** |
75 | Set name of this list. The name is used as key by the | 78 | Set name of this list. The name is used as key by the |
76 | DistributinListManager. | 79 | DistributinListManager. |
77 | */ | 80 | */ |
78 | void setName( const QString & ); | 81 | void setName( const QString & ); |
79 | 82 | ||
80 | /** | 83 | /** |
81 | Get name of this list. | 84 | Get name of this list. |
82 | */ | 85 | */ |
83 | QString name() const; | 86 | QString name() const; |
@@ -138,65 +141,65 @@ class DistributionListManager | |||
138 | DistributionList *list( const QString &name ); | 141 | DistributionList *list( const QString &name ); |
139 | 142 | ||
140 | /** | 143 | /** |
141 | Insert distribution list. If a list with this name already exists, nothing | 144 | Insert distribution list. If a list with this name already exists, nothing |
142 | happens. | 145 | happens. |
143 | */ | 146 | */ |
144 | void insert( DistributionList * ); | 147 | void insert( DistributionList * ); |
145 | 148 | ||
146 | /** | 149 | /** |
147 | Remove distribution list. If a list with this name doesn't exist, nothing | 150 | Remove distribution list. If a list with this name doesn't exist, nothing |
148 | happens. | 151 | happens. |
149 | */ | 152 | */ |
150 | void remove( DistributionList * ); | 153 | void remove( DistributionList * ); |
151 | 154 | ||
152 | /** | 155 | /** |
153 | Return names of all distribution lists managed by this manager. | 156 | Return names of all distribution lists managed by this manager. |
154 | */ | 157 | */ |
155 | QStringList listNames(); | 158 | QStringList listNames(); |
156 | 159 | ||
157 | /** | 160 | /** |
158 | Load distribution lists form disk. | 161 | Load distribution lists form disk. |
159 | */ | 162 | */ |
160 | bool load(); | 163 | bool load(); |
161 | 164 | ||
162 | /** | 165 | /** |
163 | Save distribution lists to disk. | 166 | Save distribution lists to disk. |
164 | */ | 167 | */ |
165 | bool save(); | 168 | bool save(); |
166 | 169 | ||
167 | private: | 170 | private: |
168 | AddressBook *mAddressBook; | 171 | AddressBook *mAddressBook; |
169 | 172 | ||
170 | QPtrList<DistributionList> mLists; | 173 | Q3PtrList<DistributionList> mLists; |
171 | }; | 174 | }; |
172 | 175 | ||
173 | /** | 176 | /** |
174 | @short Watchdog for distribution lists | 177 | @short Watchdog for distribution lists |
175 | 178 | ||
176 | This class provides a @ref changed() signal that i emitted when the | 179 | This class provides a @ref changed() signal that i emitted when the |
177 | distribution lists has changed in some way. | 180 | distribution lists has changed in some way. |
178 | 181 | ||
179 | Exapmle: | 182 | Exapmle: |
180 | 183 | ||
181 | <pre> | 184 | <pre> |
182 | KABC::DistributionListWatcher *watchdog = KABC::DistributionListWatcher::self() | 185 | KABC::DistributionListWatcher *watchdog = KABC::DistributionListWatcher::self() |
183 | 186 | ||
184 | connect( watchdog, SIGNAL( changed() ), SLOT( doSomething() ) ); | 187 | connect( watchdog, SIGNAL( changed() ), SLOT( doSomething() ) ); |
185 | </pre> | 188 | </pre> |
186 | */ | 189 | */ |
187 | 190 | ||
188 | /* | 191 | /* |
189 | class DistributionListWatcher : public QObject | 192 | class DistributionListWatcher : public QObject |
190 | { | 193 | { |
191 | Q_OBJECT_XX | 194 | Q_OBJECT_XX |
192 | 195 | ||
193 | public: | 196 | public: |
194 | 197 | ||
195 | static DistributionListWatcher *self(); | 198 | static DistributionListWatcher *self(); |
196 | 199 | ||
197 | 200 | ||
198 | signals: | 201 | signals: |
199 | 202 | ||
200 | void changed(); | 203 | void changed(); |
201 | 204 | ||
202 | protected: | 205 | protected: |