Search for usage in LXR

#include <address.h>

Public Types

typedef QList< 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
QUrl geoUri
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 (const Address &address)
 Address (Type type)
 ~Address ()
void clear ()
QString country () const
QString extended () const
Q_INVOKABLE QString formatted (KContacts::AddressFormatStyle style, const QString &realName=QString(), const QString &orgaName=QString()) const
Geo geo () const
QUrl geoUri () 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 extendedLabel ()
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 ()

Detailed Description

Postal address information.

This class represents information about a postal address.

Definition at line 30 of file address.h.

Member Typedef Documentation

◆ List

List of addresses.

Definition at line 72 of file address.h.

◆ Type

Stores a combination of TypeFlag values.

Definition at line 91 of file address.h.

◆ TypeList

List of address types.

Definition at line 97 of file address.h.

Member Enumeration Documentation

◆ TypeFlag

Address types:

See also









home address


address at work


preferred address

Definition at line 78 of file address.h.

Property Documentation

◆ country

QString KContacts::Address::country

Definition at line 46 of file address.h.

◆ extended

QString KContacts::Address::extended

Definition at line 41 of file address.h.

◆ formattedAddress

QString KContacts::Address::formattedAddress

Country-specific formatted address without an addressee using postal address style.

This is the same as calling formatted(AddressFormatStyle::Postal) with empty arguments.

See also

Definition at line 60 of file address.h.

◆ geo

KContacts::Geo KContacts::Address::geo

Definition at line 48 of file address.h.

◆ geoUri

QUrl KContacts::Address::geoUri

geo: URI for this address.

See also

Definition at line 66 of file address.h.

◆ id

QString KContacts::Address::id

Definition at line 36 of file address.h.

◆ isEmpty

bool KContacts::Address::isEmpty

Definition at line 37 of file address.h.

◆ label

QString KContacts::Address::label

Definition at line 47 of file address.h.

◆ locality

QString KContacts::Address::locality

Definition at line 43 of file address.h.

◆ postalCode

QString KContacts::Address::postalCode

Definition at line 45 of file address.h.

◆ postOfficeBox

QString KContacts::Address::postOfficeBox

Definition at line 40 of file address.h.

◆ region

QString KContacts::Address::region

Definition at line 44 of file address.h.

◆ street

QString KContacts::Address::street

Definition at line 42 of file address.h.

◆ type

Type KContacts::Address::type

Definition at line 38 of file address.h.

◆ typeLabel

QString KContacts::Address::typeLabel

Definition at line 39 of file address.h.

Constructor & Destructor Documentation

◆ Address() [1/3]

Address::Address ( )

Creates an empty address.

Definition at line 67 of file address.cpp.

◆ Address() [2/3]

Address::Address ( Type type)

Creates an address of the given type.

Definition at line 72 of file address.cpp.

◆ Address() [3/3]

Address::Address ( const Address & address)

Copy constructor.

Definition at line 78 of file address.cpp.

◆ ~Address()

Address::~Address ( )

Destroys the address.

Definition at line 83 of file address.cpp.

Member Function Documentation

◆ clear()

void Address::clear ( )

Clears all entries of the address.

Definition at line 146 of file address.cpp.

◆ country()

QString Address::country ( ) const

Returns the country.

Definition at line 313 of file address.cpp.

◆ countryLabel()

QString Address::countryLabel ( )

Returns the translated label for country field.

Definition at line 318 of file address.cpp.

◆ extended()

QString Address::extended ( ) const

Returns the extended address information.

Definition at line 233 of file address.cpp.

◆ extendedLabel()

QString Address::extendedLabel ( )

Returns the translated label for extended field.

Definition at line 238 of file address.cpp.

◆ formatted()

QString Address::formatted ( KContacts::AddressFormatStyle style,
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.

stylethe formatting style variant to use
realNamethe formatted name of the contact
orgaNamethe name of the organization or company
the formatted address

Definition at line 402 of file address.cpp.

◆ geo()

Geo Address::geo ( ) const

Return geographic position.

Definition at line 377 of file address.cpp.

◆ geoUri()

QUrl Address::geoUri ( ) const

Returns a geo: URI representing this address.

This contains either the geographic coordinate if set, or the address as query term. This can be used to show the address in the default map view.


Definition at line 414 of file address.cpp.

◆ id()

QString Address::id ( ) const

Returns the unique identifier.

Definition at line 157 of file address.cpp.

◆ isEmpty()

bool Address::isEmpty ( ) const

Returns true, if the address is empty.

Definition at line 141 of file address.cpp.

◆ label()

QString Address::label ( ) const

Returns the delivery label.

Definition at line 329 of file address.cpp.

◆ labelLabel()

QString Address::labelLabel ( )

Returns the translated label for delivery label field.

Definition at line 334 of file address.cpp.

◆ locality()

QString Address::locality ( ) const

Returns the locality.

Definition at line 265 of file address.cpp.

◆ localityLabel()

QString Address::localityLabel ( )

Returns the translated label for locality field.

Definition at line 270 of file address.cpp.

◆ operator!=()

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 136 of file address.cpp.

◆ operator=()

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

Assignment operator.

addrthe address data to assign to this
a reference to this

Definition at line 87 of file address.cpp.

◆ operator==()

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 96 of file address.cpp.

◆ postalCode()

QString Address::postalCode ( ) const

Returns the postal code.

Definition at line 297 of file address.cpp.

◆ postalCodeLabel()

QString Address::postalCodeLabel ( )

Returns the translated label for postal code field.

Definition at line 302 of file address.cpp.

◆ postOfficeBox()

QString Address::postOfficeBox ( ) const

Returns the post office box.

Definition at line 217 of file address.cpp.

◆ postOfficeBoxLabel()

QString Address::postOfficeBoxLabel ( )

Returns the translated label for post office box field.

Definition at line 222 of file address.cpp.

◆ region()

QString Address::region ( ) const

Returns the region.

Definition at line 281 of file address.cpp.

◆ regionLabel()

QString Address::regionLabel ( )

Returns the translated label for region field.

Definition at line 286 of file address.cpp.

◆ setCountry()

void Address::setCountry ( const QString & country)

Sets the country.

Definition at line 307 of file address.cpp.

◆ setExtended()

void Address::setExtended ( const QString & extended)

Sets the extended address information.

Definition at line 227 of file address.cpp.

◆ setGeo()

void Address::setGeo ( const Geo & geo)

Set geographic position.

Definition at line 371 of file address.cpp.

◆ setId()

void Address::setId ( const QString & identifier)

Sets the unique identifier.

Definition at line 151 of file address.cpp.

◆ setLabel()

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 323 of file address.cpp.

◆ setLocality()

void Address::setLocality ( const QString & locality)

Sets the locality, e.g.


localitythe locality of the address, e.g. city

Definition at line 259 of file address.cpp.

◆ setPostalCode()

void Address::setPostalCode ( const QString & code)

Sets the postal code.

Definition at line 291 of file address.cpp.

◆ setPostOfficeBox()

void Address::setPostOfficeBox ( const QString & postOfficeBox)

Sets the post office box.

Definition at line 211 of file address.cpp.

◆ setRegion()

void Address::setRegion ( const QString & region)

Sets the region, e.g.


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

Definition at line 275 of file address.cpp.

◆ setStreet()

void Address::setStreet ( const QString & street)

Sets the street (including house number).

Definition at line 243 of file address.cpp.

◆ setType()

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 162 of file address.cpp.

◆ street()

QString Address::street ( ) const

Returns the street.

Definition at line 249 of file address.cpp.

◆ streetLabel()

QString Address::streetLabel ( )

Returns the translated label for street field.

Definition at line 254 of file address.cpp.

◆ toString()

QString Address::toString ( ) const

Returns a string representation of the address.

Definition at line 382 of file address.cpp.

◆ type()

Address::Type Address::type ( ) const

Returns the type of address.

Can be a bitwise or of multiple types.

Definition at line 168 of file address.cpp.

◆ typeFlagLabel()

QString Address::typeFlagLabel ( TypeFlag type)

Definition at line 350 of file address.cpp.

◆ typeLabel() [1/2]

QString Address::typeLabel ( ) const

Returns a translated string of all types the address has.

Definition at line 194 of file address.cpp.

◆ typeLabel() [2/2]

QString Address::typeLabel ( Type type)

Returns the translated label for the given type.

Definition at line 173 of file address.cpp.

◆ typeList()

Address::TypeList Address::typeList ( )

Returns the list of available types.

Definition at line 339 of file address.cpp.

The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 17 2024 11:53:44 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.