A range filter which allows a start and end value to be entered by user, and any of them is optional.
More...
#include <unity/scopes/RangeInputFilter.h>
A range filter which allows a start and end value to be entered by user, and any of them is optional.
RangeInputFilter::SPtr unity::scopes::RangeInputFilter::create |
( |
std::string const & |
id, |
|
|
std::string const & |
start_label, |
|
|
std::string const & |
end_label, |
|
|
std::string const & |
unit_label = "" |
|
) |
| |
|
static |
Creates a RangeInputFilter.
- Parameters
-
id | A unique identifier for the filter that can be used to identify it later among several filters. |
start_label | A display label for the input box of start value (can be empty). |
end_label | A display label for the input box of end value (can be empty). |
unit_label | A display label for the unit of this range filter (e.g. currency name). |
- Returns
- Instance of RangeInputFilter.
std::string unity::scopes::RangeInputFilter::end_label |
( |
| ) |
const |
Get the label of end value.
- Returns
- The label of end value.
double unity::scopes::RangeInputFilter::end_value |
( |
FilterState const & |
filter_state | ) |
const |
Get end value for this filter instance.
- Returns
- end value
- Exceptions
-
unity::LogicException | if end value is not set |
bool unity::scopes::RangeInputFilter::has_end_value |
( |
FilterState const & |
filter_state | ) |
const |
Check if filter state holds an end value for this filter instance.
- Parameters
-
filter_state | The state of filters. |
- Returns
- true if filter_state has an end value for this filter.
bool unity::scopes::RangeInputFilter::has_start_value |
( |
FilterState const & |
filter_state | ) |
const |
Check if filter state holds a start value for this filter instance.
- Parameters
-
filter_state | The state of filters. |
- Returns
- true if filter_state has a start value for this filter.
std::string unity::scopes::RangeInputFilter::start_label |
( |
| ) |
const |
Get the label of start value.
- Returns
- The label of start value.
double unity::scopes::RangeInputFilter::start_value |
( |
FilterState const & |
filter_state | ) |
const |
Get start value for this filter instance.
- Returns
- start value
- Exceptions
-
unity::LogicException | if start value is not set |
std::string unity::scopes::RangeInputFilter::unit_label |
( |
| ) |
const |
Get the label of unit for this filter..
- Returns
- The label of unit.
void unity::scopes::RangeInputFilter::update_state |
( |
FilterState & |
filter_state, |
|
|
Variant const & |
start_value, |
|
|
Variant const & |
end_value |
|
) |
| const |
Store start and end value for this filter in the filter state.
Updates filter_state with start and end values for this filter instance. Allowed data types for start_value and end_value are Variant::Type::Null, Variant::Type::Double and Variant::Type::Int. Integer values will get converted to double when returned via unity::scopes::RangeInputFilter::start_value() and unity::scopes::RangeInputFilter::end_value() methods. Pass Variant::null() as start_value or end_value if that value is unspecified (hasn't been entered or got erased by the user from the input box).
- Parameters
-
filter_state | FilterState instance to update |
start_value | Start value |
end_value | End value |
void unity::scopes::RangeInputFilter::update_state |
( |
FilterState & |
filter_state, |
|
|
std::string const & |
filter_id, |
|
|
Variant const & |
start_value, |
|
|
Variant const & |
end_value |
|
) |
| |
|
static |
Store start and end value in the filter state, without having an instance of RangeInputFilter.
Updates filter_state with start and end values without an instance of RangeInputFilter. This is meant for the explanation of this method. to be used when creating a CannedQuery that points to a foreign scope.
See the documentation of unity::scopes::update_state(FilterState const& filter_state, Variant const& start_value, Variant const& end_value)
- Parameters
-
filter_state | FilterState instance to update |
filter_id | Unique identifier of filter |
start_value | Start value |
end_value | End value |
The documentation for this class was generated from the following files: