Unity Scopes API
|
Response to a result activation. More...
#include <unity/scopes/ActivationResponse.h>
Public Types | |
enum | Status { NotHandled, ShowDash, HideDash, ShowPreview, PerformQuery } |
Status of a unity::scopes::ScopeBase::activate or unity::scopes::ScopeBase::perform_action request. More... | |
Public Member Functions | |
ActivationResponse (Status status) | |
Creates ActivationResponse with given status. More... | |
ActivationResponse (CannedQuery const &query) | |
Creates an ActivationResponse with status Status::PerformQuery and a search query to be executed. More... | |
ActivationResponse::Status | status () const |
Get activation status. More... | |
void | set_scope_data (Variant const &data) |
Attach arbitrary data to this response. More... | |
Variant | scope_data () const |
Get data attached to this response object. More... | |
CannedQuery | query () const |
A query to be executed if status is Status::PerformQuery. More... | |
Copy and assignment | |
Copy and assignment operators (move and non-move versions) have the usual value semantics. | |
ActivationResponse (ActivationResponse const &other) | |
ActivationResponse (ActivationResponse &&other) | |
ActivationResponse & | operator= (ActivationResponse const &other) |
ActivationResponse & | operator= (ActivationResponse &&other) |
Response to a result activation.
Status of a unity::scopes::ScopeBase::activate or unity::scopes::ScopeBase::perform_action request.
Enumerator | |
---|---|
NotHandled |
Activation of this result wasn't handled by the scope |
ShowDash |
Activation of this result was handled, show the Dash |
HideDash |
Activation of this result was handled, hide the Dash |
ShowPreview |
Preview should be requested for this result |
PerformQuery |
Perform new search. This state is implied if creating ActivationResponse with CannedQuery object and is invalid otherwise |
unity::scopes::ActivationResponse::ActivationResponse | ( | Status | status | ) |
Creates ActivationResponse with given status.
status | The activation status. |
unity::InvalidArgumentException | if status is Status::PerformQuery. To create an ActivationResponse of that type, use the ActivationResponse(CannedQuery const&) constructor. |
unity::scopes::ActivationResponse::ActivationResponse | ( | CannedQuery const & | query | ) |
Creates an ActivationResponse with status Status::PerformQuery and a search query to be executed.
query | The search query to be executed by the client. |
CannedQuery unity::scopes::ActivationResponse::query | ( | ) | const |
A query to be executed if status is Status::PerformQuery.
unity::LogicException | if the status of this ActivationResponse is anything other than Status::PerformQuery. |
Variant unity::scopes::ActivationResponse::scope_data | ( | ) | const |
Get data attached to this response object.
void unity::scopes::ActivationResponse::set_scope_data | ( | Variant const & | data | ) |
Attach arbitrary data to this response.
The attached data is sent back to the scope if the status of this response is Status::ShowPreview.
data | arbitrary value attached to response |
ActivationResponse::Status unity::scopes::ActivationResponse::status | ( | ) | const |
Get activation status.