• Skip to content
  • Skip to link menu
KDE 4.0 API Reference
  • KDE API Reference
  • KDE-PIM Libraries
  • Sitemap
  • Contact Us
 

kabc

KABC::Address

KABC::Address Class Reference

#include <address.h>

List of all members.


Detailed Description

Postal address information.

This class represents information about a postal address.

Definition at line 37 of file address.h.


Public Types

enum  TypeFlag {
  Dom = 1, Intl = 2, Postal = 4, Parcel = 8,
  Home = 16, Work = 32, Pref = 64
}
typedef QList< Address > List
typedef QList< TypeFlag > TypeList

Public Member Functions

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

Static Public Member Functions

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

Friends

QDataStream & operator<< (QDataStream &s, const Address &addr)
QDataStream & operator>> (QDataStream &s, Address &addr)

Member Typedef Documentation

typedef QList<Address> KABC::Address::List

List of addresses.

Definition at line 46 of file address.h.

typedef QList<TypeFlag> KABC::Address::TypeList

List of address types.

Definition at line 66 of file address.h.


Member Enumeration Documentation

enum KABC::Address::TypeFlag

Address types:.

Enumerator:
Dom  domestic
Intl  international
Postal  postal
Parcel  parcel
Home  home address
Work  address at work
Pref  preferred address

Definition at line 51 of file address.h.


Constructor & Destructor Documentation

Address::Address (  ) 

Creates an empty address.

Definition at line 229 of file address.cpp.

Address::Address ( Type  type  ) 

Creates an address of the given type.

Definition at line 234 of file address.cpp.

Address::Address ( const Address &  address  ) 

Copy constructor.

Definition at line 240 of file address.cpp.

Address::~Address (  ) 

Destroys the address.

Definition at line 245 of file address.cpp.


Member Function Documentation

bool Address::operator== ( const Address &  addr  )  const

Equality operator.

Parameters:
addr the address to compare to
Returns:
true if this and addr are equal, otherwise false

Definition at line 258 of file address.cpp.

bool Address::operator!= ( const Address &  addr  )  const

Not-equal operator.

Parameters:
addr the address to compare to
Returns:
true if this and addr are not equal, otherwise false

Definition at line 294 of file address.cpp.

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

Assignment operator.

Parameters:
addr the address data to assign to this
Returns:
a reference to this

Definition at line 249 of file address.cpp.

bool Address::isEmpty (  )  const

Returns true, if the address is empty.

Definition at line 299 of file address.cpp.

void Address::clear (  ) 

Clears all entries of the address.

Definition at line 304 of file address.cpp.

void Address::setId ( const QString &  identifier  ) 

Sets the unique .

Definition at line 309 of file address.cpp.

QString Address::id (  )  const

Returns the unique identifier.

Definition at line 315 of file address.cpp.

void Address::setType ( Type  type  ) 

Sets the type of address.

See enum for definiton of types.

Parameters:
type type, can be a bitwise or of multiple types.

Definition at line 320 of file address.cpp.

Address::Type Address::type (  )  const

Returns the type of address.

Can be a bitwise or of multiple types.

Definition at line 326 of file address.cpp.

QString Address::typeLabel (  )  const

Returns a translated string of all types the address has.

Definition at line 331 of file address.cpp.

void Address::setPostOfficeBox ( const QString &  postOfficeBox  ) 

Sets the post office box.

Definition at line 351 of file address.cpp.

QString Address::postOfficeBox (  )  const

Returns the post office box.

Definition at line 357 of file address.cpp.

QString Address::postOfficeBoxLabel (  )  [static]

Returns the translated label for post office box field.

Definition at line 362 of file address.cpp.

void Address::setExtended ( const QString &  extended  ) 

Sets the extended address information.

Definition at line 367 of file address.cpp.

QString Address::extended (  )  const

Returns the extended address information.

Definition at line 373 of file address.cpp.

QString Address::extendedLabel (  )  [static]

Returns the translated label for extended field.

Definition at line 378 of file address.cpp.

void Address::setStreet ( const QString &  street  ) 

Sets the street (including house number).

Definition at line 383 of file address.cpp.

QString Address::street (  )  const

Returns the street.

Definition at line 389 of file address.cpp.

QString Address::streetLabel (  )  [static]

Returns the translated label for street field.

Definition at line 394 of file address.cpp.

void Address::setLocality ( const QString &  locality  ) 

Sets the locality, e.g.

city.

Parameters:
locality the locality of the address, e.g. city

Definition at line 399 of file address.cpp.

QString Address::locality (  )  const

Returns the locality.

Definition at line 405 of file address.cpp.

QString Address::localityLabel (  )  [static]

Returns the translated label for locality field.

Definition at line 410 of file address.cpp.

void Address::setRegion ( const QString &  region  ) 

Sets the region, e.g.

state.

Parameters:
region the region the address falls into, e.g. state

Definition at line 415 of file address.cpp.

QString Address::region (  )  const

Returns the region.

Definition at line 421 of file address.cpp.

QString Address::regionLabel (  )  [static]

Returns the translated label for region field.

Definition at line 426 of file address.cpp.

void Address::setPostalCode ( const QString &  code  ) 

Sets the postal code.

Definition at line 431 of file address.cpp.

QString Address::postalCode (  )  const

Returns the postal code.

Definition at line 437 of file address.cpp.

QString Address::postalCodeLabel (  )  [static]

Returns the translated label for postal code field.

Definition at line 442 of file address.cpp.

void Address::setCountry ( const QString &  country  ) 

Sets the country.

Definition at line 447 of file address.cpp.

QString Address::country (  )  const

Returns the country.

Definition at line 453 of file address.cpp.

QString Address::countryLabel (  )  [static]

Returns the translated label for country field.

Definition at line 458 of file address.cpp.

void Address::setLabel ( const QString &  label  ) 

Sets the delivery label.

This is the literal text to be used as label.

Parameters:
label the string to use for delivery labels

Definition at line 463 of file address.cpp.

QString Address::label (  )  const

Returns the delivery label.

Definition at line 469 of file address.cpp.

QString Address::labelLabel (  )  [static]

Returns the translated label for delivery label field.

Definition at line 474 of file address.cpp.

Address::TypeList Address::typeList (  )  [static]

Returns the list of available types.

Definition at line 479 of file address.cpp.

QString Address::typeLabel ( Type  type  )  [static]

Returns the translated label for the given type.

Definition at line 490 of file address.cpp.

QString Address::toString (  )  const

Returns a string representation of the address.

Definition at line 524 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.

Parameters:
realName the formatted name of the contact
orgaName the name of the organization or company
Returns:
the formatted address (containing newline characters)

Definition at line 545 of file address.cpp.

QString Address::countryToISO ( const QString &  cname  )  [static]

Returns ISO code for a localized country name.

Only localized country names will be understood. This might be replaced by a KLocale method in the future.

Parameters:
cname name of the country
Returns:
two digit ISO code

Definition at line 607 of file address.cpp.

QString Address::ISOtoCountry ( const QString &  ISOname  )  [static]

Returns a localized country name for a ISO code.

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

Parameters:
ISOname two digit ISO code
Returns:
localized name of the country

Definition at line 645 of file address.cpp.


Friends And Related Function Documentation

QDataStream& operator<< ( QDataStream &  s,
const Address &  addr 
) [friend]

Serializes the address object into the stream.

Definition at line 674 of file address.cpp.

QDataStream& operator>> ( QDataStream &  s,
Address &  addr 
) [friend]

Initializes the address object from the stream.

Definition at line 682 of file address.cpp.


The documentation for this class was generated from the following files:
  • address.h
  • address.cpp

kabc

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

KDE-PIM Libraries

Skip menu "KDE-PIM Libraries"
  • kabc
  • kblog
  • kcal
  • kimap
  • kioslave
  •   imap4
  •   mbox
  • kldap
  • kmime
  • kpimidentities
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.5.5
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal