unity.scopes.qt.QScopeBaseAPI

#include <unity/scopes/qt/QScopeBaseAPI.h>

Inheritance diagram for unity::scopes::qt::QScopeBaseAPI: src="https://assets.ubuntu.com/v1/4e70ca79-classunity_1_1scopes_1_1qt_1_1_q_scope_base_a_p_i__inherit__graph.png" border="0" alt="Inheritance graph"/>

Public Member Functions

virtual void start (std::string const &scope_id) override
 Called by the scopes run time after the create function completes. More...
 
virtual void stop () override
 Called by the scopes run time when the scope should shut down. More...
 
virtual unity::scopes::PreviewQueryBase::UPtr preview (const unity::scopes::Result &, const unity::scopes::ActionMetadata &) override
 
virtual unity::scopes::SearchQueryBase::UPtr search (unity::scopes::CannedQuery const &q, unity::scopes::SearchMetadata const &) override
 
src="https://assets.ubuntu.com/v1/c6607712-closed.png" alt="-"/> Public Member Functions inherited from unity::scopes::ScopeBase
virtual void run ()
 Called by the scopes runtime after it has called start() to hand a thread of control to the scope. More...
 
virtual ActivationQueryBase::UPtr activate (Result const &result, ActionMetadata const &metadata)
 Called by the scopes runtime when a scope needs to respond to a result activation request. More...
 
virtual ActivationQueryBase::UPtr perform_action (Result const &result, ActionMetadata const &metadata, std::string const &widget_id, std::string const &action_id)
 Invoked when a scope is requested to handle a preview action. More...
 
virtual std::string scope_directory () const final
 Returns the directory that stores the scope's configuration files and shared library. More...
 
virtual std::string cache_directory () const final
 Returns a directory that is (exclusively) writable for the scope. More...
 
virtual std::string app_directory () const final
 Returns a directory that is shared with an app in the same click package. More...
 
virtual std::string tmp_directory () const final
 Returns a tmp directory that is (exclusively) writable for the scope. More...
 
virtual unity::scopes::RegistryProxy registry () const final
 Returns the proxy to the registry. More...
 
virtual VariantMap settings () const final
 Returns a dictionary with the scope's current settings. More...
 
virtual ChildScopeList find_child_scopes () const
 Returns a defaulted list of child scopes aggregated by this scope. More...
 
virtual ChildScopeList child_scopes () const final
 Returns the current list of child scopes aggregated by this scope. More...
 
virtual ActivationQueryBase::UPtr activate_result_action (Result const &result, ActionMetadata const &metadata, std::string const &action_id)
 Invoked when a scope is requested to handle a result in-card action. More...
 

Additional Inherited Members

src="https://assets.ubuntu.com/v1/c6607712-closed.png" alt="-"/> Static Public Member Functions inherited from unity::scopes::ScopeBase
static void runtime_version (int &v_major, int &v_minor, int &v_micro) noexcept
 Returns the version information for the scopes API that the scope was linked with.
 

Detailed Description

Defines the lifecycle of scope plugin, and acts as a factory for Query and Preview objects.

Member Function Documentation

virtual unity::scopes::PreviewQueryBase::UPtr unity::scopes::qt::QScopeBaseAPI::preview ( const unity::scopes::Result ,
const unity::scopes::ActionMetadata  
)
overridevirtual

Called each time a new preview is requested

Implements unity::scopes::ScopeBase.

virtual unity::scopes::SearchQueryBase::UPtr unity::scopes::qt::QScopeBaseAPI::search ( unity::scopes::CannedQuery const &  q,
unity::scopes::SearchMetadata const &   
)
overridevirtual

Called each time a new query is requested

Implements unity::scopes::ScopeBase.

virtual void unity::scopes::qt::QScopeBaseAPI::start ( std::string const &  scope_id)
overridevirtual

Called by the scopes run time after the create function completes.

If start() throws an exception, stop() will not be called.

The call to start() is made by the same thread that calls the create function.

Parameters
scope_idThe name of the scope as defined by the scope's configuration file.

Reimplemented from unity::scopes::ScopeBase.

virtual void unity::scopes::qt::QScopeBaseAPI::stop ( )
overridevirtual

Called by the scopes run time when the scope should shut down.

A scope should deallocate as many resources as possible when stop() is called, for example, deallocate any caches and close network connections. In addition, if the scope implements run() and did not return from run(), it must return from run() in response to the call to stop().

Exceptions from stop() are ignored.

The call to stop() is made by the same thread that calls the create function and start().

Reimplemented from unity::scopes::ScopeBase.