ContactService

Since: BlackBerry 10.0.0

#include <bb/platform/bbm/ContactService>

Provides services related to a user's BBM contacts.

Provides access to a user's BBM contact list. For example, you can retrieve a list of all the contacts who have your app installed, compare contacts, or determine the total number of contacts in the list. It also provides signals for changes to the contact list.

library name="bbplatformbbm"/>


Overview

Public Functions Index

ContactService (Context *context, QObject *parent=0)
virtual ~ContactService ()
Contactcontact (const QString &handle) const
intcontactCount () const
QList< Contact >contacts () const
boolcontainsContact (const Contact &contact) const
boolisValid () const
boolrequestDisplayPicture (const QString &handle) const

Signals Index

voidapplicationDisabled (const QString &handle)
voidapplicationEnabled (const QString &handle)
voidcontactListUpdated ()
voidcontactUpdated (const QString &handle)
voiddisplayPictureUpdated (const QString &handle, const bb::platform::bbm::ImageType::Type imageType, const QByteArray &displayPicture)

Public Functions

ContactService (

Creates a new ContactService object with the Context as the basis.

Parameters
context

The basis for the ContactService object. All contacts related to the application Context object will be populated in this list.

parent

The QObject parent of this ContactService object.

Since:

BlackBerry 10.0.0

virtual~ContactService ()

Destructor.

Since:

BlackBerry 10.0.0

Contact contact (

Retrieves the contact with the specified handle.

Parameters
handle

The contact's handle.

Return:

The contact associated with specified handle, empty Contact otherwise.

Since:

BlackBerry 10.0.0

int contactCount ()

Returns the total number of contacts in this contact list.

Return:

The count of contacts associated with the service.

Since:

BlackBerry 10.0.0

QList< Contact > contacts ()

Returns all the contacts that have your app installed.

Return:

A QList<Contact> that contains the list of contacts.

Since:

BlackBerry 10.0.0

bool containsContact (

Checks whether the contact list already contains a contact with the same handle as the specified contact.

Parameters
contact

The contact to compare to.

Return:

true if the contact exists, false otherwise.

Since:

BlackBerry 10.0.0

bool isValid ()

Checks whether the contact list has been initialized and is valid.

Return:

true if the contact list has been initialized and is valid, false otherwise.

Since:

BlackBerry 10.0.0

bool requestDisplayPicture (

Requests the display picture for the contact with the specified handle.

The signal displayPictureUpdated is emitted as an asynchronous response.

Parameters
handle

The contact's handle.

Return:

true if sending the request succeeds, false otherwise.

Since:

BlackBerry 10.0.0

Signals

void applicationDisabled (

Emitted when a contact uninstalls or blocks the same application as that running on the user's device.

This notification is sent only if the same app is running on both the user's and contact's devices. It cannot be sent across different BBM connected applications.

Parameters
handle

The handle of the contact who uninstalled or blocked the application.

Since:

BlackBerry 10.0.0

void applicationEnabled (

Emitted when a contact installs or unblocks the same application as that running on the user's device.

This notification is sent only if the same app is running on both the user's and contact's devices. It cannot be sent across different BBM connected applications.

Parameters
handle

The handle of the contact who installed or unblocked the application.

Since:

BlackBerry 10.0.0

void contactListUpdated ()

Emitted when the ContactsService populates a contactlist, and the list data has been updated.

The ContactsService retrieves the contact list asynchronously.

Since:

BlackBerry 10.0.0

void contactUpdated (

Emitted when a contact has been updated.

Parameters
handle

The handle of the contact that was updated.

Since:

BlackBerry 10.0.0

void displayPictureUpdated (

Emitted when a contact's display picture is changed.

Parameters
handle

The handle of the contact whose display picture changed.

imageType

The MIME type of the new display picture. If an invalid MIME type is provided by this contact, the behavior of this method is undefined.

displayPicture

The new display picture data.

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