GnuCash 7574033+
Loading...
Searching...
No Matches

Represents the public interface for an option. More...

#include <gnc-option.hpp>

Public Member Functions

template<typename OptionType, typename std::enable_if_t< is_OptionClassifier_v< OptionType >, int > = 0>
 GncOption (OptionType option)
template<typename ValueType, typename std::enable_if_t<!is_OptionClassifier_v< ValueType >, int > = 0>
 GncOption (const char *section, const char *name, const char *key, const char *doc_string, ValueType value, GncOptionUIType ui_type=GncOptionUIType::INTERNAL)
template<typename ValueType>
void set_value (ValueType value)
template<typename ValueType>
void set_default_value (ValueType value)
template<typename ValueType>
ValueType get_default_value () const
template<typename ValueType>
ValueType get_value () const
void reset_default_value ()
const std::string & get_section () const
const std::string & get_name () const
const std::string & get_key () const
const std::string & get_docstring () const
void set_ui_item (GncOptionUIItemPtr &&ui_elem)
const GncOptionUIType get_ui_type () const
void set_ui_item_selectable (bool) const noexcept
GncOptionUIItem *const get_ui_item () const
void set_ui_item_from_option ()
void set_option_from_ui_item ()
void make_internal ()
bool is_internal ()
void mark_saved () noexcept
 Mark the option as needing to be saved.
bool is_dirty () const noexcept
bool is_changed () const noexcept
bool is_multiselect () const noexcept
template<typename ValueType>
void get_limits (ValueType &, ValueType &, ValueType &) const noexcept
 Implemented only for GncOptionNumericRange.
template<typename ValueType>
bool validate (ValueType value) const
 Not implemented for GncOptionValue.
uint16_t num_permissible_values () const
 Implemented only for GncOptionMultiselectValue.
uint16_t permissible_value_index (const char *value) const
 Implemented only for GncOptionMultiselectValue.
const char * permissible_value (uint16_t index) const
 Implemented only for GncOptionMultiselectValue.
const char * permissible_value_name (uint16_t index) const
 Implemented only for GncOptionMultiselectValue.
GList * account_type_list () const noexcept
 Implemented only for GncOptionAccountListValue.
bool is_alternate () const noexcept
void set_alternate (bool) noexcept
std::string serialize () const
 Get a string suitable for storage representing the option's value.
bool deserialize (const std::string &str)
 Set the option's value from a character sequence.
std::istream & in_stream (std::istream &iss)
 Set the option's value from an input stream.
void set_widget_changed (std::any cb)
std::any & get_widget_changed ()

Friends

GncOptionVariant & swig_get_option (GncOption *)

Detailed Description

Represents the public interface for an option.

Polymorphism is provided by a std::variant member containing GncOptionValue types.

Definition at line 136 of file gnc-option.hpp.


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