unity.scopes.FilterBase

Base class for all implementations of filters. More...

#include <unity/scopes/FilterBase.h>

Inheritance diagram for unity::scopes::FilterBase: src="https://assets.ubuntu.com/v1/fa878124-classunity_1_1scopes_1_1_filter_base__inherit__graph.png" border="0" alt="Inheritance graph"/>

Public Types

enum  DisplayHints { Default = 0, Primary = 1 }
 Display hints for the Shell UI. More...
 

Public Member Functions

void set_display_hints (int hints)
 Sets display hints for the Shell UI. More...
 
int display_hints () const
 Get display hints of this filter. More...
 
std::string id () const
 Get the identifier of this filter. More...
 
std::string filter_type () const
 Get the type name of this filter. More...
 
void set_title (std::string const &title)
 Set an optional title of this filter. More...
 
std::string title () const
 Get the optional title of this filter. More...
 
FilterGroup::SCPtr filter_group () const
 Get the filter group this filter belongs to. More...
 

Detailed Description

Base class for all implementations of filters.

All implementations of FilterBase define the "look" of a filter in the UI and do not hold any state information. The actual state of a filters is kept by a FilterState object.

Member Enumeration Documentation

enum unity::scopes::FilterBase::DisplayHints

Display hints for the Shell UI.

Enumerator
Default 

Default value (no hint)

Primary 

Display this filter as a primary navigation, if possible. Currently only the OptionSelectorFilter can act as primary navigation.

Member Function Documentation

int unity::scopes::FilterBase::display_hints ( ) const

Get display hints of this filter.

Returns
Display hints flags.
FilterGroup::SCPtr unity::scopes::FilterBase::filter_group ( ) const

Get the filter group this filter belongs to.

Returns
The filter group (or null)
std::string unity::scopes::FilterBase::filter_type ( ) const

Get the type name of this filter.

Returns
The filter type string.
std::string unity::scopes::FilterBase::id ( ) const

Get the identifier of this filter.

Returns
The filter id.
void unity::scopes::FilterBase::set_display_hints ( int  hints)

Sets display hints for the Shell UI.

Parameters
hintsA combination of DisplayHints for this filter.
Exceptions
unity::InvalidArgumentExceptionif given hints value is unsupported by current filter type.
void unity::scopes::FilterBase::set_title ( std::string const &  title)

Set an optional title of this filter.

Parameters
titleThe title.
std::string unity::scopes::FilterBase::title ( ) const

Get the optional title of this filter.

Returns
Filter title (can be empty).