ActivationQueryBase

Base class for an activation request that is executed inside a scope. More...

#include <unity/scopes/ActivationQueryBase.h>

Inheritance diagram for unity::scopes::ActivationQueryBase:
Inheritance graph
[legend]

Public Member Functions

 ActivationQueryBase (Result const &result, ActionMetadata const &metadata)
 Create ActivationQueryBase. More...
 
 ActivationQueryBase (Result const &result, ActionMetadata const &metadata, std::string const &widget_id, std::string const &action_id)
 Create ActivationQueryBase. More...
 
 ActivationQueryBase (Result const &update_result, ActionMetadata const &metadata, std::string const &action_id)
 Create ActivationQueryBase. More...
 
virtual void cancelled () override
 Called when the originator of the activation request cancelled it.
 
virtual ActivationResponse activate ()
 Return response to the activation request. More...
 
Result result () const
 Get the result for this activation request handler. More...
 
ActionMetadata action_metadata () const
 Get the metadata for this activation request handler. More...
 
std::string widget_id () const
 Get the widget identifier for this activation request handler. More...
 
std::string action_id () const
 Get the action identifier for this activation request handler. More...
 
- Public Member Functions inherited from unity::scopes::QueryBase
bool valid () const
 Check whether this query is still valid. More...
 
unity::scopes::VariantMap settings () const
 Returns a dictionary with the scope's current settings. More...
 

Detailed Description

Base class for an activation request that is executed inside a scope.

The default implementation responds with ActivationResponse(ActivationResponse::Status::NotHandled). Reimplement this class and return an instance from ScopeBase::activate method for custom activation handling.

Constructor & Destructor Documentation

unity::scopes::ActivationQueryBase::ActivationQueryBase ( Result const &  result,
ActionMetadata const &  metadata 
)

Create ActivationQueryBase.

Parameters
resultThe result received by ScopeBase::activate().
metadataThe metadata received by ScopeBase::activate().
unity::scopes::ActivationQueryBase::ActivationQueryBase ( Result const &  result,
ActionMetadata const &  metadata,
std::string const &  widget_id,
std::string const &  action_id 
)

Create ActivationQueryBase.

Parameters
resultThe result received by ScopeBase::perform_action().
metadataThe metadata received by ScopeBase::perform_action().
widget_idThe widget identifier receiver of ScopeBase::perform_action().
action_idThe action identifier receiver of ScopeBase::perform_action().
unity::scopes::ActivationQueryBase::ActivationQueryBase ( Result const &  update_result,
ActionMetadata const &  metadata,
std::string const &  action_id 
)

Create ActivationQueryBase.

Parameters
update_resultThe result received by ScopeBase::activate_result_action().
metadataThe metadata received by ScopeBase::activate_result_action().
action_idThe action identifier received by ScopeBase::activate_result_action().

Member Function Documentation

std::string unity::scopes::ActivationQueryBase::action_id ( ) const

Get the action identifier for this activation request handler.

Action identifier is empty when using the unity::scopes::ActivationQueryBase(Result const& result, ActionMetadata const& metadata) constructor.

Returns
The action identifier passed to the constructor of this object.
ActionMetadata unity::scopes::ActivationQueryBase::action_metadata ( ) const

Get the metadata for this activation request handler.

Returns
The metadata passed to the constructor of this object.
ActivationResponse unity::scopes::ActivationQueryBase::activate ( )
virtual

Return response to the activation request.

The response is received by the originator of the request. Default implementation returns ActivationResponse(ActivationResponse::Status::NotHandled.

Returns
The response to the activation request.
Result unity::scopes::ActivationQueryBase::result ( ) const

Get the result for this activation request handler.

Returns
The result passed to the constructor of this object.
std::string unity::scopes::ActivationQueryBase::widget_id ( ) const

Get the widget identifier for this activation request handler.

Widget identifier is empty when using the unity::scopes::ActivationQueryBase(Result const& result, ActionMetadata const& metadata) constructor.

Returns
The widget identifier passed to the constructor of this object.