Led
#include <bb/device/Led>
To link against this class, add the following line to your .pro file: LIBS += -lbbdevice
The Led class represents requests for flashing the LED present on the device.
This class requires that the application be granted the access_led_control capability.
BlackBerry 10.0.0
Properties Index
| bb::device::LedColor::Type | color |
| int | remainingFlashCount [read-only] |
| bool | active [read-only] |
Public Functions Index
| Led (QObject *parent=0) | |
| Led (bb::device::LedColor::Type ledColor, QObject *parent=0) | |
| virtual | ~Led () |
| bb::device::LedColor::Type | color () const |
| int | remainingFlashCount () const |
| bool | isActive () const |
| void | setColor (bb::device::LedColor::Type ledColor) |
| void | resetColor () |
Signals Index
| void | colorChanged (bb::device::LedColor::Type value) |
| void | remainingFlashCountChanged (int value) |
| void | activeChanged (bool value) |
Properties
Public Functions
Construct an Led instance with default options, i.e., with color as bb::device::LedColor::Red.
The Led instance is not activated automatically. Invoke flash() to activate the Led instance.
| Parameters | |
|---|---|
| parent |
If not 0, the supplied parent is responsible for deleting this instance. |
This application must have the access_led_control permission to use this class.
BlackBerry 10.0.0
Construct an Led instance with a custom color.
virtual
Destructor.
This will cancel any pending requests.
BlackBerry 10.0.0
bb::device::LedColor::Type
Retrieve the color of the Led instance.
If Led::active property is true, this represents the color that is flashing.
Returns the color of this instance.
BlackBerry 10.0.0
int
Retrieve the number of flashes remaining for the Led instance.
If the Led::active property is false, 0 is returned. If the Led::active property is true, this represents the remaining number of times that the active color is flashed. If the Led instance is set to flash indefinitely, a value of -1 is returned.
Returns the number of flashes remaining for this Led instance.
BlackBerry 10.0.0
bool
Retrieve the state of the Led instance.
Represents the state of the requests initiated using this instance.
Returns true if a flash request is pending.
BlackBerry 10.0.0
void
Set the color of the Led instance.
If the Led::active property is true and ledColor is not LedColor::None, then the last request will continue with the new color without resetting the Led::remainingFlashCount property. If ledColor is LedColor::None, then the request is canceled, emitting the activeChanged() signal instead of the colorChanged() signal.
| Parameters | |
|---|---|
| ledColor |
The new color for this instance. |
BlackBerry 10.0.0
void
Reset the color of this instance.
The default value is bb::device::LedColor::Red.
BlackBerry 10.0.0
Public Slots
void
Requests that the LED is flashed indefinitely with the color returned by color().
The Led::active property is set to true.
Any existing requests are canceled.
,If the Led::color property is LedColor::None, then no action is taken.
BlackBerry 10.0.0
void
Requests that the LED is flashed the specified number of times with the color returned by color().
The Led::active property is set to true.
Any existing requests are canceled.
,If the Led::color property is LedColor::None, then no action is taken.
| Parameters | |
|---|---|
| count |
The number of times that the LED should be flashed. A negative number is treated as a request to flash indefinitely. |
BlackBerry 10.0.0
void
Cancel any active requests that were made using flash().
The Led::active property is set to false and any requests to flash the LED that were made outside of this instance are not canceled.
BlackBerry 10.0.0
Signals
void
Emitted when the Led::color property changes.
| Parameters | |
|---|---|
| value |
The new value for the Led::color property. |
BlackBerry 10.0.0
void
Emitted when the Led::remainingFlashCount property changes.
When the count reaches 0, the request is completed, and therefore the activeChanged() signal is emitted instead of this signal.
This signal is not emitted for indefinite flash requests.
| Parameters | |
|---|---|
| value |
The new value for the Led::remainingFlashCount property. |
BlackBerry 10.0.0
void
Emitted when the Led::active property changes.
| Parameters | |
|---|---|
| value |
The new value for the Led::active property. |
BlackBerry 10.0.0