Unity Scopes API
|
Base class for a scope implementation. More...
#include <unity/scopes/qt/QScopeBase.h>
Public Member Functions | |
virtual void | start (QString const &) |
virtual void | stop () |
virtual QPreviewQueryBase::UPtr | preview (const QResult &, const QActionMetadata &)=0 |
virtual QSearchQueryBase::UPtr | search (unity::scopes::CannedQuery const &q, unity::scopes::SearchMetadata const &)=0 |
Base class for a scope implementation.
Scopes are accessed by the scopes run time as a shared library (one library per scope). Each scope must implement a class that derives from QScopeBase, for example:
In addition, the library must provide two functions with "C" linkage:
If the create function throws an exception, the destroy function will not be called. If the create function returns NULL, the destroy function will be called with NULL as its argument.
Rather than hard-coding the names of the functions, use the UNITY_SCOPE_CREATE_FUNCTION and UNITY_SCOPE_DESTROY_FUNCTION macros, for example:
After the scopes run time has obtained a pointer to the class instance from the create function, it calls start(), which allows the scope to initialize itself.
|
pure virtual |
Called each time a new preview is requested
|
pure virtual |
Called each time a new query is requested
|
virtual |
Called once at startup
|
virtual |
Called at shutdown