ProfileBox

Since: BlackBerry 10.0.0

#include <bb/platform/bbm/ProfileBox>

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

Represents a class that provides access to your app's profile box in the user's BBM profile.

The user profile box is an area for your app that appears in the current user's BlackBerry Messenger profile. Each box contains a list of items, each composed of text and an optional icon. A profile box can contain a maximum of 3 items. As new items are added, older items are removed automatically.

The user can control whether your app's profile box appears in their profile through the global settings for the app. The app is only allowed to make changes if the user enables this option. You can check this setting by calling permissionValue(Permission::ProfileUpdatesAllowed).

This box can be viewed by the current user and their contacts. It can be modified by the current user and the app that owns it, but the current user can remove items only.

The user can invoke the app from its profile box in their BBM profile or a contact's BBM profile. The app will be brought to the foreground, or launched if it's not already running. Contacts who do not have the app installed will be brought to the app's page in BlackBerry World if that version of the app is available on BlackBerry World.

The functionality of this class is only available if the app has access to the BBM Social Platform and has received permission, Permission::ProfileUpdatesAllowed.


Overview

Public Functions Index

ProfileBox (Context *context, QObject *parent=0)
virtual ~ProfileBox ()
ProfileBoxItemitem (const QString &itemId) const
intitemCount () const
QList< ProfileBoxItem >items () const
boolrequestAddItem (const QString &text, int iconId, const QString &cookie=QString())
boolrequestAddItem (const QString &text, const QString &cookie=QString())
boolrequestRegisterIcon (int iconId, bb::platform::bbm::ImageType::Type iconType, const QByteArray &iconData)
boolrequestRemoveAllItems ()
boolrequestRemoveItem (const QString &itemId)
boolrequestRetrieveIcon (int iconId) const

Signals Index

voidiconRegistered (int iconId)
voidiconRetrieved (int iconId, bb::platform::bbm::ImageType::Type iconType, const QByteArray &iconData)
voiditemAdded (const QString &itemId)
voiditemRemoved (const QString &itemId)

Public Functions

ProfileBox (

Creates a new ProfileBox object with context as the basis.

Parameters
context

The context that provides the basis for the ProfileBox.

parent

The QObject parent of this ProfileBox object.

Since:

BlackBerry 10.0.0

virtual~ProfileBox ()

Destructor.

Since:

BlackBerry 10.0.0

ProfileBoxItem item (

Retrieves the ProfileBoxItem with the specified itemId.

Parameters
itemId

The ID of the ProfileBoxItem to retrieve.

Return:

The ProfileBoxItem associated with the specified itemId; an empty ProfileBoxItem otherwise. If the application does not have Permission::ProfileUpdatesAllowed, returns an empty ProfileBoxItem.

Since:

BlackBerry 10.0.0

int itemCount ()

Returns the total number of items in the profile box.

Return:

The count of items in the profile box. If the application does not have Permission::ProfileUpdatesAllowed, returns 0.

Since:

BlackBerry 10.0.0

QList< ProfileBoxItem > items ()

Returns all profile box items.

Return:

A QList<ProfileBoxItem> with all the profile box items. If the application does not have Permission::ProfileUpdatesAllowed, returns an empty QList<ProfileBoxItem>.

Since:

BlackBerry 10.0.0

bool requestRegisterIcon (

Requests registration of an icon with the specified iconId, iconType and iconData.

The signal iconRegistered() is emitted as an asynchronous response.

Parameters
iconId

The unique, non-negative ID of the icon to register.

iconType

The MIME type of the icon. If an invalid MIME type is specified, the behavior of this method is undefined.

iconData

The icon data. iconData must not be empty.

Return:

true if sending the request succeeds, false otherwise. If the application does not have Permission::ProfileUpdatesAllowed, returns false.

Since:

BlackBerry 10.0.0

bool requestRemoveAllItems ()

Requests removal of all items in the ProfileBox.

The signal itemRemoved() is emitted as an asynchronous response for each item removed.

Return:

true if sending the request succeeds, false otherwise. If the application does not have Permission::ProfileUpdatesAllowed, returns false.

Since:

BlackBerry 10.0.0

bool requestRemoveItem (

Requests removal of the ProfileBoxItem with the specified itemId.

Parameters
itemId

The itemId of the ProfileBoxItem to remove. The signal itemRemoved() is emitted as an asynchronous response.

Return:

true if sending the request succeeds, false otherwise. If the application does not have Permission::ProfileUpdatesAllowed, returns false.

Since:

BlackBerry 10.0.0

bool requestRetrieveIcon (
  • inticonId)

Requests retrieval of the icon with the given iconId.

The signal iconRetrieved() is emitted as an asynchronous response.

Parameters
iconId

The ID of the requested icon.

Return:

true if sending the request succeeds, false otherwise. If the application does not have Permission::ProfileUpdatesAllowed, returns false.

Since:

BlackBerry 10.0.0

Signals

void iconRegistered (
  • inticonId)

Emitted when the icon specified by the iconId is registered.

Parameters
iconId

The ID of the registered icon.

Since:

BlackBerry 10.0.0

void iconRetrieved (

Emitted in response to an icon retrieval request.

Parameters
iconId

The ID of the icon that was retrieved.

iconType

The MIME type of the icon that was retrieved. If an invalid type was specified during icon registration, the behavior of this method is undefined.

iconData

The icon data.

Since:

BlackBerry 10.0.0

void itemAdded (

Emitted when the ProfileBoxItem is added to the ProfileBox.

Parameters
itemId

The ID of the item added to the ProfileBox.

Since:

BlackBerry 10.0.0

void itemRemoved (

Emitted when a ProfileBoxItem is removed from the ProfileBox.

Parameters
itemId

The ID of the ProfileBoxItem removed from the ProfileBox.

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