DeviceInfo

Since: BlackBerry 10.0.0

#include <bb/device/DeviceInfo>

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

Provides access to information about the current state of the device.

The DeviceInfo class provides access to information about the current state of the device, such as the orientation in which the device is currently being held and the activity state of the device.

Device Activity State

Instances of this class can be used to monitor the activity state of the device, which can be used to determine if the end user can interact with the device.

If the device is active, then the user is able to interact with it. This implies that the display is enabled, but does not imply anything about the lock state of the device. A user is still able to interact with a locked device, to unlock it. That is, an active device may be unlocked, screen-locked, or password-locked.

If the device is inactive, then the user is not able to interact with it. This implies that the display is disabled. Further, the device may be screen-locked or password-locked, and may even be in standby mode.

Also note that this is the device activity state. The state of the requesting process (fullscreen, thumbnailed, or invisible) has no effect on the result.


Overview

Signals Index

voidactivityStateChanged (bb::device::UserActivityState::Type activityState)
voidorientationChanged (bb::device::DeviceOrientation::Type orientation)

Properties

bb::device::UserActivityState::Type activityState[read-only]

The activity state of the device.

See bb::device::UserActivityState for a list of possible states.

Since:

BlackBerry 10.2.0

bb::device::DeviceOrientation::Type orientation[read-only]

The current orientation of the device.

To interpret the value, see bb::device::DeviceOrientation.

Since:

BlackBerry 10.0.0

Public Functions

DeviceInfo (

Constructs a DeviceInfo object.

Constructs a DeviceInfo object from which may be retrieved information about the device.

Parameters
parent

If not 0, the supplied parent will be responsible for deleting this instance.

Since:

BlackBerry 10.0.0

virtual~DeviceInfo ()

Destructor.

Since:

BlackBerry 10.0.0

bb::device::UserActivityState::Type activityState ()

Returns the current user activity state.

Return:

The current user activity state. See bb::device::UserActivityState for a list of possible states.

Since:

BlackBerry 10.2.0

bb::device::DeviceOrientation::Type orientation ()

Retrieves the current orientation of the device.

This function lets you retrieve the current orientation of the device. To interpret the result, see bb::device::DeviceOrientation.

Return:

Returns the current orientation of the device as specified in bb::device::DeviceOrientation.

Since:

BlackBerry 10.0.0

Signals

void activityStateChanged (

Emitted when the user activity state has changed.

Parameters
activityState

The new activity state of the device.

Since:

BlackBerry 10.2.0

void orientationChanged (

Emitted when the orientation of the device has changed.

This notification is independent of the orientation of the display changing. Specifically, this signal will still be emitted as the device is tilted, even if an application has locked the screen rotation.

Parameters
orientation

The new orientation the device has assumed.

Note:

Do not use this signal to control any aspect of your UI layout. Use the appropriate orientation signals supplied by the Cascades UI framework.

Since:

BlackBerry 10.0.0

Last modified: 2014-03-13

comments powered by Disqus