unity.scopes.Scope

Allows queries, preview requests, and activation requests to be sent to a scope. More...

#include <unity/scopes/Scope.h>

Inheritance diagram for unity::scopes::Scope: src="https://assets.ubuntu.com/v1/70caa136-classunity_1_1scopes_1_1_scope__inherit__graph.png" border="0" alt="Inheritance graph"/>

Public Member Functions

virtual QueryCtrlProxy search (std::string const &query_string, SearchMetadata const &metadata, SearchListenerBase::SPtr const &reply)=0
 Initiates a search query. More...
 
virtual QueryCtrlProxy search (std::string const &query_string, FilterState const &filter_state, SearchMetadata const &metadata, SearchListenerBase::SPtr const &reply)=0
 Initiates a search query (overloaded method). More...
 
virtual QueryCtrlProxy search (std::string const &query_string, std::string const &department_id, FilterState const &filter_state, SearchMetadata const &metadata, SearchListenerBase::SPtr const &reply)=0
 Initiates a search query (overloaded method). More...
 
virtual QueryCtrlProxy activate (Result const &result, ActionMetadata const &metadata, ActivationListenerBase::SPtr const &reply)=0
 Initiates activation of a search result. More...
 
virtual QueryCtrlProxy perform_action (Result const &result, ActionMetadata const &metadata, std::string const &widget_id, std::string const &action_id, ActivationListenerBase::SPtr const &reply)=0
 Initiates activation of a preview action. More...
 
virtual QueryCtrlProxy preview (Result const &result, ActionMetadata const &metadata, PreviewListenerBase::SPtr const &reply)=0
 Initiates preview request. More...
 
virtual ~Scope ()
 Destroys a Scope. More...
 
virtual ChildScopeList child_scopes ()=0
 Returns a list of child scopes aggregated by this scope. More...
 
virtual bool set_child_scopes (ChildScopeList const &child_scopes)=0
 Sets the list of child scopes aggregated by this scope. More...
 
virtual QueryCtrlProxy search (std::string const &query_string, std::string const &department_id, FilterState const &filter_state, Variant const &user_data, SearchMetadata const &metadata, SearchListenerBase::SPtr const &reply)=0
 Initiates a search query (overloaded method). More...
 
virtual QueryCtrlProxy activate_result_action (Result const &result, ActionMetadata const &metadata, std::string const &action_id, ActivationListenerBase::SPtr const &reply)=0
 Initiates activation of a result (in-card) action. More...
 
src="https://assets.ubuntu.com/v1/c6607712-closed.png" alt="-"/> Public Member Functions inherited from unity::scopes::Object
virtual std::string endpoint ()=0
 Returns the endpoint this proxy connects to. More...
 
virtual std::string identity ()=0
 Returns the identity of the target object of this proxy. More...
 
virtual std::string target_category ()=0
 Returns the category of the target object of this proxy. More...
 
virtual int64_t timeout ()=0
 Returns the timeout in milliseconds if this proxy is a twoway proxy. More...
 
virtual std::string to_string ()=0
 Converts a proxy into its string representation. More...
 

Detailed Description

Allows queries, preview requests, and activation requests to be sent to a scope.

Constructor & Destructor Documentation

virtual unity::scopes::Scope::~Scope ( )
virtual

Destroys a Scope.

Destroying a Scope has no effect on any query that might still be in progress.

Member Function Documentation

virtual QueryCtrlProxy unity::scopes::Scope::activate ( Result const &  result,
ActionMetadata const &  metadata,
ActivationListenerBase::SPtr const &  reply 
)
pure virtual

Initiates activation of a search result.

Parameters
resultThe result that was activated.
metadataAdditional data to pass to the scope.
replyThe callback object to receive replies
Returns
A proxy that permits cancellation of this request.
virtual QueryCtrlProxy unity::scopes::Scope::activate_result_action ( Result const &  result,
ActionMetadata const &  metadata,
std::string const &  action_id,
ActivationListenerBase::SPtr const &  reply 
)
pure virtual

Initiates activation of a result (in-card) action.

Parameters
resultThe result that was was activated.
metadataAdditional data to pass to the scope.
action_idThe identifier of the action.
replyThe callback object to receive replies
Returns
A proxy that permits cancellation of this request.
virtual ChildScopeList unity::scopes::Scope::child_scopes ( )
pure virtual

Returns a list of child scopes aggregated by this scope.

Returns
The list of child scopes aggregated by this scope.
virtual QueryCtrlProxy unity::scopes::Scope::perform_action ( Result const &  result,
ActionMetadata const &  metadata,
std::string const &  widget_id,
std::string const &  action_id,
ActivationListenerBase::SPtr const &  reply 
)
pure virtual

Initiates activation of a preview action.

Parameters
resultThe result that was previewed.
metadataAdditional data to pass to the scope.
widget_idThe identifier of the 'actions' widget of the activated action.
action_idThe identifier of an action to activate.
replyThe callback object to receive replies
Returns
A proxy that permits cancellation of this request.
virtual QueryCtrlProxy unity::scopes::Scope::preview ( Result const &  result,
ActionMetadata const &  metadata,
PreviewListenerBase::SPtr const &  reply 
)
pure virtual

Initiates preview request.

Parameters
resultThe result to be previewed.
metadataAdditional data to pass to the scope.
replyThe callback object to receive replies.
Returns
A proxy that permits cancellation of this request.
virtual QueryCtrlProxy unity::scopes::Scope::search ( std::string const &  query_string,
SearchMetadata const &  metadata,
SearchListenerBase::SPtr const &  reply 
)
pure virtual

Initiates a search query.

The search() method expects a SearchListenerBase, which it uses to return the results for the query. search() may block for some time, for example, if the target scope is not running and needs to be started first. Results for the query may begin to arrive only after search() completes (but may also arrive while search() is still running).

Parameters
query_stringThe search string.
metadataAdditional data to pass to the scope.
replyThe callback object to receive replies.
Returns
A proxy that permits cancellation of this request.
virtual QueryCtrlProxy unity::scopes::Scope::search ( std::string const &  query_string,
FilterState const &  filter_state,
SearchMetadata const &  metadata,
SearchListenerBase::SPtr const &  reply 
)
pure virtual

Initiates a search query (overloaded method).

This method has same synopsis as previous method, but it takes additional unity::scopes::FilterState argument.

Parameters
query_stringThe search string.
filter_stateThe state of filters.
metadataAdditional data to pass to the scope.
replyThe callback object to receive replies.
Returns
A proxy that permits cancellation of this request.
virtual QueryCtrlProxy unity::scopes::Scope::search ( std::string const &  query_string,
std::string const &  department_id,
FilterState const &  filter_state,
SearchMetadata const &  metadata,
SearchListenerBase::SPtr const &  reply 
)
pure virtual

Initiates a search query (overloaded method).

This method has same synopsis as previous method, but it takes additional department identifier argument.

Parameters
query_stringThe search string.
department_idThe identifier of a department to search.
filter_stateThe state of filters.
metadataAdditional data to pass to the scope.
replyThe callback object to receive replies.
Returns
A proxy that permits cancellation of this request.
virtual QueryCtrlProxy unity::scopes::Scope::search ( std::string const &  query_string,
std::string const &  department_id,
FilterState const &  filter_state,
Variant const &  user_data,
SearchMetadata const &  metadata,
SearchListenerBase::SPtr const &  reply 
)
pure virtual

Initiates a search query (overloaded method).

This method has same synopsis as previous search method, but it takes additional user_data argument.

Parameters
query_stringThe search string.
department_idThe identifier of a department to search.
filter_stateThe state of filters.
user_dataArbitrary data.
metadataAdditional data to pass to the scope.
replyThe callback object to receive replies
Returns
A proxy that permits cancellation of this request.
virtual bool unity::scopes::Scope::set_child_scopes ( ChildScopeList const &  child_scopes)
pure virtual

Sets the list of child scopes aggregated by this scope.

Note
The only time this call will return false is if the scope cannot write to its config directory. This should not happen in real-world usage, but if it does, check the log for more detail.
Parameters
child_scopesThe list of child scopes aggregated by this scope.
Returns
True if the list was successfully set.