kabc
KABC::Address Class Reference
#include <address.h>
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 ®ion) |
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 |
typedef QList<TypeFlag> KABC::Address::TypeList |
Member Enumeration Documentation
Constructor & Destructor Documentation
Address::Address | ( | ) |
Address::Address | ( | Type | type | ) |
Address::Address | ( | const Address & | address | ) |
Address::~Address | ( | ) |
Member Function Documentation
bool Address::operator== | ( | const Address & | addr | ) | const |
Equality operator.
- Parameters:
-
addr the address to compare to
- Returns:
true
ifthis
andaddr
are equal, otherwisefalse
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
ifthis
andaddr
are not equal, otherwisefalse
Definition at line 294 of file address.cpp.
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 |
void Address::clear | ( | ) |
void Address::setId | ( | const QString & | identifier | ) |
QString Address::id | ( | ) | const |
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 | ) |
QString Address::postOfficeBox | ( | ) | const |
QString Address::postOfficeBoxLabel | ( | ) | [static] |
void Address::setExtended | ( | const QString & | extended | ) |
QString Address::extended | ( | ) | const |
QString Address::extendedLabel | ( | ) | [static] |
void Address::setStreet | ( | const QString & | street | ) |
QString Address::street | ( | ) | const |
QString Address::streetLabel | ( | ) | [static] |
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 |
QString Address::localityLabel | ( | ) | [static] |
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 |
QString Address::regionLabel | ( | ) | [static] |
void Address::setPostalCode | ( | const QString & | code | ) |
QString Address::postalCode | ( | ) | const |
QString Address::postalCodeLabel | ( | ) | [static] |
void Address::setCountry | ( | const QString & | country | ) |
QString Address::country | ( | ) | const |
QString Address::countryLabel | ( | ) | [static] |
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 |
QString Address::labelLabel | ( | ) | [static] |
Address::TypeList Address::typeList | ( | ) | [static] |
QString Address::typeLabel | ( | Type | type | ) | [static] |
QString Address::toString | ( | ) | const |
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] |
QDataStream& operator>> | ( | QDataStream & | s, | |
Address & | addr | |||
) | [friend] |
The documentation for this class was generated from the following files: