• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.14.10 API Reference
  • KDE Home
  • Contact Us
 

kabc

  • kabc
address.h
1/*
2 This file is part of libkabc.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 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 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19*/
20
21#ifndef KABC_ADDRESS_H
22#define KABC_ADDRESS_H
23
24#include <QtCore/QSharedDataPointer>
25#include <QtCore/QString>
26
27#include "kabc_export.h"
28
29namespace KABC {
30
37class KABC_EXPORT Address
38{
39 friend KABC_EXPORT QDataStream &operator<<( QDataStream &s, const Address &addr );
40 friend KABC_EXPORT QDataStream &operator>>( QDataStream &s, Address &addr );
41
42 public:
46 typedef QList<Address> List;
47
51 enum TypeFlag {
52 Dom = 1,
53 Intl = 2,
54 Postal = 4,
55 Parcel = 8,
56 Home = 16,
57 Work = 32,
58 Pref = 64
59 };
60
61 Q_DECLARE_FLAGS( Type, TypeFlag )
62
63
66 typedef QList<TypeFlag> TypeList;
67
71 Address();
72
76 Address( Type type );
77
81 Address( const Address &address );
82
86 ~Address();
87
94 bool operator==( const Address &addr ) const;
95
102 bool operator!=( const Address &addr ) const;
103
110 Address &operator=( const Address &addr );
111
115 bool isEmpty() const;
116
120 void clear();
121
125 void setId( const QString &identifier );
126
130 QString id() const;
131
137 void setType( Type type );
138
142 Type type() const;
143
147 QString typeLabel() const;
148
152 void setPostOfficeBox( const QString &postOfficeBox );
153
157 QString postOfficeBox() const;
158
162 static QString postOfficeBoxLabel();
163
167 void setExtended( const QString &extended );
168
172 QString extended() const;
173
177 static QString extendedLabel();
178
182 void setStreet( const QString &street );
183
187 QString street() const;
188
192 static QString streetLabel();
193
199 void setLocality( const QString &locality );
200
204 QString locality() const;
205
209 static QString localityLabel();
210
216 void setRegion( const QString &region );
217
221 QString region() const;
222
226 static QString regionLabel();
227
231 void setPostalCode( const QString &code );
232
236 QString postalCode() const;
237
241 static QString postalCodeLabel();
242
246 void setCountry( const QString &country );
247
251 QString country() const;
252
256 static QString countryLabel();
257
263 void setLabel( const QString &label );
264
268 QString label() const;
269
273 static QString labelLabel();
274
278 static TypeList typeList();
279
283 static QString typeLabel( Type type );
284
288 QString toString() const;
289
301 QString formattedAddress( const QString &realName = QString(),
302 const QString &orgaName = QString() ) const;
303
311 static QString countryToISO( const QString &cname );
312
319 static QString ISOtoCountry( const QString &ISOname );
320
321 private:
322 class Private;
323 QSharedDataPointer<Private> d;
324};
325
326Q_DECLARE_OPERATORS_FOR_FLAGS( Address::Type )
327
331KABC_EXPORT QDataStream &operator<<( QDataStream &stream, const Address &address );
332
336KABC_EXPORT QDataStream &operator>>( QDataStream &stream, Address &address );
337
338}
339
340#endif
KABC::Address::labelLabel
static QString labelLabel()
Returns the translated label for delivery label field.
Definition address.cpp:479
KABC::Address::typeList
static TypeList typeList()
Returns the list of available types.
Definition address.cpp:484
KABC::Address::street
QString street() const
Returns the street.
Definition address.cpp:394
KABC::Address::operator>>
friend QDataStream & operator>>(QDataStream &s, Address &addr)
Initializes the address object from the stream.
KABC::Address::streetLabel
static QString streetLabel()
Returns the translated label for street field.
Definition address.cpp:399
KABC::Address::postOfficeBox
QString postOfficeBox() const
Returns the post office box.
Definition address.cpp:362
KABC::Address::isEmpty
bool isEmpty() const
Returns true, if the address is empty.
Definition address.cpp:301
KABC::Address::label
QString label() const
Returns the delivery label.
Definition address.cpp:474
KABC::Address::TypeList
QList< TypeFlag > TypeList
List of address types.
Definition address.h:66
KABC::Address::ISOtoCountry
static QString ISOtoCountry(const QString &ISOname)
Returns a localized country name for a ISO code.
Definition address.cpp:651
KABC::Address::countryLabel
static QString countryLabel()
Returns the translated label for country field.
Definition address.cpp:463
KABC::Address::extended
QString extended() const
Returns the extended address information.
Definition address.cpp:378
KABC::Address::country
QString country() const
Returns the country.
Definition address.cpp:458
KABC::Address::setType
void setType(Type type)
Sets the type of address.
Definition address.cpp:322
KABC::Address::setStreet
void setStreet(const QString &street)
Sets the street (including house number).
Definition address.cpp:388
KABC::Address::type
Type type() const
Returns the type of address.
Definition address.cpp:328
KABC::Address::TypeFlag
TypeFlag
Address types:
Definition address.h:51
KABC::Address::Pref
@ Pref
preferred address
Definition address.h:58
KABC::Address::Parcel
@ Parcel
parcel
Definition address.h:55
KABC::Address::Work
@ Work
address at work
Definition address.h:57
KABC::Address::Dom
@ Dom
domestic
Definition address.h:52
KABC::Address::Home
@ Home
home address
Definition address.h:56
KABC::Address::Intl
@ Intl
international
Definition address.h:53
KABC::Address::Postal
@ Postal
postal
Definition address.h:54
KABC::Address::Address
Address()
Creates an empty address.
Definition address.cpp:231
KABC::Address::setCountry
void setCountry(const QString &country)
Sets the country.
Definition address.cpp:452
KABC::Address::region
QString region() const
Returns the region.
Definition address.cpp:426
KABC::Address::regionLabel
static QString regionLabel()
Returns the translated label for region field.
Definition address.cpp:431
KABC::Address::setPostOfficeBox
void setPostOfficeBox(const QString &postOfficeBox)
Sets the post office box.
Definition address.cpp:356
KABC::Address::setRegion
void setRegion(const QString &region)
Sets the region, e.g.
Definition address.cpp:420
KABC::Address::operator<<
friend QDataStream & operator<<(QDataStream &s, const Address &addr)
Serializes the address object into the stream.
KABC::Address::toString
QString toString() const
Returns a string representation of the address.
Definition address.cpp:529
KABC::Address::setId
void setId(const QString &identifier)
Sets the unique identifier.
Definition address.cpp:311
KABC::Address::clear
void clear()
Clears all entries of the address.
Definition address.cpp:306
KABC::Address::locality
QString locality() const
Returns the locality.
Definition address.cpp:410
KABC::Address::setExtended
void setExtended(const QString &extended)
Sets the extended address information.
Definition address.cpp:372
KABC::Address::typeLabel
QString typeLabel() const
Returns a translated string of all types the address has.
Definition address.cpp:333
KABC::Address::postalCodeLabel
static QString postalCodeLabel()
Returns the translated label for postal code field.
Definition address.cpp:447
KABC::Address::postalCode
QString postalCode() const
Returns the postal code.
Definition address.cpp:442
KABC::Address::List
QList< Address > List
List of addresses.
Definition address.h:46
KABC::Address::postOfficeBoxLabel
static QString postOfficeBoxLabel()
Returns the translated label for post office box field.
Definition address.cpp:367
KABC::Address::formattedAddress
QString formattedAddress(const QString &realName=QString(), const QString &orgaName=QString()) const
Returns this address formatted according to the country-specific address formatting rules.
Definition address.cpp:551
KABC::Address::countryToISO
static QString countryToISO(const QString &cname)
Returns ISO code for a localized country name.
Definition address.cpp:613
KABC::Address::extendedLabel
static QString extendedLabel()
Returns the translated label for extended field.
Definition address.cpp:383
KABC::Address::setPostalCode
void setPostalCode(const QString &code)
Sets the postal code.
Definition address.cpp:436
KABC::Address::localityLabel
static QString localityLabel()
Returns the translated label for locality field.
Definition address.cpp:415
KABC::Address::setLocality
void setLocality(const QString &locality)
Sets the locality, e.g.
Definition address.cpp:404
KABC::Address::setLabel
void setLabel(const QString &label)
Sets the delivery label.
Definition address.cpp:468
KABC
Class that holds a Calendar Url (FBURL/CALADRURI/CALURI)
Definition address.h:29
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 17 2025 00:00:00 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kabc

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

kdepimlibs-4.14.10 API Reference

Skip menu "kdepimlibs-4.14.10 API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal