summaryrefslogtreecommitdiffabout
path: root/kabc/vcard21parser.h
authorMichael Krelin <hacker@klever.net>2007-07-04 11:23:42 (UTC)
committer Michael Krelin <hacker@klever.net>2007-07-04 11:23:42 (UTC)
commita08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (unidiff)
tree8ee90d686081c52e7c69b5ce946e9b1a7d690001 /kabc/vcard21parser.h
parent11edc920afe4f274c0964436633aa632c8288a40 (diff)
downloadkdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.zip
kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.gz
kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.bz2
initial public commit of qt4 portp1
Diffstat (limited to 'kabc/vcard21parser.h') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/vcard21parser.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/kabc/vcard21parser.h b/kabc/vcard21parser.h
index 77e69b6..80ba6ef 100644
--- a/kabc/vcard21parser.h
+++ b/kabc/vcard21parser.h
@@ -5,65 +5,65 @@
5 Copyright (c) 2000 George Staikos <staikos@kde.org> 5 Copyright (c) 2000 George Staikos <staikos@kde.org>
6 This library is free software; you can redistribute it and/or 6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public 7 modify it under the terms of the GNU Library General Public
8 License as published by the Free Software Foundation; either 8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version. 9 version 2 of the License, or (at your option) any later version.
10 10
11 This library is distributed in the hope that it will be useful, 11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details. 14 Library General Public License for more details.
15 15
16 You should have received a copy of the GNU Library General Public License 16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to 17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. 19 Boston, MA 02111-1307, USA.
20*/ 20*/
21 21
22/* 22/*
23Enhanced Version of the file for platform independent KDE tools. 23Enhanced Version of the file for platform independent KDE tools.
24Copyright (c) 2004 Ulf Schenk 24Copyright (c) 2004 Ulf Schenk
25 25
26$Id$ 26$Id$
27*/ 27*/
28 28
29#ifndef KABC_VCARD21FORMAT_H 29#ifndef KABC_VCARD21FORMAT_H
30#define KABC_VCARD21FORMAT_H 30#define KABC_VCARD21FORMAT_H
31 31
32#include <qdatetime.h> 32#include <qdatetime.h>
33#include <kdebug.h> 33#include <kdebug.h>
34#include <qregexp.h> 34#include <qregexp.h>
35#include <qstring.h> 35#include <qstring.h>
36#include <kurl.h> 36#include <kurl.h>
37#include <qvaluelist.h> 37#include <q3valuelist.h>
38 38
39#include "addressee.h" 39#include "addressee.h"
40#include "addressbook.h" 40#include "addressbook.h"
41#include "phonenumber.h" 41#include "phonenumber.h"
42 42
43 43
44#define VCARD_BEGIN "begin:vcard" 44#define VCARD_BEGIN "begin:vcard"
45#define VCARD_END "end:vcard" 45#define VCARD_END "end:vcard"
46#define VCARD_BEGIN_N "begin" 46#define VCARD_BEGIN_N "begin"
47#define VCARD_END_N "end" 47#define VCARD_END_N "end"
48#define VCARD_VERSION "version" 48#define VCARD_VERSION "version"
49 49
50#define VCARD_FN "fn" 50#define VCARD_FN "fn"
51#define VCARD_N "n" 51#define VCARD_N "n"
52 52
53// optional 53// optional
54#define VCARD_NAME "name" 54#define VCARD_NAME "name"
55#define VCARD_NICKNAME "nickname" 55#define VCARD_NICKNAME "nickname"
56#define VCARD_PHOTO "photo" 56#define VCARD_PHOTO "photo"
57#define VCARD_BDAY "bday" 57#define VCARD_BDAY "bday"
58#define VCARD_ADR "adr" 58#define VCARD_ADR "adr"
59 59
60// types 60// types
61#define VCARD_ADR_DOM "dom" 61#define VCARD_ADR_DOM "dom"
62#define VCARD_ADR_INTL "intl" 62#define VCARD_ADR_INTL "intl"
63#define VCARD_ADR_POSTAL "postal" 63#define VCARD_ADR_POSTAL "postal"
64#define VCARD_ADR_PARCEL "parcel" 64#define VCARD_ADR_PARCEL "parcel"
65#define VCARD_ADR_HOME "home" 65#define VCARD_ADR_HOME "home"
66#define VCARD_ADR_WORK "work" 66#define VCARD_ADR_WORK "work"
67#define VCARD_ADR_PREF "pref" 67#define VCARD_ADR_PREF "pref"
68// values 68// values
69#define VCARD_ADR_POBOX "PO Box" 69#define VCARD_ADR_POBOX "PO Box"
@@ -167,60 +167,60 @@ public:
167 */ 167 */
168 void readFromString( KABC::AddressBook *ab, const QString &str ); 168 void readFromString( KABC::AddressBook *ab, const QString &str );
169 169
170 /** 170 /**
171 * FIXME: we need a writeToString method 171 * FIXME: we need a writeToString method
172 * QString writeToString (KABC::AddressBook *); 172 * QString writeToString (KABC::AddressBook *);
173 */ 173 */
174 174
175 /** 175 /**
176 * Parses a string in vcard2.1 format and returns the inherent addressee. 176 * Parses a string in vcard2.1 format and returns the inherent addressee.
177 */ 177 */
178 KABC::Addressee readFromString( const QString &data); 178 KABC::Addressee readFromString( const QString &data);
179 179
180 /** 180 /**
181 * Helper method to store a address. 181 * Helper method to store a address.
182 * 182 *
183 * @param data A string list, that is filled with 'street', 'house number' ... 183 * @param data A string list, that is filled with 'street', 'house number' ...
184 * @param type The type of the returned address. 184 * @param type The type of the returned address.
185 */ 185 */
186 static KABC::Address readAddressFromQStringList (const QStringList &data, const int type); 186 static KABC::Address readAddressFromQStringList (const QStringList &data, const int type);
187}; 187};
188 188
189} 189}
190 190
191/** 191/**
192 * @short Helper class 192 * @short Helper class
193 */ 193 */
194class VCardLineX 194class VCardLineX
195{ 195{
196public: 196public:
197 QString name; 197 QString name;
198 bool qualified; 198 bool qualified;
199 QValueList<QString> qualifiers; 199 Q3ValueList<QString> qualifiers;
200 QValueList<QString> parameters; 200 Q3ValueList<QString> parameters;
201 bool isValid() const; 201 bool isValid() const;
202}; 202};
203 203
204/** 204/**
205 * @short Helper class 205 * @short Helper class
206 */ 206 */
207class VCard21ParserImpl 207class VCard21ParserImpl
208{ 208{
209 friend class VCardLineX; 209 friend class VCardLineX;
210 210
211public: 211public:
212 VCard21ParserImpl() { }; 212 VCard21ParserImpl() { };
213 virtual ~VCard21ParserImpl() { }; 213 virtual ~VCard21ParserImpl() { };
214 static VCard21ParserImpl *parseVCard(const QString& vc, int *err = NULL); 214 static VCard21ParserImpl *parseVCard(const QString& vc, int *err = NULL);
215 QString getValue(const QString& name, const QString& qualifier); 215 QString getValue(const QString& name, const QString& qualifier);
216 QString getValue(const QString& name); 216 QString getValue(const QString& name);
217 QStringList getValues(const QString& name, const QString& qualifier); 217 QStringList getValues(const QString& name, const QString& qualifier);
218 QStringList getValues(const QString& name); 218 QStringList getValues(const QString& name);
219 219
220 QValueList<VCardLineX> *_vcdata; 220 Q3ValueList<VCardLineX> *_vcdata;
221 221
222private: 222private:
223 VCard21ParserImpl (QValueList<VCardLineX> *_vcd); 223 VCard21ParserImpl (Q3ValueList<VCardLineX> *_vcd);
224}; 224};
225 225
226#endif 226#endif