GnuCash  4.11-354-g0815ab64c1
Public Member Functions | Friends

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_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. More...
 
std::size_t num_permissible_values () const
 Implemented only for GncOptionMultiselectValue. More...
 
std::size_t permissible_value_index (const char *value) const
 Implemented only for GncOptionMultiselectValue. More...
 
const char * permissible_value (std::size_t index) const
 Implemented only for GncOptionMultiselectValue. More...
 
const char * permissible_value_name (std::size_t index) const
 Implemented only for GncOptionMultiselectValue. More...
 
GList * account_type_list () const noexcept
 Implemented only for GncOptionAccountListValue. More...
 
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. More...
 
bool deserialize (const std::string &str)
 Set the option's value from a character sequence. More...
 
std::istream & in_stream (std::istream &iss)
 Set the option's value from an input stream. More...
 

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 131 of file gnc-option.hpp.


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