Since: BlackBerry 10.0.0
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.
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.
Public Functions Index
The activity state of the device.
The current orientation of the device.
To interpret the value, see bb::device::DeviceOrientation.
The validity of the orientation value.
The orientation is valid if a valid value has been received from the underlying sensor, otherwise it is not valid.
Constructs a DeviceInfo object.
Constructs a DeviceInfo object from which may be retrieved information about the device.
If not 0, the supplied parent will be responsible for deleting this instance.
Returns the current user activity state.
The current user activity state. See bb::device::UserActivityState for a list of possible states.
Returns whether the current orientation is valid.
When a DeviceInfo instance is created, the underlying sensor backend is started. In certain instances this startup may take some time, and so a default value of bb::device::DeviceOrientation::TopUp will be returned until a value is supplied by the underlying sensor.
Any time that the orientationChanged signal is emitted results in a valid value.
True if the value returned by orientation() is valid, false otherwise.
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.
In order to determine whether or not the orientation returned from this method is valid, you should check the value returned by isOrientationValid.
The value returned from this function will be bb::device::DeviceOrientation::TopUp until the underlying sensor has provided a value. Attaching to either the orientationChanged or the orientationValidChanged signals should inform you when the default value is no longer being returned.
Returns the current orientation of the device as specified in bb::device::DeviceOrientation.
Emitted when the user activity state has changed.
The new activity state of the device.
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.
The new orientation the device has assumed.
Do not use this signal to control any aspect of your UI layout. Use the appropriate orientation signals supplied by the Cascades UI framework.
Emitted when the validity of the orientation value has changed.
Whether the current orientation value is valid.