KABC::Address Class Reference
Postal address information. More...
#include <address.h>
Collaboration diagram for KABC::Address:

Public Types | |
typedef QValueList< Address > | List |
typedef QValueList< int > | TypeList |
enum | Type { Dom = 1, Intl = 2, Postal = 4, Parcel = 8, Home = 16, Work = 32, Pref = 64 } |
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
|
List of addresses.
|
Member Enumeration Documentation
|
Address types:.
|
Constructor & Destructor Documentation
|
Constructor that creates an empty Address, which is initialized with a unique id (see id()).
Definition at line 37 of file address.cpp. References KApplication::randomString(). Referenced by clear(). |
|
This is like Address() just above, with the difference that you can specify the type.
Definition at line 43 of file address.cpp. References KApplication::randomString(). |
Member Function Documentation
|
Returns true, if the address is empty.
Definition at line 68 of file address.cpp. References QString::isEmpty(). Referenced by formattedAddress(). |
|
Clears all entries of the address.
Definition at line 83 of file address.cpp. References Address(). |
|
Sets the unique id.
Definition at line 88 of file address.cpp. |
|
Sets the type of address. See enum for definiton of types.
Definition at line 100 of file address.cpp. Referenced by KABC::VCard21Parser::readAddressFromQStringList(). |
|
Returns the type of address. Can be a bitwise or of multiple types. Definition at line 107 of file address.cpp. Referenced by typeLabel(). |
|
Returns a translated string of all types the address has.
Definition at line 112 of file address.cpp. References QString::append(), QValueList::begin(), QValueList::end(), label(), type(), and typeList(). |
|
Sets the post office box.
Definition at line 131 of file address.cpp. Referenced by KABC::VCard21Parser::readAddressFromQStringList(). |
|
Returns the post office box.
Definition at line 138 of file address.cpp. |
|
Returns the translated label for post office box field.
Definition at line 143 of file address.cpp. |
|
Sets the extended address information.
Definition at line 149 of file address.cpp. Referenced by KABC::VCard21Parser::readAddressFromQStringList(). |
|
Returns the extended address information.
Definition at line 156 of file address.cpp. Referenced by dump(). |
|
Returns the translated label for extended field.
Definition at line 161 of file address.cpp. |
|
Sets the street (including number).
Definition at line 167 of file address.cpp. Referenced by KABC::VCard21Parser::readAddressFromQStringList(). |
|
Returns the street.
Definition at line 174 of file address.cpp. Referenced by dump(). |
|
Returns the translated label for street field.
Definition at line 179 of file address.cpp. |
|
Sets the locality, e.g. city. Definition at line 185 of file address.cpp. Referenced by KABC::VCard21Parser::readAddressFromQStringList(). |
|
Returns the locality.
Definition at line 192 of file address.cpp. Referenced by dump(). |
|
Returns the translated label for locality field.
Definition at line 197 of file address.cpp. |
|
Sets the region, e.g. state. Definition at line 203 of file address.cpp. Referenced by KABC::VCard21Parser::readAddressFromQStringList(). |
|
Returns the region.
Definition at line 210 of file address.cpp. |
|
Returns the translated label for region field.
Definition at line 215 of file address.cpp. |
|
Sets the postal code.
Definition at line 221 of file address.cpp. Referenced by KABC::VCard21Parser::readAddressFromQStringList(). |
|
Returns the postal code.
Definition at line 228 of file address.cpp. Referenced by dump(). |
|
Returns the translated label for postal code field.
Definition at line 233 of file address.cpp. |
|
Sets the country.
Definition at line 239 of file address.cpp. Referenced by KABC::VCard21Parser::readAddressFromQStringList(). |
|
Returns the country.
Definition at line 246 of file address.cpp. Referenced by countryToISO(), and formattedAddress(). |
|
Returns the translated label for country field.
Definition at line 251 of file address.cpp. |
|
Sets the delivery label. This is the literal text to be used as label. Definition at line 257 of file address.cpp. Referenced by KABC::VCard21Parser::readFromString(). |
|
Returns the delivery label.
Definition at line 264 of file address.cpp. Referenced by typeLabel(). |
|
Returns the translated label for delivery label field.
Definition at line 269 of file address.cpp. |
|
Returns the list of available types.
Definition at line 274 of file address.cpp. References QValueList::isEmpty(). Referenced by typeLabel(). |
|
Returns the translated label for a special type.
Definition at line 284 of file address.cpp. |
|
Used for debug output.
Definition at line 317 of file address.cpp. References endl(), extended(), kdDebug(), locality(), postalCode(), and street(). |
|
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.
Definition at line 329 of file address.cpp. References KLocale::country(), country(), countryToISO(), endl(), QString::isEmpty(), isEmpty(), kdWarning(), KGlobal::locale(), locate(), KConfigBase::readEntry(), KConfigBase::setGroup(), and QString::upper(). |
|
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.
Definition at line 510 of file address.cpp. References QFile::close(), KLocale::country(), country(), KGlobal::dirs(), QMap::end(), QMap::find(), KStandardDirs::findResource(), QMap::insert(), QString::isNull(), KGlobal::locale(), QFile::open(), QTextStream::readLine(), KStaticDeleter< type >::setObject(), and QStringList::split(). Referenced by formattedAddress(). |
|
Returns a localized country name for a ISO code. This might be replaced by a KLocale method in the future.
Definition at line 547 of file address.cpp. References QFile::close(), KGlobal::dirs(), QString::find(), KStandardDirs::findResource(), QString::isNull(), QString::left(), QString::lower(), QFile::open(), QTextStream::readLine(), QString::simplifyWhiteSpace(), and QString::utf8(). |
The documentation for this class was generated from the following files: