Search for usage in LXR

#include <address.h>

Public Types

typedef QVector< AddressList
typedef QFlags< TypeFlagType
enum  TypeFlag {
  Dom = 1, Intl = 2, Postal = 4, Parcel = 8,
  Home = 16, Work = 32, Pref = 64
typedef QList< TypeFlagTypeList


QString country
QString extended
QString formattedAddress
KContacts::Geo geo
QString id
bool isEmpty
QString label
QString locality
QString postalCode
QString postOfficeBox
QString region
QString street
Type type
QString typeLabel

Public Member Functions

 Address ()
 Address (Type type)
 Address (const Address &address)
 ~Address ()
void clear ()
QString country () const
QString extended () const
QString formattedAddress (const QString &realName=QString(), const QString &orgaName=QString()) const
Geo geo () const
QString id () const
bool isEmpty () const
QString label () const
QString locality () const
bool operator!= (const Address &other) const
Addressoperator= (const Address &other)
bool operator== (const Address &other) const
QString postalCode () const
QString postOfficeBox () const
QString region () const
void setCountry (const QString &country)
void setExtended (const QString &extended)
void setGeo (const Geo &geo)
void setId (const QString &identifier)
void setLabel (const QString &label)
void setLocality (const QString &locality)
void setPostalCode (const QString &code)
void setPostOfficeBox (const QString &postOfficeBox)
void setRegion (const QString &region)
void setStreet (const QString &street)
void setType (Type type)
QString street () const
QString toString () const
Type type () const
QString typeLabel () const

Static Public Member Functions

static QString countryLabel ()
static QString countryToISO (const QString &cname)
static QString extendedLabel ()
static QString ISOtoCountry (const QString &ISOname)
static QString labelLabel ()
static QString localityLabel ()
static QString postalCodeLabel ()
static QString postOfficeBoxLabel ()
static QString regionLabel ()
static QString streetLabel ()
static QString typeFlagLabel (TypeFlag type)
static QString typeLabel (Type type)
static TypeList typeList ()


KCONTACTS_EXPORT QDataStreamoperator<< (QDataStream &s, const Address &addr)
KCONTACTS_EXPORT QDataStreamoperator>> (QDataStream &s, Address &addr)

Detailed Description

Postal address information.

This class represents information about a postal address.

Definition at line 28 of file address.h.

Member Typedef Documentation

List of addresses.

Definition at line 59 of file address.h.

Stores a combination of TypeFlag values.

Definition at line 78 of file address.h.

List of address types.

Definition at line 84 of file address.h.

Member Enumeration Documentation

Address types:

See also









home address


address at work


preferred address

Definition at line 65 of file address.h.

Property Documentation

QString KContacts::Address::formattedAddress

Country-specific formatted address without an addressee.

This is the same as calling formattedAddress() with empty arguments.

See also

Definition at line 53 of file address.h.

Constructor & Destructor Documentation

Address::Address ( )

Creates an empty address.

Definition at line 220 of file address.cpp.

Address::Address ( Type  type)

Creates an address of the given type.

Definition at line 225 of file address.cpp.

Address::Address ( const Address address)

Copy constructor.

Definition at line 231 of file address.cpp.

Address::~Address ( )

Destroys the address.

Definition at line 236 of file address.cpp.

Member Function Documentation

void Address::clear ( )

Clears all entries of the address.

Definition at line 299 of file address.cpp.

QString KContacts::Address::country ( ) const

Returns the country.

QString Address::countryLabel ( )

Returns the translated label for country field.

Definition at line 471 of file address.cpp.

QString Address::countryToISO ( const QString cname)

Returns ISO code for a localized country name.

Only localized country names will be understood.

cnamename of the country
two digit ISO code, empty string if the country was not recognized

Definition at line 632 of file address.cpp.

QString KContacts::Address::extended ( ) const

Returns the extended address information.

QString Address::extendedLabel ( )

Returns the translated label for extended field.

Definition at line 391 of file address.cpp.

QString Address::formattedAddress ( const QString realName = QString(),
const QString orgaName = QString() 
) const

Returns this address formatted according to the country-specific address formatting rules.

The formatting rules applied depend on either the addresses country field, or (if the latter is empty) on the system country setting. If companyName is provided, an available business address format will be preferred.

realNamethe formatted name of the contact
orgaNamethe name of the organization or company
the formatted address (containing newline characters)

Definition at line 571 of file address.cpp.

Geo KContacts::Address::geo ( ) const

Return geographic position.

QString KContacts::Address::id ( ) const

Returns the unique identifier.

bool KContacts::Address::isEmpty ( ) const

Returns true, if the address is empty.

QString Address::ISOtoCountry ( const QString ISOname)

Returns a localized country name for a ISO code.

This might be replaced by a KLocale method in the future.

ISOnametwo digit ISO code
localized name of the country

Definition at line 637 of file address.cpp.

QString KContacts::Address::label ( ) const

Returns the delivery label.

QString Address::labelLabel ( )

Returns the translated label for delivery label field.

Definition at line 487 of file address.cpp.

QString KContacts::Address::locality ( ) const

Returns the locality.

QString Address::localityLabel ( )

Returns the translated label for locality field.

Definition at line 423 of file address.cpp.

bool Address::operator!= ( const Address other) const

Not-equal operator.

addrthe address to compare to
true if this and addr are not equal, otherwise false

Definition at line 289 of file address.cpp.

Address & Address::operator= ( const Address other)

Assignment operator.

addrthe address data to assign to this
a reference to this

Definition at line 240 of file address.cpp.

bool Address::operator== ( const Address other) const

Equality operator.

addrthe address to compare to
true if this and addr are equal, otherwise false

Definition at line 249 of file address.cpp.

QString KContacts::Address::postalCode ( ) const

Returns the postal code.

QString Address::postalCodeLabel ( )

Returns the translated label for postal code field.

Definition at line 455 of file address.cpp.

QString KContacts::Address::postOfficeBox ( ) const

Returns the post office box.

QString Address::postOfficeBoxLabel ( )

Returns the translated label for post office box field.

Definition at line 375 of file address.cpp.

QString KContacts::Address::region ( ) const

Returns the region.

QString Address::regionLabel ( )

Returns the translated label for region field.

Definition at line 439 of file address.cpp.

void Address::setCountry ( const QString country)

Sets the country.

Definition at line 460 of file address.cpp.

void Address::setExtended ( const QString extended)

Sets the extended address information.

Definition at line 380 of file address.cpp.

void Address::setGeo ( const Geo geo)

Set geographic position.

Definition at line 524 of file address.cpp.

void Address::setId ( const QString identifier)

Sets the unique identifier.

Definition at line 304 of file address.cpp.

void Address::setLabel ( const QString label)

Sets the delivery label.

This is the literal text to be used as label.

labelthe string to use for delivery labels

Definition at line 476 of file address.cpp.

void Address::setLocality ( const QString locality)

Sets the locality, e.g.


localitythe locality of the address, e.g. city

Definition at line 412 of file address.cpp.

void Address::setPostalCode ( const QString code)

Sets the postal code.

Definition at line 444 of file address.cpp.

void Address::setPostOfficeBox ( const QString postOfficeBox)

Sets the post office box.

Definition at line 364 of file address.cpp.

void Address::setRegion ( const QString region)

Sets the region, e.g.


regionthe region the address falls into, e.g. state

Definition at line 428 of file address.cpp.

void Address::setStreet ( const QString street)

Sets the street (including house number).

Definition at line 396 of file address.cpp.

void Address::setType ( Type  type)

Sets the type of address.

See enum for definition of types.

typetype, can be a bitwise or of multiple types.

Definition at line 315 of file address.cpp.

QString KContacts::Address::street ( ) const

Returns the street.

QString Address::streetLabel ( )

Returns the translated label for street field.

Definition at line 407 of file address.cpp.

QString Address::toString ( ) const

Returns a string representation of the address.

Definition at line 535 of file address.cpp.

Type KContacts::Address::type ( ) const

Returns the type of address.

Can be a bitwise or of multiple types.

QString KContacts::Address::typeLabel ( ) const

Returns a translated string of all types the address has.

QString Address::typeLabel ( Type  type)

Returns the translated label for the given type.

Definition at line 326 of file address.cpp.

Address::TypeList Address::typeList ( )

Returns the list of available types.

Definition at line 492 of file address.cpp.

Friends And Related Function Documentation

KCONTACTS_EXPORT QDataStream& operator<< ( QDataStream s,
const Address addr 

Serializes the address object into the stream.

KCONTACTS_EXPORT QDataStream& operator>> ( QDataStream s,
Address addr 

Initializes the address object from the stream.

The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sat Oct 23 2021 22:56:52 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.