GnuCash
5.6-150-g038405b370+
|
Multichoice options have a vector of valid options (GncMultichoiceOptionChoices) and validate the selection as being one of those values. More...
#include <gnc-option-impl.hpp>
Public Member Functions | |
GncOptionMultichoiceValue (const char *section, const char *name, const char *key, const char *doc_string, const char *value, GncMultichoiceOptionChoices &&choices, GncOptionUIType ui_type=GncOptionUIType::MULTICHOICE) | |
GncOptionMultichoiceValue (const char *section, const char *name, const char *key, const char *doc_string, uint16_t index, GncMultichoiceOptionChoices &&choices, GncOptionUIType ui_type=GncOptionUIType::MULTICHOICE) | |
GncOptionMultichoiceValue (const char *section, const char *name, const char *key, const char *doc_string, GncMultichoiceOptionIndexVec &&indices, GncMultichoiceOptionChoices &&choices, GncOptionUIType ui_type=GncOptionUIType::LIST) | |
GncOptionMultichoiceValue (const GncOptionMultichoiceValue &)=default | |
GncOptionMultichoiceValue (GncOptionMultichoiceValue &&)=default | |
GncOptionMultichoiceValue & | operator= (const GncOptionMultichoiceValue &)=default |
GncOptionMultichoiceValue & | operator= (GncOptionMultichoiceValue &&)=default |
const std::string & | get_value () const |
const std::string & | get_default_value () const |
uint16_t | get_index () const |
const GncMultichoiceOptionIndexVec & | get_multiple () const noexcept |
const GncMultichoiceOptionIndexVec & | get_default_multiple () const noexcept |
bool | validate (const std::string &value) const noexcept |
bool | validate (const GncMultichoiceOptionIndexVec &indexes) const noexcept |
void | set_value (const std::string &value) |
void | set_value (uint16_t index) |
void | set_default_value (const std::string &value) |
void | set_default_value (uint16_t index) |
void | set_multiple (const GncMultichoiceOptionIndexVec &indexes) |
void | set_default_multiple (const GncMultichoiceOptionIndexVec &indexes) |
uint16_t | num_permissible_values () const noexcept |
uint16_t | permissible_value_index (const char *key) const noexcept |
const char * | permissible_value (uint16_t index) const |
const char * | permissible_value_name (uint16_t index) const |
void | reset_default_value () |
void | mark_saved () noexcept |
bool | is_dirty () const noexcept |
bool | is_changed () const noexcept |
GncOptionUIType | get_ui_type () const noexcept |
void | make_internal () |
bool | is_internal () |
GncOptionMultichoiceKeyType | get_keytype (unsigned i) const |
std::string | serialize () const noexcept |
bool | deserialize (const std::string &str) noexcept |
Additional Inherited Members | |
Data Fields inherited from OptionClassifier | |
std::string | m_section |
std::string | m_name |
std::string | m_sort_tag |
std::string | m_doc_string |
Multichoice options have a vector of valid options (GncMultichoiceOptionChoices) and validate the selection as being one of those values.
The value is the index of the selected item in the vector.
GncMultichoiceOptionEntry is a tuple of two strings and a GncOptionMultichoiceKeyType value; the first string is the internal value of the option, the second is the display name that should be localized at the point of use (so mark it with N_() or (N_ ) when creating the multichoices) and the third is an enum value indicating whether the key should be interpreted as a Scheme symbol, a string, or a number.
Definition at line 528 of file gnc-option-impl.hpp.