unity.scopes.ScopeMetadata

Holds scope attributes such as name, description, icon etc. More...

#include <unity/scopes/ScopeMetadata.h>

Public Types

enum  ResultsTtlType { None, Small, Medium, Large }
 Enum representing the expected valid lifetime of results from the scope.
 

Public Member Functions

std::string scope_id () const
 Get the scope identifier. More...
 
ScopeProxy proxy () const
 Get the proxy object for this scope. More...
 
std::string display_name () const
 Get the display name for this scope. More...
 
std::string description () const
 Get the description for this scope. More...
 
std::string author () const
 Get the author for this scope. More...
 
std::string art () const
 Get the art for this scope. More...
 
std::string icon () const
 Get the icon for this scope. More...
 
std::string search_hint () const
 Get the search hint for this scope. More...
 
std::string hot_key () const
 Get the hot key for this scope. More...
 
bool invisible () const
 Check if this scope should be hidden in the Dash. More...
 
VariantMap appearance_attributes () const
 Get optional display attributes. More...
 
std::string scope_directory () const
 Get directory where scope config files and .so file lives. More...
 
VariantMap serialize () const
 Return a dictionary of all metadata attributes. More...
 
ResultsTtlType results_ttl_type () const
 Return the TTL for the results this scope produces. More...
 
VariantArray settings_definitions () const
 Return the settings definitions for this scope. More...
 
bool location_data_needed () const
 Check if this scope wants location data. More...
 
std::vector< std::string > child_scope_ids () const
 Return the list of scope identifiers aggregated by this scope. More...
 
int version () const
 Return the version of the scope. More...
 
std::set< std::string > keywords () const
 Return the set of keywords specified by this scope. More...
 
bool is_aggregator () const
 Check if this scope is an aggregator. More...
 
Copy and assignment

Copy and assignment operators (move and non-move versions) have the usual value semantics.

 ScopeMetadata (ScopeMetadata const &other)
 
 ScopeMetadata (ScopeMetadata &&)
 
ScopeMetadataoperator= (ScopeMetadata const &other)
 
ScopeMetadataoperator= (ScopeMetadata &&)
 

Detailed Description

Holds scope attributes such as name, description, icon etc.

The information stored by ScopeMetadata comes from the .ini file for the given scope (for local scopes) or is fetched from the remote server (for scopes running on Smart Scopes Server). Use unity::scopes::Registry to get the metadata for a specific scope or all scopes.

Member Function Documentation

VariantMap unity::scopes::ScopeMetadata::appearance_attributes ( ) const

Get optional display attributes.

Appearance attributes define customized look of the scope in Scopes Scope.

Returns
Map of attributes (may be empty)
std::string unity::scopes::ScopeMetadata::art ( ) const

Get the art for this scope.

Returns
The scope art.
std::string unity::scopes::ScopeMetadata::author ( ) const

Get the author for this scope.

Returns
The scope author.
std::vector<std::string> unity::scopes::ScopeMetadata::child_scope_ids ( ) const

Return the list of scope identifiers aggregated by this scope.

The list returned by this method comes from the .ini file. The scope author must ensure that it contains all scopes that an aggregator might collect results from. This list may contain scopes that are not currently installed and are optional for proper functioning of the aggregator scope.

Returns
The list of scopes ids aggregated by this scope.
std::string unity::scopes::ScopeMetadata::description ( ) const

Get the description for this scope.

Returns
The scope description.
std::string unity::scopes::ScopeMetadata::display_name ( ) const

Get the display name for this scope.

Returns
The scope display name.
std::string unity::scopes::ScopeMetadata::hot_key ( ) const

Get the hot key for this scope.

Returns
The hot key.
std::string unity::scopes::ScopeMetadata::icon ( ) const

Get the icon for this scope.

Returns
The scope icon.
bool unity::scopes::ScopeMetadata::invisible ( ) const

Check if this scope should be hidden in the Dash.

Returns
True if this scope is invisible.
bool unity::scopes::ScopeMetadata::is_aggregator ( ) const

Check if this scope is an aggregator.

Returns
True if this scope is an aggregator.
std::set<std::string> unity::scopes::ScopeMetadata::keywords ( ) const

Return the set of keywords specified by this scope.

The set returned by this method is formulated from the value specified under the "Keywords" key in the scope's .ini file.

Returns
The set of keywords specified by this scope.
bool unity::scopes::ScopeMetadata::location_data_needed ( ) const

Check if this scope wants location data.

Returns
True if this scope wants location data.
ScopeProxy unity::scopes::ScopeMetadata::proxy ( ) const

Get the proxy object for this scope.

Returns
The scope proxy.
ResultsTtlType unity::scopes::ScopeMetadata::results_ttl_type ( ) const

Return the TTL for the results this scope produces.

Returns
Enum of timeout type.
std::string unity::scopes::ScopeMetadata::scope_directory ( ) const

Get directory where scope config files and .so file lives.

Note that the directory is not set for remote scopes; in such case this method throws unity::scopes::NotFoundException.

Exceptions
unity::scopes::NotFoundExceptionif directory is not set
Returns
path string
std::string unity::scopes::ScopeMetadata::scope_id ( ) const

Get the scope identifier.

Returns
The ID of the scope.
std::string unity::scopes::ScopeMetadata::search_hint ( ) const

Get the search hint for this scope.

Returns
The search hint.
VariantMap unity::scopes::ScopeMetadata::serialize ( ) const

Return a dictionary of all metadata attributes.

Returns
Dictionary of all metadata attributes.
VariantArray unity::scopes::ScopeMetadata::settings_definitions ( ) const

Return the settings definitions for this scope.

Returns
The settings definition as a VariantArray. The array contains the definition of the settings in their original order.
Exceptions
unity::scopes::NotFoundExceptionif the scope has no settings
See also
TBD TODO
int unity::scopes::ScopeMetadata::version ( ) const

Return the version of the scope.

Returns
The version or, if the scope does not define its version, the value 0.

  翻译: