Unity Scopes API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
unity::scopes::ActivationResponse Class Referencefinal

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)
 
ActivationResponseoperator= (ActivationResponse const &other)
 
ActivationResponseoperator= (ActivationResponse &&other)
 

Detailed Description

Response to a result activation.

Member Enumeration Documentation

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

Constructor & Destructor Documentation

unity::scopes::ActivationResponse::ActivationResponse ( Status  status)

Creates ActivationResponse with given status.

Parameters
statusThe activation status.
Exceptions
unity::InvalidArgumentExceptionif 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.

Parameters
queryThe search query to be executed by the client.

Member Function Documentation

CannedQuery unity::scopes::ActivationResponse::query ( ) const

A query to be executed if status is Status::PerformQuery.

Exceptions
unity::LogicExceptionif the status of this ActivationResponse is anything other than Status::PerformQuery.
Returns
The query to be executed by the client.
Variant unity::scopes::ActivationResponse::scope_data ( ) const

Get data attached to this response object.

Returns
The data attached to response.
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.

Parameters
dataarbitrary value attached to response
ActivationResponse::Status unity::scopes::ActivationResponse::status ( ) const

Get activation status.

Returns
The activation status.

The documentation for this class was generated from the following files: