Slightly improve bytestreams management
[iris.git] / src / xmpp / xmpp-im / xmpp_vcard.h
blob8a569c18503319bf6fc279e07cd49668a3a037c1
1 /*
2 * xmpp_vcard.h - classes for handling vCards
3 * Copyright (C) 2003 Michail Pishchagin
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.
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.
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
21 #ifndef JABBER_VCARD_H
22 #define JABBER_VCARD_H
24 #include <qstring.h>
25 #include <qstringlist.h>
27 #include <QList>
28 #include <qdom.h>
30 class QDate;
32 namespace XMPP
34 class VCard
36 public:
37 VCard();
38 VCard(const VCard &);
39 VCard & operator=(const VCard &);
40 ~VCard();
42 QDomElement toXml(QDomDocument *) const;
43 bool fromXml(const QDomElement &);
44 bool isEmpty() const;
46 const QString &version() const;
47 void setVersion(const QString &);
49 const QString &fullName() const;
50 void setFullName(const QString &);
53 const QString &familyName() const;
54 void setFamilyName(const QString &);
56 const QString &givenName() const;
57 void setGivenName(const QString &);
59 const QString &middleName() const;
60 void setMiddleName(const QString &);
62 const QString &prefixName() const;
63 void setPrefixName(const QString &);
65 const QString &suffixName() const;
66 void setSuffixName(const QString &);
69 const QString &nickName() const;
70 void setNickName(const QString &);
73 const QByteArray &photo() const;
74 void setPhoto(const QByteArray &);
76 const QString &photoURI() const;
77 void setPhotoURI(const QString &);
80 const QDate bday() const;
81 void setBday(const QDate &);
83 const QString &bdayStr() const;
84 void setBdayStr(const QString &);
87 class Address {
88 public:
89 Address();
91 bool home;
92 bool work;
93 bool postal;
94 bool parcel;
96 bool dom;
97 bool intl;
99 bool pref;
101 QString pobox;
102 QString extaddr;
103 QString street;
104 QString locality;
105 QString region;
106 QString pcode;
107 QString country;
109 typedef QList<Address> AddressList;
110 const AddressList &addressList() const;
111 void setAddressList(const AddressList &);
113 class Label {
114 public:
115 Label();
117 bool home;
118 bool work;
119 bool postal;
120 bool parcel;
122 bool dom;
123 bool intl;
125 bool pref;
127 QStringList lines;
129 typedef QList<Label> LabelList;
130 const LabelList &labelList() const;
131 void setLabelList(const LabelList &);
134 class Phone {
135 public:
136 Phone();
138 bool home;
139 bool work;
140 bool voice;
141 bool fax;
142 bool pager;
143 bool msg;
144 bool cell;
145 bool video;
146 bool bbs;
147 bool modem;
148 bool isdn;
149 bool pcs;
150 bool pref;
152 QString number;
154 typedef QList<Phone> PhoneList;
155 const PhoneList &phoneList() const;
156 void setPhoneList(const PhoneList &);
159 class Email {
160 public:
161 Email();
163 bool home;
164 bool work;
165 bool internet;
166 bool x400;
168 QString userid;
170 typedef QList<Email> EmailList;
171 const EmailList &emailList() const;
172 void setEmailList(const EmailList &);
175 const QString &jid() const;
176 void setJid(const QString &);
178 const QString &mailer() const;
179 void setMailer(const QString &);
181 const QString &timezone() const;
182 void setTimezone(const QString &);
185 class Geo {
186 public:
187 Geo();
189 QString lat;
190 QString lon;
192 const Geo &geo() const;
193 void setGeo(const Geo &);
196 const QString &title() const;
197 void setTitle(const QString &);
199 const QString &role() const;
200 void setRole(const QString &);
203 const QByteArray &logo() const;
204 void setLogo(const QByteArray &);
206 const QString &logoURI() const;
207 void setLogoURI(const QString &);
210 const VCard *agent() const;
211 void setAgent(const VCard &);
213 const QString agentURI() const;
214 void setAgentURI(const QString &);
217 class Org {
218 public:
219 Org();
221 QString name;
222 QStringList unit;
224 const Org &org() const;
225 void setOrg(const Org &);
228 const QStringList &categories() const;
229 void setCategories(const QStringList &);
231 const QString &note() const;
232 void setNote(const QString &);
234 const QString &prodId() const; // it must equal to "Psi" ;-)
235 void setProdId(const QString &);
237 const QString &rev() const;
238 void setRev(const QString &);
240 const QString &sortString() const;
241 void setSortString(const QString &);
244 const QByteArray &sound() const;
245 void setSound(const QByteArray &);
247 const QString &soundURI() const;
248 void setSoundURI(const QString &);
250 const QString &soundPhonetic() const;
251 void setSoundPhonetic(const QString &);
254 const QString &uid() const;
255 void setUid(const QString &);
257 const QString &url() const;
258 void setUrl(const QString &);
260 const QString &desc() const;
261 void setDesc(const QString &);
264 enum PrivacyClass {
265 pcNone = 0,
266 pcPublic = 1,
267 pcPrivate,
268 pcConfidential
270 const PrivacyClass &privacyClass() const;
271 void setPrivacyClass(const PrivacyClass &);
274 const QByteArray &key() const;
275 void setKey(const QByteArray &);
277 private:
278 class Private;
279 Private *d;
283 QString image2type(const QByteArray &ba);
285 #endif