1 | /*
|
---|
2 | * xmpp_vcard.h - classes for handling vCards
|
---|
3 | * Copyright (C) 2003 Michail Pishchagin
|
---|
4 | *
|
---|
5 | * This library is free software; you can redistribute it and/or
|
---|
6 | * modify it under the terms of the GNU Lesser General Public
|
---|
7 | * License as published by the Free Software Foundation; either
|
---|
8 | * version 2.1 of the License, or (at your option) any later version.
|
---|
9 | *
|
---|
10 | * This library is distributed in the hope that it will be useful,
|
---|
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
13 | * Lesser General Public License for more details.
|
---|
14 | *
|
---|
15 | * You should have received a copy of the GNU Lesser General Public
|
---|
16 | * License along with this library; if not, write to the Free Software
|
---|
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
---|
18 | *
|
---|
19 | */
|
---|
20 |
|
---|
21 | #ifndef JABBER_VCARD_H
|
---|
22 | #define JABBER_VCARD_H
|
---|
23 |
|
---|
24 | #include <qstring.h>
|
---|
25 | #include <qstringlist.h>
|
---|
26 | #include <qcstring.h>
|
---|
27 |
|
---|
28 | #include <qvaluelist.h>
|
---|
29 | #include <qdom.h>
|
---|
30 |
|
---|
31 | class QDate;
|
---|
32 |
|
---|
33 | namespace XMPP
|
---|
34 | {
|
---|
35 | class VCard
|
---|
36 | {
|
---|
37 | public:
|
---|
38 | VCard();
|
---|
39 | VCard(const VCard &);
|
---|
40 | VCard & operator=(const VCard &);
|
---|
41 | ~VCard();
|
---|
42 |
|
---|
43 | QDomElement toXml(QDomDocument *) const;
|
---|
44 | bool fromXml(const QDomElement &);
|
---|
45 | bool isEmpty() const;
|
---|
46 |
|
---|
47 | const QString &version() const;
|
---|
48 | void setVersion(const QString &);
|
---|
49 |
|
---|
50 | const QString &fullName() const;
|
---|
51 | void setFullName(const QString &);
|
---|
52 |
|
---|
53 |
|
---|
54 | const QString &familyName() const;
|
---|
55 | void setFamilyName(const QString &);
|
---|
56 |
|
---|
57 | const QString &givenName() const;
|
---|
58 | void setGivenName(const QString &);
|
---|
59 |
|
---|
60 | const QString &middleName() const;
|
---|
61 | void setMiddleName(const QString &);
|
---|
62 |
|
---|
63 | const QString &prefixName() const;
|
---|
64 | void setPrefixName(const QString &);
|
---|
65 |
|
---|
66 | const QString &suffixName() const;
|
---|
67 | void setSuffixName(const QString &);
|
---|
68 |
|
---|
69 |
|
---|
70 | const QString &nickName() const;
|
---|
71 | void setNickName(const QString &);
|
---|
72 |
|
---|
73 |
|
---|
74 | const QByteArray &photo() const;
|
---|
75 | void setPhoto(const QByteArray &);
|
---|
76 |
|
---|
77 | const QString &photoURI() const;
|
---|
78 | void setPhotoURI(const QString &);
|
---|
79 |
|
---|
80 |
|
---|
81 | const QDate bday() const;
|
---|
82 | void setBday(const QDate &);
|
---|
83 |
|
---|
84 | const QString &bdayStr() const;
|
---|
85 | void setBdayStr(const QString &);
|
---|
86 |
|
---|
87 |
|
---|
88 | class Address {
|
---|
89 | public:
|
---|
90 | Address();
|
---|
91 |
|
---|
92 | bool home;
|
---|
93 | bool work;
|
---|
94 | bool postal;
|
---|
95 | bool parcel;
|
---|
96 |
|
---|
97 | bool dom;
|
---|
98 | bool intl;
|
---|
99 |
|
---|
100 | bool pref;
|
---|
101 |
|
---|
102 | QString pobox;
|
---|
103 | QString extaddr;
|
---|
104 | QString street;
|
---|
105 | QString locality;
|
---|
106 | QString region;
|
---|
107 | QString pcode;
|
---|
108 | QString country;
|
---|
109 | };
|
---|
110 | typedef QValueList<Address> AddressList;
|
---|
111 | const AddressList &addressList() const;
|
---|
112 | void setAddressList(const AddressList &);
|
---|
113 |
|
---|
114 | class Label {
|
---|
115 | public:
|
---|
116 | Label();
|
---|
117 |
|
---|
118 | bool home;
|
---|
119 | bool work;
|
---|
120 | bool postal;
|
---|
121 | bool parcel;
|
---|
122 |
|
---|
123 | bool dom;
|
---|
124 | bool intl;
|
---|
125 |
|
---|
126 | bool pref;
|
---|
127 |
|
---|
128 | QStringList lines;
|
---|
129 | };
|
---|
130 | typedef QValueList<Label> LabelList;
|
---|
131 | const LabelList &labelList() const;
|
---|
132 | void setLabelList(const LabelList &);
|
---|
133 |
|
---|
134 |
|
---|
135 | class Phone {
|
---|
136 | public:
|
---|
137 | Phone();
|
---|
138 |
|
---|
139 | bool home;
|
---|
140 | bool work;
|
---|
141 | bool voice;
|
---|
142 | bool fax;
|
---|
143 | bool pager;
|
---|
144 | bool msg;
|
---|
145 | bool cell;
|
---|
146 | bool video;
|
---|
147 | bool bbs;
|
---|
148 | bool modem;
|
---|
149 | bool isdn;
|
---|
150 | bool pcs;
|
---|
151 | bool pref;
|
---|
152 |
|
---|
153 | QString number;
|
---|
154 | };
|
---|
155 | typedef QValueList<Phone> PhoneList;
|
---|
156 | const PhoneList &phoneList() const;
|
---|
157 | void setPhoneList(const PhoneList &);
|
---|
158 |
|
---|
159 |
|
---|
160 | class Email {
|
---|
161 | public:
|
---|
162 | Email();
|
---|
163 |
|
---|
164 | bool home;
|
---|
165 | bool work;
|
---|
166 | bool internet;
|
---|
167 | bool x400;
|
---|
168 |
|
---|
169 | QString userid;
|
---|
170 | };
|
---|
171 | typedef QValueList<Email> EmailList;
|
---|
172 | const EmailList &emailList() const;
|
---|
173 | void setEmailList(const EmailList &);
|
---|
174 |
|
---|
175 |
|
---|
176 | const QString &jid() const;
|
---|
177 | void setJid(const QString &);
|
---|
178 |
|
---|
179 | const QString &mailer() const;
|
---|
180 | void setMailer(const QString &);
|
---|
181 |
|
---|
182 | const QString &timezone() const;
|
---|
183 | void setTimezone(const QString &);
|
---|
184 |
|
---|
185 |
|
---|
186 | class Geo {
|
---|
187 | public:
|
---|
188 | Geo();
|
---|
189 |
|
---|
190 | QString lat;
|
---|
191 | QString lon;
|
---|
192 | };
|
---|
193 | const Geo &geo() const;
|
---|
194 | void setGeo(const Geo &);
|
---|
195 |
|
---|
196 |
|
---|
197 | const QString &title() const;
|
---|
198 | void setTitle(const QString &);
|
---|
199 |
|
---|
200 | const QString &role() const;
|
---|
201 | void setRole(const QString &);
|
---|
202 |
|
---|
203 |
|
---|
204 | const QByteArray &logo() const;
|
---|
205 | void setLogo(const QByteArray &);
|
---|
206 |
|
---|
207 | const QString &logoURI() const;
|
---|
208 | void setLogoURI(const QString &);
|
---|
209 |
|
---|
210 |
|
---|
211 | const VCard *agent() const;
|
---|
212 | void setAgent(const VCard &);
|
---|
213 |
|
---|
214 | const QString agentURI() const;
|
---|
215 | void setAgentURI(const QString &);
|
---|
216 |
|
---|
217 |
|
---|
218 | class Org {
|
---|
219 | public:
|
---|
220 | Org();
|
---|
221 |
|
---|
222 | QString name;
|
---|
223 | QStringList unit;
|
---|
224 | };
|
---|
225 | const Org &org() const;
|
---|
226 | void setOrg(const Org &);
|
---|
227 |
|
---|
228 |
|
---|
229 | const QStringList &categories() const;
|
---|
230 | void setCategories(const QStringList &);
|
---|
231 |
|
---|
232 | const QString ¬e() const;
|
---|
233 | void setNote(const QString &);
|
---|
234 |
|
---|
235 | const QString &prodId() const; // it must equal to "Psi" ;-)
|
---|
236 | void setProdId(const QString &);
|
---|
237 |
|
---|
238 | const QString &rev() const;
|
---|
239 | void setRev(const QString &);
|
---|
240 |
|
---|
241 | const QString &sortString() const;
|
---|
242 | void setSortString(const QString &);
|
---|
243 |
|
---|
244 |
|
---|
245 | const QByteArray &sound() const;
|
---|
246 | void setSound(const QByteArray &);
|
---|
247 |
|
---|
248 | const QString &soundURI() const;
|
---|
249 | void setSoundURI(const QString &);
|
---|
250 |
|
---|
251 | const QString &soundPhonetic() const;
|
---|
252 | void setSoundPhonetic(const QString &);
|
---|
253 |
|
---|
254 |
|
---|
255 | const QString &uid() const;
|
---|
256 | void setUid(const QString &);
|
---|
257 |
|
---|
258 | const QString &url() const;
|
---|
259 | void setUrl(const QString &);
|
---|
260 |
|
---|
261 | const QString &desc() const;
|
---|
262 | void setDesc(const QString &);
|
---|
263 |
|
---|
264 |
|
---|
265 | enum PrivacyClass {
|
---|
266 | pcNone = 0,
|
---|
267 | pcPublic = 1,
|
---|
268 | pcPrivate,
|
---|
269 | pcConfidential
|
---|
270 | };
|
---|
271 | const PrivacyClass &privacyClass() const;
|
---|
272 | void setPrivacyClass(const PrivacyClass &);
|
---|
273 |
|
---|
274 |
|
---|
275 | const QByteArray &key() const;
|
---|
276 | void setKey(const QByteArray &);
|
---|
277 |
|
---|
278 | private:
|
---|
279 | class Private;
|
---|
280 | Private *d;
|
---|
281 | };
|
---|
282 | }
|
---|
283 |
|
---|
284 | #endif
|
---|