Unity Scopes API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
unity::scopes::CannedQuery Class Referencefinal

Parameters of a search query. More...

#include <unity/scopes/CannedQuery.h>

Public Member Functions

 CannedQuery (std::string const &scope_id)
 Creates a query for given scope with empty query string.
 
 CannedQuery (std::string const &scope_id, std::string const &query_str, std::string const &department_id)
 Creates a query for given scope with specific query string and in given department.
 
void set_department_id (std::string const &dep_id)
 Sets or updates the department.
 
void set_query_string (std::string const &query_str)
 Sets or updates the query string.
 
void set_filter_state (FilterState const &filter_state)
 Sets filter state.
 
std::string scope_id () const
 Returns the scope identifier of this CannedQuery. More...
 
std::string department_id () const
 Returns the department id of this CannedQuery. More...
 
std::string query_string () const
 Returns the query string of this CannedQuery. More...
 
std::string to_string () const
 Returns a string representation of this CannedQuery object as a URI using scope:// schema. More...
 
FilterState filter_state () const
 Get state of the filters for this CannedQuery. More...
 
Copy and assignment

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

 CannedQuery (CannedQuery const &other)
 
 CannedQuery (CannedQuery &&)
 
CannedQueryoperator= (CannedQuery const &other)
 
CannedQueryoperator= (CannedQuery &&)
 

Static Public Member Functions

static CannedQuery from_string ()
 Recreates a CannedQuery object from a scope:// URI. More...
 

Detailed Description

Parameters of a search query.

Holds all parameters of a search query: the target scope id, query string, department id, and state of the filters. Can be converted to/from scope:// uri schema string.

Member Function Documentation

std::string unity::scopes::CannedQuery::department_id ( ) const

Returns the department id of this CannedQuery.

Returns
The department id.
FilterState unity::scopes::CannedQuery::filter_state ( ) const

Get state of the filters for this CannedQuery.

Pass this state to methods of specific filter instances (such as unity::scopes::OptionSelectorFilter::active_options())to examine filter state.

Returns
The state of the filters.
CannedQuery unity::scopes::CannedQuery::from_string ( )
static

Recreates a CannedQuery object from a scope:// URI.

Returns
a CannedQuery instance
Exceptions
InvalidArgumentExceptionif the URI cannot be parsed.
std::string unity::scopes::CannedQuery::query_string ( ) const

Returns the query string of this CannedQuery.

Returns
The query string.
std::string unity::scopes::CannedQuery::scope_id ( ) const

Returns the scope identifier of this CannedQuery.

Returns
The scope identifier.
std::string unity::scopes::CannedQuery::to_string ( ) const

Returns a string representation of this CannedQuery object as a URI using scope:// schema.

Returns
The URI for the query.

The documentation for this class was generated from the following files: