ContactPhotoBuilder

Since: BlackBerry 10.0.0

#include <bb/pim/contacts/ContactPhotoBuilder>

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

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

You can use this class to set properties, such as file path, for a ContactPhoto. This class uses the builder pattern to create a ContactPhoto 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 ContactPhoto with a file path using the builder pattern:

ContactPhoto photo = ContactPhotoBuilder()
                     .setOriginalPhoto("/images/photos/myPhoto1.png");
See also:

ContactPhoto


Overview

Public Functions Index

ContactPhotoBuilder ()
ContactPhotoBuilder (ContactPhoto &photo)
ContactPhotoBuilder (const ContactPhotoBuilder &copy)
~ContactPhotoBuilder ()
operator ContactPhoto ()
ContactPhotoBuilder &operator= (const ContactPhotoBuilder &operand)
ContactPhotoBuilder &setOriginalPhoto (const QString &filepath)
ContactPhotoBuilder &setPrimaryPhoto (bool isPrimary)

Public Functions

ContactPhotoBuilder ()

Constructs a new ContactPhotoBuilder.

Since:

BlackBerry 10.0.0

ContactPhotoBuilder (

Edits the provided ContactPhoto.

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

Parameters
photo

The ContactPhoto to edit.

Since:

BlackBerry 10.0.0

ContactPhotoBuilder (

Copy constructor.

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

Parameters
copy

The ContactPhotoBuilder to be copied.

Since:

BlackBerry 10.0.0

~ContactPhotoBuilder ()

Destructor.

Since:

BlackBerry 10.0.0

operator ContactPhoto ()

Cast operator.

This operator casts an object to the ContactPhoto type.

Since:

BlackBerry 10.0.0

ContactPhotoBuilder & operator= (

Assignment operator.

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

Parameters
operand

The ContactPhotoBuilder from which to copy all values.

Return:

A ContactPhotoBuilder with all copied data

Since:

BlackBerry 10.0.0

ContactPhotoBuilder & setOriginalPhoto (

Sets the file path of the original photo.

You should not prefix the file path with "file://". This string is added when you retrieve the photo using ContactPhoto::smallPhoto(), ContactPhoto::largePhoto(), or ContactPhoto::originalPhoto().

Parameters
filepath

The file path to set.

Return:

A ContactPhotoBuilder with the provided file path.

Since:

BlackBerry 10.0.0

ContactPhotoBuilder & setPrimaryPhoto (
  • boolisPrimary)

Sets whether this photo is the primary photo for a contact.

The default value is false (the ContactPhoto that's created is not the primary photo).

Parameters
isPrimary

If true the photo is the primary photo for a contact, if false the photo is not a primary photo for a contact.

Return:

A ContactPhotoBuilder with the provided indication of whether the photo is a primary photo for a contact.

Since:

BlackBerry 10.0.0

Last modified: 2014-06-24



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

comments powered by Disqus