ContactGroupBuilder

Since: BlackBerry 10.3.0

#include <bb/pim/contacts/ContactGroupBuilder>

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

The ContactGroupBuilder class lets you create and specify properties for a new ContactGroup or edit an existing ContactGroup.

You can use this class to set properties, such as attributes, a postal address, or a photo, for a ContactGroup. This class uses the builder pattern to create a ContactGroup and set its properties. Each of the functions returns a self reference to the builder, allowing you to chain function calls together. For example, here's how to create a ContactGroup with two attributes using the builder pattern:

ContactGroup createARandomContactGroup()
{
    ContactService service;
    ContactGroupBuilder builder;
    return service.createContactGroup(builder);
}

Any changes that you make to a ContactGroup using this builder are temporary until the changes are persisted by using the ContactService.


Overview

Public Functions Index

ContactGroupBuilder ()
ContactGroupBuilder (ContactGroup &contact)
ContactGroupBuilder (const ContactGroupBuilder &copy)
~ContactGroupBuilder ()
operator ContactGroup ()
ContactGroupBuilder &operator= (const ContactGroupBuilder &cgb)
ContactGroupBuilder &setFavourite (bool isFavourite)
ContactGroupBuilder &setName (const QString &name)

Public Functions

ContactGroupBuilder ()

Constructs a new ContactGroupBuilder.

Since:

BlackBerry 10.3.0

ContactGroupBuilder (

Edits the provided ContactGroup.

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

Parameters
contact

The ContactGroup to edit.

See also:

ContactGroup::edit()

Since:

BlackBerry 10.3.0

ContactGroupBuilder (

Copy constructor.

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

Parameters
copy

The ContactGroupBuilder to be copied.

Since:

BlackBerry 10.3.0

~ContactGroupBuilder ()

Destructor.

Since:

BlackBerry 10.3.0

operator ContactGroup ()

Cast operator.

This operator casts an object to the ContactGroup type.

Since:

BlackBerry 10.3.0

ContactGroupBuilder & operator= (

Assignment operator.

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

Parameters
cgb

The ContactGroupBuilder from which to copy all values.

Return:

A ContactGroupBuilder with all copied data.

Since:

BlackBerry 10.3.0

ContactGroupBuilder & setFavourite (
  • boolisFavourite)

Sets whether the contact group is a favorite contact.

Favorite contacts are displayed in the favorites grid in the Contacts application.

Parameters
isFavorite

If true the contact group is a favorite contact, if false the contact group is not a favorite contact.

Return:

A ContactGroupBuilder with the provided indication of whether the contact group is a favorite contact.

Since:

BlackBerry 10.3.0

ContactGroupBuilder & setName (

Sets the name for the group.

Parameters
name

The group name to set.

Return:

A ContactGroupBuilder with the modified group name.

Since:

BlackBerry 10.3.0

Last modified: 2014-06-24



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

comments powered by Disqus