ContactPostalAddressBuilder

Since: BlackBerry 10.0.0

#include <bb/pim/contacts/ContactPostalAddressBuilder>

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

The ContactPostalAddressBuilder class lets you create, and specify properties for, a new ContactPostalAddress or edit an existing ContactPostalAddress.

You can use this class to set properties, such as city, country, postal code, and so on, for a ContactPostalAddress. This class uses the builder pattern to create a ContactPostalAddress and set its properties. Each of the set*() functions returns a self reference to the builder, allowing you to chain function calls together. For example, here's how to create a ContactPostalAddress with a first address line, city, region, and country using the builder pattern:

 ContactPostalAddress address = ContactPostalAddressBuilder()
                                  .setLine1("419 Phillip St.")
                                  .setCity("Waterloo")
                                  .setRegion("Ontario")
                                  .setCountry("Canada");


Overview

Public Functions Index

ContactPostalAddressBuilder ()
ContactPostalAddressBuilder (const ContactPostalAddressBuilder &copy)
ContactPostalAddressBuilder (ContactPostalAddress &address)
~ContactPostalAddressBuilder ()
operator ContactPostalAddress ()
ContactPostalAddressBuilder &operator= (const ContactPostalAddressBuilder &operand)
ContactPostalAddressBuilder &setCity (const QString &city)
ContactPostalAddressBuilder &setCountry (const QString &country)
ContactPostalAddressBuilder &setLabel (const QString &label)
ContactPostalAddressBuilder &setLatitude (double latitude)
ContactPostalAddressBuilder &setLine1 (const QString &line1)
ContactPostalAddressBuilder &setLine2 (const QString &line2)
ContactPostalAddressBuilder &setLongitude (double longitude)
ContactPostalAddressBuilder &setPostalCode (const QString &postalCode)
ContactPostalAddressBuilder &setRegion (const QString &region)
ContactPostalAddressBuilder &setSubKind (AttributeSubKind::Type subkind)

Public Functions

ContactPostalAddressBuilder ()

Constructs a new ContactPostalAddressBuilder.

Since:

BlackBerry 10.0.0

ContactPostalAddressBuilder (

Copy constructor.

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

Parameters
copy

The ContactPostalAddressBuilder to be copied.

Since:

BlackBerry 10.0.0

ContactPostalAddressBuilder (

Edits the provided ContactPostalAddress.

You can use this function to edit the properties of an existing ContactPostalAddress, as an alternative to calling ContactPostalAddress::edit().

Parameters
address

The ContactPostalAddress to edit.

Since:

BlackBerry 10.0.0

~ContactPostalAddressBuilder ()

Destructor.

Since:

BlackBerry 10.0.0

operator ContactPostalAddress ()

Cast operator.

This operator casts an object to the ContactPostalAddress type.

Since:

BlackBerry 10.0.0

ContactPostalAddressBuilder & operator= (

Assignment operator.

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

Parameters
operand

The ContactPostalAddressBuilder from which to copy all values.

Return:

A ContactPostalAddressBuilder with all copied data

Since:

BlackBerry 10.0.0

ContactPostalAddressBuilder & setCity (

Sets the city field of the postal address.

Parameters
city

The city value to set.

Return:

A ContactPostalAddressBuilder with the provided city value.

Since:

BlackBerry 10.0.0

ContactPostalAddressBuilder & setCountry (

Sets the country field of the postal address.

Parameters
country

The country value to set.

Return:

A ContactPostalAddressBuilder with the provided country value.

Since:

BlackBerry 10.0.0

ContactPostalAddressBuilder & setLabel (

Sets the label for the postal address.

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

Parameters
label

The label to set.

Return:

A ContactPostalAddressBuilder with the provided custom label.

Since:

BlackBerry 10.0.0

ContactPostalAddressBuilder & setLatitude (
  • doublelatitude)

Sets the latitude field of the postal address.

Parameters
latitude

The latitude value to set.

Return:

A ContactPostalAddressBuilder with the provided latitude value.

Since:

BlackBerry 10.0.0

ContactPostalAddressBuilder & setLine1 (

Sets the first address line field of the postal address.

Parameters
line1

The first address line value to set.

Return:

A ContactPostalAddressBuilder with the provided first address line value.

Since:

BlackBerry 10.0.0

ContactPostalAddressBuilder & setLine2 (

Sets the second address line field of the postal address.

Parameters
line2

The second address line value to set.

Return:

A ContactPostalAddressBuilder with the provided second address line value.

Since:

BlackBerry 10.0.0

ContactPostalAddressBuilder & setLongitude (
  • doublelongitude)

Sets the longitude field of the postal address.

Parameters
longitude

The longitude value to set.

Return:

A ContactPostalAddressBuilder with the provided longitude value.

Since:

BlackBerry 10.0.0

ContactPostalAddressBuilder & setPostalCode (

Sets the postal code field of the postal address.

Parameters
postalCode

The postal code value to set.

Return:

A ContactPostalAddressBuilder with the provided postal code value.

Since:

BlackBerry 10.0.0

ContactPostalAddressBuilder & setRegion (

Sets the region field of the postal address.

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.

Parameters
region

The region value to set.

Return:

A ContactPostalAddressBuilder with the provided region value.

Since:

BlackBerry 10.0.0

ContactPostalAddressBuilder & setSubKind (

Sets the sub-kind field of the postal address.

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

Parameters
subkind

The sub-kind value to set.

Return:

A ContactPostalAddressBuilder with the provided sub-kind value.

Since:

BlackBerry 10.0.0

Last modified: 2014-09-30



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus