KContacts::AddressFormat Class

class KContacts::AddressFormat

Information on how addresses are formatted in a specific country/language. More...

Header: #include <KContacts/AddressFormat>
CMake: find_package(KF6 REQUIRED COMPONENTS Contacts)
target_link_libraries(mytarget PRIVATE KF6::Contacts)
Since: 5.92

Properties

Public Functions

AddressFormat()
QString country() const
const std::vector<KContacts::AddressFormatElement> &elements() const
QString postalCodeRegularExpression() const
KContacts::AddressFormatFields requiredFields() const
KContacts::AddressFormatFields upperCaseFields() const
KContacts::AddressFormatFields usedFields() const

Detailed Description

This is primarily used for displaying or printing addresses, but is also useful for country specific adjustment in address edit forms, or for parsing textual addresses.

See also AddressFormatRepository.

Property Documentation

[read-only] country : const QString

Access functions:

QString country() const

[read-only] elements : const QList<KContacts::AddressFormatElement>

[read-only] postalCodeRegularExpression : const QString

Access functions:

QString postalCodeRegularExpression() const

[read-only] requiredFields : const KContacts::AddressFormatFields

Access functions:

KContacts::AddressFormatFields requiredFields() const

[read-only] upperCaseFields : const KContacts::AddressFormatFields

Access functions:

KContacts::AddressFormatFields upperCaseFields() const

[read-only] usedFields : const KContacts::AddressFormatFields

Access functions:

KContacts::AddressFormatFields usedFields() const

Member Function Documentation

AddressFormat::AddressFormat()

QString AddressFormat::country() const

ISO 3166-1 alpha2 code of the country this format is for.

Note: Getter function for property country.

const std::vector<KContacts::AddressFormatElement> &AddressFormat::elements() const

A sequence of field/literal/separator elements for this address format.

QString AddressFormat::postalCodeRegularExpression() const

Regular expression matching the postal codes of this format.

Note: Getter function for property postalCodeRegularExpression.

KContacts::AddressFormatFields AddressFormat::requiredFields() const

The address fields that are required by this format for a valid address.

Note: This information is not available for all formats.

Note: Getter function for property requiredFields.

KContacts::AddressFormatFields AddressFormat::upperCaseFields() const

Fields that should be printed in upper case regardless of the input casing.

Note: Getter function for property upperCaseFields.

KContacts::AddressFormatFields AddressFormat::usedFields() const

The address fields that are used by this format. This is a superset of requiredFields(), and this information is available for all formats.

Note: Getter function for property usedFields.