A selection filter that displays a list of choices and allows one or more of them to be selected.
More...
#include <unity/scopes/OptionSelectorFilter.h>
A selection filter that displays a list of choices and allows one or more of them to be selected.
std::set< FilterOption::SCPtr > unity::scopes::OptionSelectorFilter::active_options |
( |
FilterState const & |
filter_state | ) |
const |
Get active options from an instance of FilterState for this filter.
- Returns
- The set of selected filter options.
FilterOption::SCPtr unity::scopes::OptionSelectorFilter::add_option |
( |
std::string const & |
id, |
|
|
std::string const & |
label |
|
) |
| |
Add a new option to this filter.
- Returns
- The new option instance.
OptionSelectorFilter::UPtr unity::scopes::OptionSelectorFilter::create |
( |
std::string const & |
id, |
|
|
std::string const & |
label, |
|
|
bool |
multi_select = false |
|
) |
| |
|
static |
Creates an OpionSelectorFilter.
- Parameters
-
id | A unique identifier for the filter that can be used to identify it later among several filters. |
label | A display label for the filter. |
multi_select | If true, the filter permits more than option to be selected; otherwise, only a single option can be selected. |
bool unity::scopes::OptionSelectorFilter::has_active_option |
( |
FilterState const & |
filter_state | ) |
const |
Check if an option is active for this filter.
- Parameters
-
filter_state | The state of filters |
- Returns
- true if an option is active
std::string unity::scopes::OptionSelectorFilter::label |
( |
| ) |
const |
Get the label of this filter.
- Returns
- The filter label.
bool unity::scopes::OptionSelectorFilter::multi_select |
( |
| ) |
const |
Check if this filter supports multiple options to be selected.
- Returns
- True if multi-selection is enabled.
std::list< FilterOption::SCPtr > unity::scopes::OptionSelectorFilter::options |
( |
| ) |
const |
Get all options of this filter, in the order they were added.
- Returns
- The list of options.
void unity::scopes::OptionSelectorFilter::update_state |
( |
FilterState & |
filter_state, |
|
|
FilterOption::SCPtr |
option, |
|
|
bool |
active |
|
) |
| const |
Marks given FilterOption of this filter instance as active (or not active) in a FilterState object.
Records the given FilterOption as "selected" in the FilterState. This is meant to be used to modify a FilterState received with a search request before sending it back to the client (UI shell).
void unity::scopes::OptionSelectorFilter::update_state |
( |
FilterState & |
filter_state, |
|
|
std::string const & |
filter_id, |
|
|
std::string const & |
option_id, |
|
|
bool |
value |
|
) |
| |
|
static |
The documentation for this class was generated from the following files: