UserProfile

Since: BlackBerry 10.0.0

#include <bb/platform/bbm/UserProfile>

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

Represents the user's BBM profile.

UserProfile is a class that represents the user's BBM profile on the BBM Social Platform. You can retrieve the user's display name, and change the user's display picture, status, and personal message. To access this information the application has to have access allowed.


Overview

Public Functions Index

UserProfile (Context *context, QObject *parent=0)
virtual ~UserProfile ()
QStringapplicationVersion () const
PRIVATE intbbmVersion () const
QStringdisplayName () const
QByteArraydisplayPicture () const
bb::platform::bbm::ImageType::TypedisplayPictureMimeType () const
QStringhandle () const
QStringpersonalMessage () const
QStringppId () const
boolrequestUpdateDisplayPicture (bb::platform::bbm::ImageType::Type imageType, const QByteArray &displayPicture)
boolrequestUpdatePersonalMessage (const QString &value)
boolrequestUpdateStatus (bb::platform::bbm::UserStatus::Type status, const QString &statusMessage)
bb::platform::bbm::UserStatus::Typestatus () const
QStringstatusMessage () const

Signals Index

voiddisplayNameUpdated (const QString &value)
voiddisplayPictureUpdated (bb::platform::bbm::ImageType::Type displayPictureMimeType, const QByteArray &displayPicture)
voidpersonalMessageUpdated (const QString &value)
voidstatusUpdated (bb::platform::bbm::UserStatus::Type status, const QString &statusMessage)

Public Functions

UserProfile (

Creates a new UserProfile object.

Parameters
context

The context that provides the basis for the UserProfile.

parent

The QObject parent of this UserProfile object.

Since:

BlackBerry 10.0.0

virtual~UserProfile ()

Destructor.

Since:

BlackBerry 10.0.0

QString applicationVersion ()

Retrieves the version of the BBM connected app that is running on the user's device.

Return:

The version of the BBM connected app that is running on the user's device.

Since:

BlackBerry 10.0.0

PRIVATE int bbmVersion ()

Retrieve the version of BBM that is running on the user's device.

Possible BBM versions are:
  • 0x0100 for BBM version 1.0 on devices running BlackBerry Device Software 5.0 or earlier

  • 0x0200 for BBM version 2.0 on devices running BlackBerry Device Software 5.0 or earlier

  • 0x0201 for BBM version 2.1 on devices running BlackBerry Device Software 5.0 or earlier

  • 0x0202 for BBM version 2.2 on devices running BlackBerry Device Software 5.0 or earlier

  • 0x0205 for BBM version 2.5 on devices running BlackBerry Device Software 5.0 or earlier

  • 0x0206 for BBM version 2.6 on devices running BlackBerry Device Software 5.0 or earlier

  • 0x0600 for BBM version 6.0 on devices running BlackBerry Device Software 5, BlackBerry 6, or BlackBerry 7

  • 0x0601 for BBM version 6.1 on devices running BlackBerry Device Software 5, BlackBerry 6, or BlackBerry 7

  • 0x0700 for BBM version 7.0 on devices running BlackBerry Device Software 5, BlackBerry 6, or BlackBerry 7

  • 0x0a00 for BBM version 10.0 on devices running BlackBerry 10

  • 0x00 for unknown version

Return:

int The version of BBM that is running on the user's device. If the version is unknown, returns 0.

Since:

BlackBerry 10.2.0

QString displayName ()

Retrieves the user's BBM display name.

Return:

The user's BBM display name.

QByteArray displayPicture ()

Retrieves the user's BBM display picture.

Return:

The user's BBM display picture.

Since:

BlackBerry 10.0.0

bb::platform::bbm::ImageType::Type displayPictureMimeType ()

Retrieves the MIME type of the user's display picture.

If an invalid MIME type is provided, the behavior of this method is undefined.

Return:

The MIME type of the user's display picture.

Since:

BlackBerry 10.0.0

QString handle ()

Retrieves the user's handle.

The handle is an identifier for a user on the BBM Social Platform whose device is running BlackBerry 7 or earlier. It is provided for backwards compatibility and should NOT be used as a persistent identifier for a user. Use the ppid instead.

The User's handle is the same for each instance of BBM (for example, on a BlackBerry smartphone and a BlackBerry tablet).

Return:

The user's handle.

Since:

BlackBerry 10.0.0

QString personalMessage ()

Retrieves the user's BBM personal message.

Return:

The user's BBM personal message.

Since:

BlackBerry 10.0.0

QString ppId ()

Retrieves the user's ppid.

A user's ppid is the same across multiple instances of BBM (for example, on a BlackBerry smartphone and a BlackBerry tablet), when the user signs in with the same BlackBerry ID.

Return:

The user's ppid.

Since:

BlackBerry 10.0.0

bool requestUpdateDisplayPicture (

Requests permission to update the user's BBM display picture.

The signal displayPictureUpdated is emitted as an asynchronous response. The display picture is limited to 32kB of data; an attempt to update with a display picture that exceeds this limit will fail.
Parameters
imageType

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

displayPicture

The new display picture data.

Return:

true if sending the request succeeds; false otherwise.

Since:

BlackBerry 10.0.0

bool requestUpdatePersonalMessage (

Updates the user's BBM personal message.

The signal personalMessageUpdated() is emitted as an asynchronous response.
Parameters
value

The new personal message.

Return:

true if sending the request succeeds; false otherwise.

Since:

BlackBerry 10.0.0

bool requestUpdateStatus (

Requests permission to update the user's BBM status and status message.

The signal statusUpdated() is emitted as an asynchronous response.
Parameters
status

The new user status.

statusMessage

The new status message.

Return:

true if sending the request succeeds; false otherwise.

Since:

BlackBerry 10.0.0

bb::platform::bbm::UserStatus::Type status ()

Retrieves the user's BBM status.

Return:

The user's BBM status.

Since:

BlackBerry 10.0.0

QString statusMessage ()

Retrieves the user's BBM status message.

Return:

The user's BBM status message.

Since:

BlackBerry 10.0.0

Signals

void displayNameUpdated (

Emitted when the user's BBM displayName property changes.

Parameters
value

The new value of the displayName property.

Since:

BlackBerry 10.0.0

void displayPictureUpdated (

Emitted when the user's BBM display picture changes.

Parameters
displayPictureMimeType

The new value of the displayPictureMimeType. If an invalid MIME type is provided, the behavior of this method is undefined.

displayPicture

The new value of the display picture data.

Since:

BlackBerry 10.0.0

void personalMessageUpdated (

Emitted when the user's BBM personalMessage property changes.

Parameters
value

The new value of the personalMessage property.

Since:

BlackBerry 10.0.0

void statusUpdated (

Emitted when the user's BBM status and/or statusMessage changes.

Parameters
status

The new value of the status property.

statusMessage

The new value of the statusMessage property.

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