• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeabc
 

tdeabc

  • tdeabc
vcard21parser.h
1 /*
2  This file is part of libtdeabc.
3 
4  Copyright (c) 2002 Mark Westcott <mark@houseoffish.org>
5  Copyright (c) 2000 George Staikos <staikos@kde.org>
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License as published by the Free Software Foundation; either
9  version 2 of the License, or (at your option) any later version.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Library General Public License for more details.
15 
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
18  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  Boston, MA 02110-1301, USA.
20 */
21 
22 #ifndef KABC_VCARD21FORMAT_H
23 #define KABC_VCARD21FORMAT_H
24 
25 #include <tqdatetime.h>
26 #include <kdebug.h>
27 #include <tqregexp.h>
28 #include <tqstring.h>
29 #include <kurl.h>
30 #include <tqvaluelist.h>
31 
32 #include "addressee.h"
33 #include "addressbook.h"
34 #include "phonenumber.h"
35 
36 
37 #define VCARD_BEGIN "begin:vcard"
38 #define VCARD_END "end:vcard"
39 #define VCARD_BEGIN_N "begin"
40 #define VCARD_END_N "end"
41 #define VCARD_VERSION "version"
42 
43 #define VCARD_FN "fn"
44 #define VCARD_N "n"
45 
46 // optional
47 #define VCARD_NAME "name"
48 #define VCARD_NICKNAME "nickname"
49 #define VCARD_PHOTO "photo"
50 #define VCARD_BDAY "bday"
51 #define VCARD_ADR "adr"
52 
53 // types
54 #define VCARD_ADR_DOM "dom"
55 #define VCARD_ADR_INTL "intl"
56 #define VCARD_ADR_POSTAL "postal"
57 #define VCARD_ADR_PARCEL "parcel"
58 #define VCARD_ADR_HOME "home"
59 #define VCARD_ADR_WORK "work"
60 #define VCARD_ADR_PREF "pref"
61 // values
62 #define VCARD_ADR_POBOX "PO Box"
63 #define VCARD_ADR_EXTADR "Extended Address"
64 #define VCARD_ADR_STREET "Street"
65 #define VCARD_ADR_LOCALITY "Locality"
66 #define VCARD_ADR_REGION "Region"
67 #define VCARD_ADR_POSTCODE "Postal Code"
68 #define VCARD_ADR_COUNTRY "Country Name"
69 #define VCARD_LABEL "label"
70 #define VCARD_PROFILE "profile"
71 #define VCARD_SOURCE "source"
72 #define VCARD_TEL "tel"
73 // types
74 #define VCARD_TEL_HOME "home"
75 #define VCARD_TEL_WORK "work"
76 #define VCARD_TEL_PREF "pref"
77 #define VCARD_TEL_VOICE "voice"
78 #define VCARD_TEL_FAX "fax"
79 #define VCARD_TEL_MSG "msg"
80 #define VCARD_TEL_CELL "cell"
81 #define VCARD_TEL_PAGER "pager"
82 #define VCARD_TEL_BBS "bbs"
83 #define VCARD_TEL_MODEM "modem"
84 #define VCARD_TEL_CAR "car"
85 #define VCARD_TEL_ISDN "isdn"
86 #define VCARD_TEL_VIDEO "video"
87 #define VCARD_TEL_PCS "pcs"
88 #define VCARD_EMAIL "email"
89 // types
90 #define VCARD_EMAIL_PREF "pref"
91 #define VCARD_EMAIL_INTERNET "internet"
92 #define VCARD_EMAIL_X400 "x400"
93 #define VCARD_TZ "tz"
94 #define VCARD_GEO "geo"
95 #define VCARD_MAILER "mailer"
96 #define VCARD_TITLE "title"
97 #define VCARD_ROLE "role"
98 #define VCARD_LOGO "logo"
99 #define VCARD_AGENT "agent"
100 #define VCARD_ORG "org"
101 #define VCARD_CATEGORIES "categories"
102 #define VCARD_NOTE "note"
103 #define VCARD_PRODID "prodid"
104 #define VCARD_REV "rev"
105 #define VCARD_SOUND "sound"
106 #define VCARD_UID "uid"
107 #define VCARD_URL "url"
108 #define VCARD_CLASS "class"
109 #define VCARD_CLASS_PUBLIC "public"
110 #define VCARD_CLASS_PRIVATE "private"
111 #define VCARD_CLASS_CONFIDENTIAL "confidential"
112 #define VCARD_KEY "key"
113 // types
114 #define VCARD_KEY_X509 "x509"
115 #define VCARD_KEY_PGP "pgp"
116 
117 #define VCARD_QUOTED_PRINTABLE "quoted-printable"
118 // this one is a temporary hack until we support TYPE=VALUE
119 #define VCARD_ENCODING_QUOTED_PRINTABLE "encoding=quoted-printable"
120 #define VCARD_BASE64 "base64"
121 
122 #define VC_STATE_BEGIN 1
123 #define VC_STATE_BODY 2
124 #define VC_STATE_END 4
125 #define VC_STATE_HAVE_N 8
126 #define VC_STATE_HAVE_VERSION 16
127 
128 #define VC_ERR_NO_BEGIN 1
129 #define VC_ERR_NO_END 2
130 #define VC_ERR_INVALID_LINE 3
131 #define VC_ERR_INTERNAL 4
132 #define VC_ERR_INVALID_NAME 5
133 #define VC_ERR_MISSING_MANDATORY 6
134 
135 namespace TDEABC {
136 
137 class AddressBook;
138 
142 class KABC_EXPORT_DEPRECATED VCard21Parser
143 {
144 public:
145 
149  VCard21Parser();
150 
154  virtual ~VCard21Parser();
155 
163  void readFromString( TDEABC::AddressBook *ab, const TQString &str );
164 
173  TDEABC::Addressee readFromString( const TQString &data);
174 
181  static TDEABC::Address readAddressFromQStringList (const TQStringList &data, const int type);
182 };
183 
184 }
185 
189 class KABC_EXPORT VCardLineX
190 {
191 public:
192  TQString name;
193  bool qualified;
194  TQValueList<TQString> qualifiers;
195  TQValueList<TQString> parameters;
196  bool isValid() const;
197 };
198 
202 class KABC_EXPORT VCard21ParserImpl
203 {
204  friend class VCardLineX;
205 
206 public:
207  VCard21ParserImpl();
208  virtual ~VCard21ParserImpl();
209  static VCard21ParserImpl *parseVCard(const TQString& vc, int *err = NULL);
210  TQString getValue(const TQString& name, const TQString& qualifier);
211  TQString getValue(const TQString& name);
212  TQStringList getValues(const TQString& name, const TQString& qualifier);
213  TQStringList getValues(const TQString& name);
214 
215  TQValueList<VCardLineX> *_vcdata;
216 
217 private:
218  VCard21ParserImpl (TQValueList<VCardLineX> *_vcd);
219 };
220 
221 #endif
TDEABC::VCard21Parser
Definition: vcard21parser.h:142
TDEABC::AddressBook
Address Book.
Definition: addressbook.h:43
VCard21ParserImpl
Helper class.
Definition: vcard21parser.h:202
TDEABC
static data, shared by ALL addressee objects
Definition: address.h:48
TDEABC::Address
Postal address information.
Definition: address.h:55
TDEABC::Addressee
address book entry
Definition: addressee.src.h:74
VCardLineX
Helper class.
Definition: vcard21parser.h:189

tdeabc

Skip menu "tdeabc"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdeabc

Skip menu "tdeabc"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  •     tdecore
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  • tdeioslave
  •   http
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeabc by doxygen 1.8.8
This website is maintained by Timothy Pearson.