ContactPostalAddress

Since: BlackBerry 10.0.0

#include <bb/pim/contacts/ContactPostalAddress>

To link against this class, add the following line to your .pro file: LIBS += -lbbpim

The ContactPostalAddress class represents a postal address for a contact.

This class contains information about a postal address that's associated with a Contact, such as city, country, postal code, latitude, and longitude.

You can retrieve a list of postal addresses for a contact by using Contact::postalAddresses(). You can add or delete a postal address for a contact by using ContactBuilder::addPostalAddress() and ContactBuilder::deletePostalAddress(), respectively. You can create a new ContactPostalAddress and specify values for an existing ContactPostalAddress by using a ContactPostalAddressBuilder.


Overview

Public Static Attributes Index

Public Functions Index

ContactPostalAddress ()
ContactPostalAddress (const ContactPostalAddress &copy)
~ContactPostalAddress ()
QStringcity () const
QStringcountry () const
ContactPostalAddressBuilderedit ()
intid () const
boolisValid () const
boolisValidLatitudeLongitude () const
QStringlabel () const
doublelatitude () const
QStringline1 () const
QStringline2 () const
doublelongitude () const
booloperator!= (const ContactPostalAddress &operand) const
ContactPostalAddress &operator= (const ContactPostalAddress &copy)
booloperator== (const ContactPostalAddress &operand) const
QStringpostalCode () const
QStringregion () const
AttributeSubKind::TypesubKind () const

Public Static Attributes

double InvalidLatitude ()

Represents a default invalid latitude value.

When a default instance of ContactPostalAddress is created, the latitude is set to InvalidLatitude.

Since:

BlackBerry 10.0.0

double InvalidLongitude ()

Represents a default invalid longitude value.

When a default instance of ContactPostalAddress is created, the latitude is set to InvalidLongitude.

Since:

BlackBerry 10.0.0

Public Functions

ContactPostalAddress ()

Constructs a new ContactPostalAddress.

Since:

BlackBerry 10.0.0

ContactPostalAddress (

Copy constructor.

This function constructs a ContactPostalAddress containing exactly the same values as the provided ContactPostalAddress.

Parameters
copy

The ContactPostalAddress to be copied.

Since:

BlackBerry 10.0.0

~ContactPostalAddress ()

Destructor.

Since:

BlackBerry 10.0.0

QString city ()

Retrieves the city field of this ContactPostalAddress.

Return:

The city field of this ContactPostalAddress.

Since:

BlackBerry 10.0.0

QString country ()

Retrieves the country field of this ContactPostalAddress.

Return:

The country field of this ContactPostalAddress.

Since:

BlackBerry 10.0.0

ContactPostalAddressBuilder edit ()

Edits the contents of this ContactPostalAddress.

This function returns a ContactPostalAddressBuilder that you can use to change the values of this ContactPostalAddress.

Return:

A ContactPostalAddressBuilder that you can use to change the values of this ContactPostalAddress.

Since:

BlackBerry 10.0.0

int id ()

Retrieves the internal ID of this ContactPostalAddress.

The internal ID is set only if the data is retrieved by the ContactService.

Return:

The internal ID of this ContactPostalAddress.

Since:

BlackBerry 10.0.0

bool isValid ()

Indicates whether this ContactPostalAddress is valid.

A ContactPostalAddress is considered invalid if all fields are empty and the latitude and longitude values are invalid. You should use this function to determine if a ContactPostalAddress is valid before you use it.

Return:

true if this ContactPostalAddress is valid, false otherwise.

Since:

BlackBerry 10.0.0

bool isValidLatitudeLongitude ()

Indicates whether the latitude and longitude values of this ContactPostalAddress are valid.

If either the latitude or longitude are outside of their allowed ranges, then this function returns false.

Return:

true if the latitude and longitude values of this ContactPostalAddress are valid, false otherwise.

Since:

BlackBerry 10.0.0

QString label ()

Retrieves the label of this ContactPostalAddress.

You can use this value as a custom label for the ContactPostalAddress, if needed.

Return:

The label of this ContactPostalAddress.

Since:

BlackBerry 10.0.0

double latitude ()

Retrieves the latitude field of this ContactPostalAddress.

The value of this field should be in the range of +- 90.0 degrees. A positive number indicates a location that's north of the equator, and a negative number indicates a location that's south of the equator.

Return:

The latitude field of this ContactPostalAddress.

Since:

BlackBerry 10.0.0

QString line1 ()

Retrieves the first address line field of this ContactPostalAddress.

Return:

The first address line field of this ContactPostalAddress.

Since:

BlackBerry 10.0.0

QString line2 ()

Retrieves the second address line field of this ContactPostalAddress.

Return:

The second address line field of this ContactPostalAddress.

Since:

BlackBerry 10.0.0

double longitude ()

Retrieves the longitude field of this ContactPostalAddress.

The value of this field should be in the range of +- 180.0 degrees. A positive number indicates a location that's east of the prime meridian, and a negative number indicates a location that's west of the prime meridian.

Return:

The longitude field of this ContactPostalAddress.

Since:

BlackBerry 10.0.0

bool operator!= (

Inequality operator.

This operator determines if this ContactPostalAddress has any different values from another ContactPostalAddress.

Parameters
operand

The ContactPostalAddress from which to compare.

Return:

true if any of the values are not considered equal, false otherwise.

Since:

BlackBerry 10.0.0

ContactPostalAddress & operator= (

Assignment operator.

This operator copies all values from the provided ContactPostalAddress into this ContactPostalAddress.

Parameters
copy

The ContactPostalAddress from which to copy all values.

Return:

A ContactPostalAddress with all copied data

Since:

BlackBerry 10.0.0

bool operator== (

Equality operator.

This operator determines if this ContactPostalAddress has the same values as another ContactPostalAddress.

Parameters
operand

The ContactPostalAddress from which to compare.

Return:

true if the values are considered equal, false otherwise.

Since:

BlackBerry 10.0.0

QString postalCode ()

Retrieves the postal code field of this ContactPostalAddress.

Return:

The postal code field of this ContactPostalAddress.

Since:

BlackBerry 10.0.0

QString region ()

Retrieves the region field of this ContactPostalAddress.

The region field might contain different values for different countries. For example, for a US postal address, this field would contain the state. For a Canadian postal address, this field would contain the province.

Return:

The region field of this ContactPostalAddress.

Since:

BlackBerry 10.0.0

AttributeSubKind::Type subKind ()

Retrieves the sub-kind of this ContactPostalAddress.

The valid sub-kinds of a ContactPostalAddress are AttributeSubKind::Home, AttributeSubKind::Work, or AttributeSubKind::Other.

Return:

The sub-kind of this ContactPostalAddress.

Since:

BlackBerry 10.0.0

Last modified: 2014-03-13

comments powered by Disqus