KABC::Address Class Reference
Postal address information. More...
#include <address.h>
Public Types | |
enum | Type { Dom = 1, Intl = 2, Postal = 4, Parcel = 8, Home = 16, Work = 32, Pref = 64 } |
typedef QValueList< Address > | List |
typedef QValueList< int > | TypeList |
Public Member Functions | |
Address () | |
Address (int) | |
bool | operator== (const Address &) const |
bool | operator!= (const Address &) const |
bool | isEmpty () const |
void | clear () |
void | setId (const QString &) |
QString | id () const |
void | setType (int type) |
int | type () const |
QString | typeLabel () const |
void | setPostOfficeBox (const QString &) |
QString | postOfficeBox () const |
void | setExtended (const QString &) |
QString | extended () const |
void | setStreet (const QString &) |
QString | street () const |
void | setLocality (const QString &) |
QString | locality () const |
void | setRegion (const QString &) |
QString | region () const |
void | setPostalCode (const QString &) |
QString | postalCode () const |
void | setCountry (const QString &) |
QString | country () const |
void | setLabel (const QString &) |
QString | label () const |
void | dump () const |
QString | formattedAddress (const QString &realName=QString::null, const QString &orgaName=QString::null) 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 (int type) |
static QString | countryToISO (const QString &cname) |
static QString | ISOtoCountry (const QString &ISOname) |
Friends | |
KABC_EXPORT QDataStream & | operator<< (QDataStream &, const Address &) |
KABC_EXPORT QDataStream & | operator>> (QDataStream &, Address &) |
Detailed Description
Postal address information.This class represents information about a postal address.
Definition at line 55 of file address.h.
Member Typedef Documentation
typedef QValueList<Address> KABC::Address::List |
Member Enumeration Documentation
enum KABC::Address::Type |
Constructor & Destructor Documentation
Address::Address | ( | ) |
Constructor that creates an empty Address, which is initialized with a unique id (see id()).
Definition at line 37 of file address.cpp.
Address::Address | ( | int | type | ) |
This is like Address() just above, with the difference that you can specify the type.
Definition at line 43 of file address.cpp.
Member Function Documentation
void Address::clear | ( | ) |
QString Address::country | ( | ) | const |
QString Address::countryLabel | ( | ) | [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 510 of file address.cpp.
void Address::dump | ( | ) | const |
QString Address::extended | ( | ) | const |
QString Address::extendedLabel | ( | ) | [static] |
QString Address::formattedAddress | ( | const QString & | realName = QString::null , |
|
const QString & | orgaName = QString::null | |||
) | 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 329 of file address.cpp.
bool Address::isEmpty | ( | ) | const |
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
- Since:
- 3.2
Definition at line 547 of file address.cpp.
QString Address::label | ( | ) | const |
QString Address::labelLabel | ( | ) | [static] |
QString Address::locality | ( | ) | const |
QString Address::localityLabel | ( | ) | [static] |
QString Address::postalCode | ( | ) | const |
QString Address::postalCodeLabel | ( | ) | [static] |
QString Address::postOfficeBox | ( | ) | const |
QString Address::postOfficeBoxLabel | ( | ) | [static] |
QString Address::region | ( | ) | const |
QString Address::regionLabel | ( | ) | [static] |
void Address::setCountry | ( | const QString & | s | ) |
void Address::setExtended | ( | const QString & | s | ) |
void Address::setId | ( | const QString & | id | ) |
void Address::setLabel | ( | const QString & | s | ) |
Sets the delivery label.
This is the literal text to be used as label.
Definition at line 257 of file address.cpp.
void Address::setLocality | ( | const QString & | s | ) |
void Address::setPostalCode | ( | const QString & | s | ) |
void Address::setPostOfficeBox | ( | const QString & | s | ) |
void Address::setRegion | ( | const QString & | s | ) |
void Address::setStreet | ( | const QString & | s | ) |
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 100 of file address.cpp.
QString Address::street | ( | ) | const |
QString Address::streetLabel | ( | ) | [static] |
int Address::type | ( | ) | const |
Returns the type of address.
Can be a bitwise or of multiple types.
Definition at line 107 of file address.cpp.
QString Address::typeLabel | ( | int | type | ) | [static] |
QString Address::typeLabel | ( | ) | const |
Returns a translated string of all types the address has.
Definition at line 112 of file address.cpp.
Address::TypeList Address::typeList | ( | ) | [static] |
The documentation for this class was generated from the following files: