21 #ifndef KABC_ADDRESS_H
22 #define KABC_ADDRESS_H
26 #include <tqvaluelist.h>
28 #include <tdelibs_export.h>
31 #define KABC_FMTTAG_realname TQString("%n")
32 #define KABC_FMTTAG_REALNAME TQString("%N")
33 #define KABC_FMTTAG_company TQString("%cm")
34 #define KABC_FMTTAG_COMPANY TQString("%CM")
35 #define KABC_FMTTAG_pobox TQString("%p")
36 #define KABC_FMTTAG_street TQString("%s")
37 #define KABC_FMTTAG_STREET TQString("%S")
38 #define KABC_FMTTAG_zipcode TQString("%z")
39 #define KABC_FMTTAG_location TQString("%l")
40 #define KABC_FMTTAG_LOCATION TQString("%L")
41 #define KABC_FMTTAG_region TQString("%r")
42 #define KABC_FMTTAG_REGION TQString("%R")
43 #define KABC_FMTTAG_newline TQString("\\n")
44 #define KABC_FMTTAG_condcomma TQString("%,")
45 #define KABC_FMTTAG_condwhite TQString("%w")
46 #define KABC_FMTTAG_purgeempty TQString("%0")
58 friend KABC_EXPORT TQDataStream &operator>>( TQDataStream &,
Address & );
64 typedef TQValueList<Address>
List;
65 typedef TQValueList<int> TypeList;
78 enum Type { Dom = 1, Intl = 2, Postal = 4, Parcel = 8, Home = 16, Work = 32,
93 bool operator==(
const Address & )
const;
94 bool operator!=(
const Address & )
const;
109 void setId(
const TQString & );
121 void setType(
int type );
131 TQString typeLabel()
const;
136 void setPostOfficeBox(
const TQString & );
141 TQString postOfficeBox()
const;
146 static TQString postOfficeBoxLabel();
151 void setExtended(
const TQString & );
156 TQString extended()
const;
161 static TQString extendedLabel();
166 void setStreet(
const TQString & );
171 TQString street()
const;
176 static TQString streetLabel();
181 void setLocality(
const TQString & );
186 TQString locality()
const;
191 static TQString localityLabel();
196 void setRegion(
const TQString & );
201 TQString region()
const;
206 static TQString regionLabel();
211 void setPostalCode(
const TQString & );
216 TQString postalCode()
const;
221 static TQString postalCodeLabel();
226 void setCountry(
const TQString & );
231 TQString country()
const;
236 static TQString countryLabel();
241 void setLabel(
const TQString & );
246 TQString label()
const;
251 static TQString labelLabel();
256 static TypeList typeList();
261 static TQString typeLabel(
int type );
279 TQString formattedAddress(
const TQString &realName=TQString::null
280 ,
const TQString &orgaName=TQString::null )
const;
289 static TQString countryToISO(
const TQString &cname );
298 static TQString ISOtoCountry(
const TQString &ISOname );
307 bool parseAddressTemplateSection(
const TQString &tsection
309 ,
const TQString &realName
310 ,
const TQString &orgaName )
const;
317 int findBalancedBracket(
const TQString &tsection,
int pos )
const;
324 TQString mPostOfficeBox;
329 TQString mPostalCode;
333 static TQMap<TQString, TQString> *mISOMap;
336 KABC_EXPORT TQDataStream &
operator<<( TQDataStream &,
const Address & );
337 KABC_EXPORT TQDataStream &operator>>( TQDataStream &, Address & );
Postal address information.
TQValueList< Address > List
List of addresses.
kdbgstream & operator<<(const TQValueList< T > &list)
static data, shared by ALL addressee objects