# kabc Library API Documentation

Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Source Files

# KABC::Address Class Reference

Postal address information. More...

`#include <address.h>`

Collaboration diagram for KABC::Address:

[legend]
List of all members.

## Public Types

typedef QValueList< Address > | List
| List of addresses.
typedef QValueList< int > | TypeList
enum | Type { Dom = 1, Intl = 2, Postal = 4, Parcel = 8, Home = 16, Work = 32, Pref = 64 }
| Address types:. More...

## Public Member Functions

| Address ()
| Constructor that creates an empty Address, which is initialized with a unique id (see id()).
| Address (int)
| This is like Address() just above, with the difference that you can specify the type.
bool | operator== (const Address &) const
bool | operator!= (const Address &) const
bool | isEmpty () const
| Returns true, if the address is empty.
void | clear ()
| Clears all entries of the address.
void | setId (const QString &)
| Sets the unique id.
QString | id () const
void | setType (int type)
| Sets the type of address.
int | type () const
| Returns the type of address.
QString | typeLabel () const
| Returns a translated string of all types the address has.
void | setPostOfficeBox (const QString &)
| Sets the post office box.
QString | postOfficeBox () const
| Returns the post office box.
void | setExtended (const QString &)
| Sets the extended address information.
QString | extended () const
| Returns the extended address information.
void | setStreet (const QString &)
| Sets the street (including number).
QString | street () const
| Returns the street.
void | setLocality (const QString &)
| Sets the locality, e.g.
QString | locality () const
| Returns the locality.
void | setRegion (const QString &)
| Sets the region, e.g.
QString | region () const
| Returns the region.
void | setPostalCode (const QString &)
| Sets the postal code.
QString | postalCode () const
| Returns the postal code.
void | setCountry (const QString &)
| Sets the country.
QString | country () const
| Returns the country.
void | setLabel (const QString &)
| Sets the delivery label.
QString | label () const
| Returns the delivery label.
void | dump () const
| Used for debug output.

## Static Public Member Functions

QString | postOfficeBoxLabel ()
| Returns the translated label for post office box field.
QString | extendedLabel ()
| Returns the translated label for extended field.
QString | streetLabel ()
| Returns the translated label for street field.
QString | localityLabel ()
| Returns the translated label for locality field.
QString | regionLabel ()
| Returns the translated label for region field.
QString | postalCodeLabel ()
| Returns the translated label for postal code field.
QString | countryLabel ()
| Returns the translated label for country field.
QString | labelLabel ()
| Returns the translated label for delivery label field.
TypeList | typeList ()
| Returns the list of available types.
QString | typeLabel (int type)
| Returns the translated label for a special type.

## Friends

QDataStream & | operator<< (QDataStream &, const Address &)
QDataStream & | operator>> (QDataStream &, Address &)

## Detailed Description

Postal address information.

This class represents information about a postal address.

Definition at line 34 of file address.h.

## Member Typedef Documentation

typedef QValueList<Address> KABC::Address::List

| List of addresses. Definition at line 43 of file address.h.

## Member Enumeration Documentation

enum KABC::Address::Type

Address types:.

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

Definition at line 57 of file address.h.

## Constructor & Destructor Documentation

Address::Address | ( |  | ) |

| Constructor that creates an empty Address, which is initialized with a unique id (see id()). Definition at line 29 of file address.cpp. References KApplication::randomString(). Referenced by clear().

Address::Address | ( | int |  | ) |

| This is like Address() just above, with the difference that you can specify the type. Definition at line 35 of file address.cpp. References KApplication::randomString().

## Member Function Documentation

bool Address::isEmpty | ( |  | ) | const

| Returns true, if the address is empty. Definition at line 60 of file address.cpp. References QString::isEmpty().

void Address::clear | ( |  | ) |

| Clears all entries of the address. Definition at line 75 of file address.cpp. References Address().

void Address::setId | ( | const QString & |  | ) |

| Sets the unique id. Definition at line 80 of file address.cpp.

void Address::setType | ( | int | 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 92 of file address.cpp.

int Address::type | ( |  | ) | const

| Returns the type of address. Can be a bitwise or of multiple types. Definition at line 99 of file address.cpp. Referenced by typeLabel().

QString Address::typeLabel | ( |  | ) | const

| Returns a translated string of all types the address has. Definition at line 104 of file address.cpp. References QString::append(), QValueList< int >::begin(), QValueList< int >::end(), KStdAccel::label(), label(), type(), and typeList().

void Address::setPostOfficeBox | ( | const QString & |  | ) |

| Sets the post office box. Definition at line 123 of file address.cpp.

QString Address::postOfficeBox | ( |  | ) | const

| Returns the post office box. Definition at line 130 of file address.cpp.

QString Address::postOfficeBoxLabel | ( |  | ) | `[static]`

| Returns the translated label for post office box field. Definition at line 135 of file address.cpp.

void Address::setExtended | ( | const QString & |  | ) |

| Sets the extended address information. Definition at line 141 of file address.cpp.

QString Address::extended | ( |  | ) | const

| Returns the extended address information. Definition at line 148 of file address.cpp. Referenced by dump().

QString Address::extendedLabel | ( |  | ) | `[static]`

| Returns the translated label for extended field. Definition at line 153 of file address.cpp.

void Address::setStreet | ( | const QString & |  | ) |

| Sets the street (including number). Definition at line 159 of file address.cpp.

QString Address::street | ( |  | ) | const

| Returns the street. Definition at line 166 of file address.cpp. Referenced by dump().

QString Address::streetLabel | ( |  | ) | `[static]`

| Returns the translated label for street field. Definition at line 171 of file address.cpp.

void Address::setLocality | ( | const QString & |  | ) |

| Sets the locality, e.g. city. Definition at line 177 of file address.cpp.

QString Address::locality | ( |  | ) | const

| Returns the locality. Definition at line 184 of file address.cpp. Referenced by dump().

QString Address::localityLabel | ( |  | ) | `[static]`

| Returns the translated label for locality field. Definition at line 189 of file address.cpp.

void Address::setRegion | ( | const QString & |  | ) |

| Sets the region, e.g. state. Definition at line 195 of file address.cpp.

QString Address::region | ( |  | ) | const

| Returns the region. Definition at line 202 of file address.cpp.

QString Address::regionLabel | ( |  | ) | `[static]`

| Returns the translated label for region field. Definition at line 207 of file address.cpp.

void Address::setPostalCode | ( | const QString & |  | ) |

| Sets the postal code. Definition at line 213 of file address.cpp.

QString Address::postalCode | ( |  | ) | const

| Returns the postal code. Definition at line 220 of file address.cpp. Referenced by dump().

QString Address::postalCodeLabel | ( |  | ) | `[static]`

| Returns the translated label for postal code field. Definition at line 225 of file address.cpp.

void Address::setCountry | ( | const QString & |  | ) |

| Sets the country. Definition at line 231 of file address.cpp.

QString Address::country | ( |  | ) | const

| Returns the country. Definition at line 238 of file address.cpp.

QString Address::countryLabel | ( |  | ) | `[static]`

| Returns the translated label for country field. Definition at line 243 of file address.cpp.

void Address::setLabel | ( | const QString & |  | ) |

| Sets the delivery label. This is the literal text to be used as label. Definition at line 249 of file address.cpp.

QString Address::label | ( |  | ) | const

| Returns the delivery label. Definition at line 256 of file address.cpp. Referenced by typeLabel().

QString Address::labelLabel | ( |  | ) | `[static]`

| Returns the translated label for delivery label field. Definition at line 261 of file address.cpp.

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

| Returns the list of available types. Definition at line 266 of file address.cpp. Referenced by typeLabel().

QString Address::typeLabel | ( | int | type | ) | `[static]`

| Returns the translated label for a special type. Definition at line 275 of file address.cpp.

void Address::dump | ( |  | ) | const

| Used for debug output. Definition at line 305 of file address.cpp. References extended(), locality(), postalCode(), and street().

The documentation for this class was generated from the following files:

- address.h
- address.cpp

This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Jan 28 13:29:26 2004 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001