SystemProgressToast
#include <bb/system/SystemProgressToast>
To link against this class, add the following line to your .pro file: LIBS += -lbbsystem
A message displayed to the user that presents the progress of a task and does not usually require user interaction to be dismissed.
The toast will be dismissed after a predefined timeout period expires. If the toast includes a button, then the timeout period is activated with the first user interaction, for example, user touching the screen. During this time, if a button is displayed, the user can select it.
Presentation properties are marked as such, and affect future requests. Any pending requests will use the values of the presentation properties at the time of the request.
BlackBerry 10.0.0
Properties Index
Public Functions Index
| SystemProgressToast (QObject *parent=0) | |
| virtual | ~SystemProgressToast () |
| QString | body () const |
| int | progress () const |
| QString | statusMessage () const |
| bb::system::SystemUiProgressState::Type | state () const |
| bb::system::SystemUiPosition::Type | position () const |
| SystemUiButton * | button () |
| bb::system::SystemUiModality::Type | modality () const |
| void | setBody (const QString &body) |
| void | setProgress (int newProgress) |
| void | setStatusMessage (const QString &newStatusMessage) |
| void | setState (bb::system::SystemUiProgressState::Type newProgressState) |
| void | setPosition (bb::system::SystemUiPosition::Type pos) |
| void | setModality (bb::system::SystemUiModality::Type newModality) |
| Q_INVOKABLE void | resetBody () |
| Q_INVOKABLE void | resetProgress () |
| Q_INVOKABLE void | resetStatusMessage () |
| Q_INVOKABLE void | resetState () |
| Q_INVOKABLE void | resetPosition () |
| Q_INVOKABLE void | resetButton () |
| Q_INVOKABLE void | resetModality () |
| bb::system::SystemUiResult::Type | result () const |
| bb::system::SystemUiError::Type | error () const |
| Q_INVOKABLE bb::system::SystemUiButton * | buttonSelection () const |
Public Slots Index
| void | show () |
| bb::system::SystemUiResult::Type | exec () |
| void | cancel () |
Signals Index
| void | finished (bb::system::SystemUiResult::Type value) |
| void | bodyChanged (const QString &value) |
| void | progressChanged (int newProgress) |
| void | statusMessageChanged (const QString &newStatusMessage) |
| void | stateChanged (bb::system::SystemUiProgressState::Type newState) |
| void | positionChanged (bb::system::SystemUiPosition::Type value) |
| void | modalityChanged (bb::system::SystemUiModality::Type newModality) |
Properties
QString
Represents the main text of the toast.
This is a presentation property whose default value is a default-constructed QString.
BlackBerry 10.0.0
int
Represents the progress of the task represented by the toast.
The range of values is [0-100], and -1 representing indefinite progress.
This is a presentation property whose default value is -1.
BlackBerry 10.0.0
QString
Represents the status message of the toast.
This is a presentation property whose default value is a default-constructed QString.
This property will be ignored if progress is indefinite, that is, -1.
BlackBerry 10.0.0
bb::system::SystemUiProgressState::Type
Represents the state of the task whose progress is represented by the toast.
bb::system::SystemUiProgressState for a list of possible values.
BlackBerry 10.0.0
bb::system::SystemUiPosition::Type
Represents the position of the toast on the display.
bb::system::SystemUiPosition for a list of possible values.
BlackBerry 10.0.0
bb::system::SystemUiModality::Type
Represents the modality of the toast.
bb::system::SystemUiModality for the list of valid values.
Toasts are non-modal. Modality refers to the scope of the toast.
BlackBerry 10.0.0
bb::system::SystemUiButton
Represents the button that can be included in the toast.
This is a presentation property whose default bb::system::SystemUiButton::label property is a default-constructed QString.
The button will always be shown as enabled. This button is omitted if its bb::system::SystemUiButton::label property is a default-constructed QString.
BlackBerry 10.0.0
bb::system::SystemUiResult::Type
Represents the result of the last completed request.
result() - the result of the request
error() - the error that occurred during the request (if applicable)
buttonSelection() - the button selected (if applicable)
bb::system::SystemUiResult for the list of possible results.
BlackBerry 10.0.0
bb::system::SystemUiError::Type
Represents the last error encountered.
This property is only valid when result is bb::system::SystemUiResult::Error.
BlackBerry 10.0.0
Public Functions
Constructs a new instance of a toast.
| Parameters | |
|---|---|
| parent |
If not 0, the supplied parent will be responsible for deleting this instance. |
BlackBerry 10.0.0
virtual
Destructor.
BlackBerry 10.0.0
QString
Retrieves the main text of the toast.
The text of the toast.
BlackBerry 10.0.0
int
Retrieves the progress of the toast.
The progress of the toast.
BlackBerry 10.0.0
QString
Retrieves the status message of the progress of the toast.
The status message of the toast.
BlackBerry 10.0.0
bb::system::SystemUiProgressState::Type
Retrieves the state of the progress of the task represented by the toast.
The progress state.
BlackBerry 10.0.0
bb::system::SystemUiPosition::Type
Retrieves the position of the toast.
The toast position.
BlackBerry 10.0.0
SystemUiButton *
Retrieves the toast's button.
The toast's button.
BlackBerry 10.0.0
bb::system::SystemUiModality::Type
Retrieves the toast's modality.
The toast's modality.
BlackBerry 10.0.0
void
Sets the main text of the toast.
| Parameters | |
|---|---|
| body |
The text of the toast. |
BlackBerry 10.0.0
void
Sets the progress of the toast.
| Parameters | |
|---|---|
| newProgress |
The progress of the toast. |
BlackBerry 10.0.0
void
Sets the status message for the progress of the task represented by the toast.
| Parameters | |
|---|---|
| newStatusMessage |
The status message of the progress of the toast. |
BlackBerry 10.0.0
void
Sets the state of progress of the toast.
| Parameters | |
|---|---|
| newProgressState |
The progress state of the toast. |
BlackBerry 10.0.0
void
Sets the position of the toast.
| Parameters | |
|---|---|
| pos |
The toast position. |
BlackBerry 10.0.0
void
Sets the modality for the toast.
| Parameters | |
|---|---|
| newModality |
The new modality preference. |
BlackBerry 10.0.0
Q_INVOKABLE void
Resets the main text of the toast to QString::null.
BlackBerry 10.0.0
Q_INVOKABLE void
Resets the progress of the toast to -1.
BlackBerry 10.0.0
Q_INVOKABLE void
Resets the progress status message of the toast to QString::null.
BlackBerry 10.0.0
Q_INVOKABLE void
Resets the progress state of the toast to bb::system::SystemUiProgressState::Active.
BlackBerry 10.0.0
Q_INVOKABLE void
Resets the position of the toast to bb::system::SystemUiPosition::MiddleCenter.
BlackBerry 10.0.0
Q_INVOKABLE void
Resets the button button for this toast to be a default button with no text.
A reset button will not be shown.
BlackBerry 10.0.0
Q_INVOKABLE void
Resets the modality of the toast to bb::system::SystemUiModality::Application.
BlackBerry 10.0.0
bb::system::SystemUiResult::Type
Retrieves the result of the last completed request.
The result of the last completed request.
BlackBerry 10.0.0
bb::system::SystemUiError::Type
Retrieves the error that occurred during the request.
The error that occurred.
BlackBerry 10.0.0
Q_INVOKABLE bb::system::SystemUiButton *
Returns the button that was selected when a button selection is made.
If no button has been selected, 0 will be returned. This can occur when the toast timeout expires.
This function returns the result of the button selection of show() and exec().
The return value will be reset when a new request is made.
The button selected.
BlackBerry 10.0.0
Public Slots
void
Displays or updates the toast based on current property values.
The result of the request can be retrieved with result, or using the signal finished. The button that was selected can be retrieved with buttonSelection().
Control is returned to the caller immediately. For a blocking request, use exec().
BlackBerry 10.0.0
bb::system::SystemUiResult::Type
Displays or updates the toast based on current property values.
The result of the request can be retrieved with result, or using the signal finished. The button that was selected can be retrieved with buttonSelection().
Unlike show(), this function will block until a button selection is made or the toast times out.
Any connections to this slot must use a Qt::QueuedConnection, or the slot must be triggered using QTimer::singleShot(), and
QObject::deleteLater() must be used in place of delete when deleting the dialog object. If these conditions are not met, unexpected behavior may result.
The result of the request.
BlackBerry 10.0.0
void
Cancels the toast if it is still displayed.
BlackBerry 10.0.0
Signals
void
Emitted when a request is completed.
| Parameters | |
|---|---|
| value |
The result of the request. See bb::system::SystemUiResult for the list of possible results. |
BlackBerry 10.0.0
void
Emitted when the body property is changed programmatically.
| Parameters | |
|---|---|
| value |
The new value of the body property. |
BlackBerry 10.0.0
void
Emitted when the progress property is changed programmatically.
| Parameters | |
|---|---|
| newProgress |
The new value of the progress property. |
BlackBerry 10.0.0
void
Emitted when the statusMessage property is changed programmatically.
| Parameters | |
|---|---|
| newStatusMessage |
The new value of the statusMessage property. |
BlackBerry 10.0.0
void
Emitted when the state property is changed programmatically.
| Parameters | |
|---|---|
| newState |
The new value of the state property. |
BlackBerry 10.0.0
void
Emitted when the position property is changed programmatically.
| Parameters | |
|---|---|
| value |
The new value of the position property. |
BlackBerry 10.0.0
void
Emitted when the modality property is changed programmatically.
| Parameters | |
|---|---|
| newModality |
The new value of the modality property. |
BlackBerry 10.0.0