GnuCash c935c2f+
Loading...
Searching...
No Matches
Files | Data Structures | Typedefs | Enumerations | Enumerator | Functions | Variables

GnuCash Options System for Book, Report, and Stylesheet Options. More...

Files

file  gnc-option-date.hpp
 Relative date enumeration and manipulation functions.
 
file  gnc-option-impl.hpp
 Implementation templates and specializtions for GncOption values.
 
file  gnc-option-uitype.hpp
 OptionUITypes.
 
file  gnc-option.hpp
 C++ Public interface for individual options.
 
file  gnc-optiondb-impl.hpp
 Implementation details for GncOptionDB.
 
file  gnc-optiondb.h
 C public interface for the Options Database.
 
file  gnc-optiondb.hpp
 The primary C++ interface to options for books, reports, and stylesheets.
 

Data Structures

struct  OptionClassifier
 This class is the parent of all option implementations. More...
 
class  GncOptionValue< ValueType >
 The generic option-value class. More...
 
struct  GncOwnerDeleter
 class GncOptionGncOwnerValue More...
 
class  GncOptionGncOwnerValue
 
class  GncOptionQofInstanceValue
 
class  GncOptionCommodityValue
 class GncOptionCommodityValue Commodities are stored with their namespace and mnemonic instead of their gncGUID so that they can be correctly retrieved even if they're deleted and recreated. More...
 
struct  is_GncOwnerValue< T >
 
struct  is_QofInstanceValue< T >
 
struct  is_QofQueryValue< T >
 
class  GncOptionRangeValue< ValueType >
 Used for numeric ranges and plot sizes. More...
 
class  GncOptionMultichoiceValue
 Multichoice options have a vector of valid options (GncMultichoiceOptionChoices) and validate the selection as being one of those values. More...
 
class  GncOptionAccountListValue
 Set one or more accounts on which to report, optionally restricted to certain account types. More...
 
class  GncOptionAccountSelValue
 
class  GncOptionDateValue
 A legal date value is a pair of either a RelativeDatePeriod, the absolute flag and a time64, or for legacy purposes the absolute flag and a timespec. More...
 
struct  is_OptionClassifier< T >
 
struct  is_same_decayed< T, U >
 
struct  is_RangeValue< T >
 
class  GncOption
 Represents the public interface for an option. More...
 
class  GncOptionSection
 class GncOptionSection The upper-level classification implementation. More...
 
struct  GncOptionDBCallback
 
class  GncOptionDB
 Holds all of the options for a book, report, or stylesheet, organized by GncOptionSections. More...
 

Typedefs

using RelativeDatePeriodVec = std::vector< RelativeDatePeriod >
 
using GncOwnerPtr = std::unique_ptr< GncOwner, GncOwnerDeleter >
 
using GncItem = std::pair< QofIdTypeConst, GncGUID >
 class GncOptionQofinstanceValue
 
using GncMultichoiceOptionEntry = std::tuple< const std::string, const std::string, GncOptionMultichoiceKeyType >
 
using GncMultichoiceOptionIndexVec = std::vector< uint16_t >
 
using GncMultichoiceOptionChoices = std::vector< GncMultichoiceOptionEntry >
 
using GncOptionAccountList = std::vector< GncGUID >
 
using GncOptionAccountTypeList = std::vector< GNCAccountType >
 
using GncOptionUIItemPtr = std::unique_ptr< GncOptionUIItem >
 
using GncOwner = _gncOwner
 
using QofQuery = _QofQuery
 
using QofInstance = QofInstance_s
 
using GncOptionDateFormat = std::tuple< QofDateFormat, GNCDateMonthFormat, bool, std::string >
 
using GncOptionReportPlacement = std::tuple< uint32_t, uint32_t, uint32_t >
 
using GncOptionReportPlacementVec = std::vector< GncOptionReportPlacement >
 
using GncOptionVariant = std::variant< GncOptionValue< std::string >, GncOptionValue< bool >, GncOptionValue< int64_t >, GncOptionQofInstanceValue, GncOptionGncOwnerValue, GncOptionValue< const QofQuery * >, GncOptionValue< GncOptionReportPlacementVec >, GncOptionAccountListValue, GncOptionAccountSelValue, GncOptionMultichoiceValue, GncOptionRangeValue< int >, GncOptionRangeValue< double >, GncOptionCommodityValue, GncOptionDateValue, GncOptionValue< GncOptionDateFormat > >
 
using GncOptionVariantPtr = std::unique_ptr< GncOptionVariant >
 
using GncOptionVec = std::vector< GncOption >
 
using GncOptionSectionPtr = std::shared_ptr< GncOptionSection >
 
using GncOptionDBChangeCallback = void(*)(void *user_data)
 
using GncCallbackVec = std::vector< GncOptionDBCallback >
 
using GncOptionDBPtr = std::unique_ptr< GncOptionDB >
 
using GncOptionAccountList = std::vector< GncGUID >
 
using GncOptionAccountTypeList = std::vector< GNCAccountType >
 
using GncMultichoiceOptionEntry = std::tuple< const std::string, const std::string, GncOptionMultichoiceKeyType >
 
using GncMultichoiceOptionChoices = std::vector< GncMultichoiceOptionEntry >
 

Enumerations

enum class  RelativeDatePeriod : int {
  ABSOLUTE = -1 , TODAY , ONE_WEEK_AGO , ONE_WEEK_AHEAD ,
  ONE_MONTH_AGO , ONE_MONTH_AHEAD , THREE_MONTHS_AGO , THREE_MONTHS_AHEAD ,
  SIX_MONTHS_AGO , SIX_MONTHS_AHEAD , ONE_YEAR_AGO , ONE_YEAR_AHEAD ,
  START_THIS_MONTH , END_THIS_MONTH , START_PREV_MONTH , END_PREV_MONTH ,
  START_NEXT_MONTH , END_NEXT_MONTH , START_CURRENT_QUARTER , END_CURRENT_QUARTER ,
  START_PREV_QUARTER , END_PREV_QUARTER , START_NEXT_QUARTER , END_NEXT_QUARTER ,
  START_CAL_YEAR , END_CAL_YEAR , START_PREV_YEAR , END_PREV_YEAR ,
  START_NEXT_YEAR , END_NEXT_YEAR , START_ACCOUNTING_PERIOD , END_ACCOUNTING_PERIOD
}
 Reporting periods relative to the current date. More...
 
enum class  GncOptionUIType : unsigned int {
  INTERNAL , BOOLEAN , STRING , TEXT ,
  CURRENCY , COMMODITY , MULTICHOICE , DATE_ABSOLUTE ,
  DATE_RELATIVE , DATE_BOTH , ACCOUNT_LIST , ACCOUNT_SEL ,
  LIST , NUMBER_RANGE , COLOR , FONT ,
  PLOT_SIZE , BUDGET , PIXMAP , RADIOBUTTON ,
  DATE_FORMAT , OWNER , CUSTOMER , VENDOR ,
  EMPLOYEE , INVOICE , JOB , TAX_TABLE ,
  INV_REPORT , QUERY , REPORT_PLACEMENT , MAX_VALUE
}
 Used by GncOptionClassifier to indicate to dialog-options what control should be displayed for the option. More...
 
enum class  GncOptionMultichoiceKeyType { SYMBOL , STRING , NUMBER }
 
enum  RelativeDateUI : uint8_t { ABSOLUTE , RELATIVE , BOTH }
 

Functions

bool gnc_relative_date_is_single (RelativeDatePeriod)
 Report whether the relative date represents a period offset to today's date rather than the beginning or end of a date range.
 
bool gnc_relative_date_is_starting (RelativeDatePeriod)
 Report whether the relative date represents the beginning of a date range.
 
bool gnc_relative_date_is_ending (RelativeDatePeriod)
 Report whether the relative date represents the end of a date range.
 
const char * gnc_relative_date_storage_string (RelativeDatePeriod)
 Provide the string representation of a relative date for persisting the value.
 
const char * gnc_relative_date_display_string (RelativeDatePeriod)
 Provide the string representation of a relative date for displaying value to a user.
 
const char * gnc_relative_date_description (RelativeDatePeriod)
 Provide the description of a relative date.
 
RelativeDatePeriod gnc_relative_date_from_storage_string (const char *)
 Convert a relative date storage string back to a RelativeDatePeriod value.
 
time64 gnc_relative_date_to_time64 (RelativeDatePeriod, time64 now_t=static_cast< time64 >(GncDateTime()))
 Convert a RelativeDatePeriod value to a concrete time64 by applying the value to the current time.
 
std::ostream & operator<< (std::ostream &, const RelativeDatePeriod)
 Add the display string to the provided std::ostream.
 
QofInstanceqof_instance_from_string (const std::string &str, GncOptionUIType type)
 
QofInstanceqof_instance_from_guid (GncGUID *, GncOptionUIType type)
 
std::string qof_instance_to_string (const QofInstance *inst)
 
template<class OptType , typename std::enable_if_t< is_OptionClassifier_v< OptType > &&!(is_QofInstanceValue_v< OptType >||is_RangeValue_v< OptType >), int > = 0>
std::ostream & operator<< (std::ostream &oss, const OptType &opt)
 
template<>
std::ostream & operator<<< GncOptionValue< bool > > (std::ostream &oss, const GncOptionValue< bool > &opt)
 
std::ostream & operator<< (std::ostream &oss, const GncOptionCommodityValue &opt)
 
template<class OptType , typename std::enable_if_t< is_OptionClassifier_v< OptType > &&!(is_QofInstanceValue_v< OptType >||is_RangeValue_v< OptType >), int > = 0>
std::istream & operator>> (std::istream &iss, OptType &opt)
 
std::istream & operator>> (std::istream &iss, GncOptionCommodityValue &opt)
 
template<>
std::istream & operator>>< GncOptionValue< bool > > (std::istream &iss, GncOptionValue< bool > &opt)
 
template<>
std::istream & operator>>< GncOptionValue< GncOptionReportPlacementVec > > (std::istream &iss, GncOptionValue< GncOptionReportPlacementVec > &opt)
 
template<>
std::ostream & operator<<< GncOptionMultichoiceValue > (std::ostream &oss, const GncOptionMultichoiceValue &opt)
 
template<>
std::istream & operator>>< GncOptionMultichoiceValue > (std::istream &iss, GncOptionMultichoiceValue &opt)
 
template<>
std::ostream & operator<<< GncOptionAccountListValue > (std::ostream &oss, const GncOptionAccountListValue &opt)
 
template<>
std::istream & operator>>< GncOptionAccountListValue > (std::istream &iss, GncOptionAccountListValue &opt)
 
template<>
std::ostream & operator<<< GncOptionAccountSelValue > (std::ostream &oss, const GncOptionAccountSelValue &opt)
 
template<>
std::istream & operator>>< GncOptionAccountSelValue > (std::istream &iss, GncOptionAccountSelValue &opt)
 
template<>
std::ostream & operator<<< GncOptionDateValue > (std::ostream &oss, const GncOptionDateValue &opt)
 
template<>
std::istream & operator>>< GncOptionDateValue > (std::istream &iss, GncOptionDateValue &opt)
 
bool operator< (const GncOption &right, const GncOption &left)
 
std::ostream & operator<< (std::ostream &oss, const GncOption &opt)
 
std::istream & operator>> (std::istream &iss, GncOption &opt)
 
std::ostream & output_color_value (std::ostream &oss, const std::string &value)
 
template<typename ValueType >
GncOptiongnc_make_option (const char *section, const char *name, const char *key, const char *doc_string, ValueType value, GncOptionUIType ui_type)
 Free function wrapping GncOption's constructor.
 
bool operator< (const GncOptionSectionPtr &right, const GncOptionSectionPtr &left)
 
GncOptionDBgnc_option_db_new (void)
 Create an empty option database.
 
void gnc_option_db_destroy (GncOptionDB *odb)
 Destruct and release a GncOptionDB.
 
GList * gnc_option_db_commit (GncOptionDB *odb)
 Write all changed ui_item values to their options.
 
void gnc_option_db_clean (GncOptionDB *odb)
 Reset all ui_items to the option value.
 
void gnc_option_db_load (GncOptionDB *odb, QofBook *book)
 Load a book's options into the GncOptionDB.
 
void gnc_option_db_save (GncOptionDB *odb, QofBook *book, gboolean clear_options)
 Save the GncOptionDB contents into a book's options store.
 
void gnc_option_db_book_options (GncOptionDB *)
 Register the standard option set for a QofBook.
 
const QofInstancegnc_option_db_lookup_qofinstance_value (GncOptionDB *, const char *, const char *)
 Retrieve the QofInstance value of an option in the GncOptionDB.
 
GncOptionAccountList gnc_account_list_from_types (QofBook *book, const GncOptionAccountTypeList &types)
 Extract a list of accounts in the book having one of the GNCAccountTypes in types.
 
void gnc_register_string_option (GncOptionDB *db, const char *section, const char *name, const char *key, const char *doc_string, std::string value)
 Create a new string option and register it in the options database.
 
void gnc_register_string_option (const GncOptionDBPtr &db, const char *section, const char *name, const char *key, const char *doc_string, std::string value)
 As above but takes a const GncOptionDBPtr& (const std::unique_ptr<GncOptionDB>&) for calling from C++.
 
void gnc_register_text_option (GncOptionDB *db, const char *section, const char *name, const char *key, const char *doc_string, std::string value)
 Create a new text option and register it in the options database.
 
void gnc_register_text_option (const GncOptionDBPtr &db, const char *section, const char *name, const char *key, const char *doc_string, std::string value)
 As above but takes a const GncOptionDBPtr& (const std::unique_ptr<GncOptionDB>&) for calling from C++.
 
void gnc_register_font_option (GncOptionDB *db, const char *section, const char *name, const char *key, const char *doc_string, std::string value)
 Create a new font option and register it in the options database.
 
void gnc_register_font_option (const GncOptionDBPtr &db, const char *section, const char *name, const char *key, const char *doc_string, std::string value)
 As above but takes a const GncOptionDBPtr& (const std::unique_ptr<GncOptionDB>&) for calling from C++.
 
void gnc_register_budget_option (GncOptionDB *db, const char *section, const char *name, const char *key, const char *doc_string, GncBudget *value)
 Create a new budget option and register it in the options database.
 
void gnc_register_budget_option (const GncOptionDBPtr &db, const char *section, const char *name, const char *key, const char *doc_string, GncBudget *value)
 As above but takes a const GncOptionDBPtr& (const std::unique_ptr<GncOptionDB>&) for calling from C++.
 
void gnc_register_commodity_option (GncOptionDB *db, const char *section, const char *name, const char *key, const char *doc_string, gnc_commodity *value)
 Create a new commodity option and register it in the options database.
 
void gnc_register_commodity_option (const GncOptionDBPtr &db, const char *section, const char *name, const char *key, const char *doc_string, gnc_commodity *value)
 As above but takes a const GncOptionDBPtr& (const std::unique_ptr<GncOptionDB>&) for calling from C++.
 
void gnc_register_commodity_option (GncOptionDB *db, const char *section, const char *name, const char *key, const char *doc_string, const char *value)
 As above but with a const char* value, which should be the symbol for the commodity.
 
void gnc_register_commodity_option (const GncOptionDBPtr &db, const char *section, const char *name, const char *key, const char *doc_string, const char *value)
 As above but takes a const GncOptionDBPtr& (const std::unique_ptr<GncOptionDB>&) for calling from C++.
 
void gnc_register_simple_boolean_option (GncOptionDB *db, const char *section, const char *name, const char *key, const char *doc_string, bool value)
 Create a new simple boolean option and register it in the options database.
 
void gnc_register_simple_boolean_option (const GncOptionDBPtr &db, const char *section, const char *name, const char *key, const char *doc_string, bool value)
 As above but takes a const GncOptionDBPtr& (const std::unique_ptr<GncOptionDB>&) for calling from C++.
 
void gnc_register_pixmap_option (GncOptionDB *db, const char *section, const char *name, const char *key, const char *doc_string, std::string value)
 Create a new pixmap option and register it in the options database.
 
void gnc_register_pixmap_option (GncOptionDBPtr &db, const char *section, const char *name, const char *key, const char *doc_string, std::string value)
 As above but takes a const GncOptionDBPtr& (const std::unique_ptr<GncOptionDB>&) for calling from C++.
 
void gnc_register_account_list_limited_option (GncOptionDB *db, const char *section, const char *name, const char *key, const char *doc_string, const GncOptionAccountList &value, GncOptionAccountTypeList &&allowed)
 Create a new limited account list option and register it in the options database.
 
void gnc_register_account_list_limited_option (GncOptionDBPtr &db, const char *section, const char *name, const char *key, const char *doc_string, const GncOptionAccountList &value, GncOptionAccountTypeList &&allowed)
 As above but takes a const GncOptionDBPtr& (const std::unique_ptr<GncOptionDB>&) for calling from C++.
 
void gnc_register_account_list_option (GncOptionDB *db, const char *section, const char *name, const char *key, const char *doc_string, const GncOptionAccountList &value)
 Create a new account list option and register it in the options database.
 
void gnc_register_account_list_option (GncOptionDBPtr &db, const char *section, const char *name, const char *key, const char *doc_string, const GncOptionAccountList &value)
 As above but takes a const GncOptionDBPtr& (const std::unique_ptr<GncOptionDB>&) for calling from C++.
 
void gnc_register_account_sel_limited_option (GncOptionDB *db, const char *section, const char *name, const char *key, const char *doc_string, const Account *value, GncOptionAccountTypeList &&allowed)
 Create a limited account selection option and register it in the options database.
 
void gnc_register_account_sel_limited_option (GncOptionDBPtr &db, const char *section, const char *name, const char *key, const char *doc_string, const Account *value, GncOptionAccountTypeList &&allowed)
 As above but takes a const GncOptionDBPtr& (const std::unique_ptr<GncOptionDB>&) for calling from C++.
 
void gnc_register_multichoice_option (GncOptionDB *db, const char *section, const char *name, const char *key, const char *doc_string, const char *default_val, GncMultichoiceOptionChoices &&value)
 Create a new multichoice option and register it in the options database.
 
void gnc_register_multichoice_option (GncOptionDBPtr &db, const char *section, const char *name, const char *key, const char *doc_string, const char *default_val, GncMultichoiceOptionChoices &&value)
 As above but takes a const GncOptionDBPtr& (const std::unique_ptr<GncOptionDB>&) for calling from C++.
 
void gnc_register_list_option (GncOptionDB *db, const char *section, const char *name, const char *key, const char *doc_string, const char *value, GncMultichoiceOptionChoices &&list)
 Create a new list option and register it in the options database.
 
void gnc_register_list_option (GncOptionDBPtr &db, const char *section, const char *name, const char *key, const char *doc_string, const char *value, GncMultichoiceOptionChoices &&list)
 As above but takes a const GncOptionDBPtr& (const std::unique_ptr<GncOptionDB>&) for calling from C++.
 
template<typename ValueType >
void gnc_register_number_range_option (GncOptionDB *db, const char *section, const char *name, const char *key, const char *doc_string, ValueType value, ValueType min, ValueType max, ValueType step)
 Create a new number range option and register it in the options database.
 
template<typename ValueType >
void gnc_register_number_range_option (GncOptionDBPtr &db, const char *section, const char *name, const char *key, const char *doc_string, ValueType value, ValueType min, ValueType max, ValueType step)
 As above but takes a const GncOptionDBPtr& (const std::unique_ptr<GncOptionDB>&) for calling from C++.
 
void gnc_register_number_plot_size_option (GncOptionDB *db, const char *section, const char *name, const char *key, const char *doc_string, int value)
 Create a new plot-size option and register it in the options database.
 
void gnc_register_number_plot_size_option (GncOptionDB *db, const char *section, const char *name, const char *key, const char *doc_string, float value)
 
void gnc_register_number_plot_size_option (const GncOptionDBPtr &db, const char *section, const char *name, const char *key, const char *doc_string, int value)
 As above but takes a const GncOptionDBPtr& (const std::unique_ptr<GncOptionDB>&) for calling from C++.
 
void gnc_register_number_plot_size_option (const GncOptionDBPtr &db, const char *section, const char *name, const char *key, const char *doc_string, float value)
 
void gnc_register_query_option (GncOptionDB *db, const char *section, const char *name, const QofQuery *value)
 Create a new QofQuery option and register it in the options database.
 
void gnc_register_query_option (GncOptionDBPtr &db, const char *section, const char *name, const QofQuery *value)
 As above but takes a const GncOptionDBPtr& (const std::unique_ptr<GncOptionDB>&) for calling from C++.
 
void gnc_register_owner_option (GncOptionDB *db, const char *section, const char *name, const char *key, const char *doc_string, const GncOwner *value, GncOwnerType type)
 Create a new GncOwner option and register it in the options database.
 
void gnc_register_owner_option (GncOptionDBPtr &db, const char *section, const char *name, const char *key, const char *doc_string, const GncOwner *value, GncOwnerType type)
 As above but takes a const GncOptionDBPtr& (const std::unique_ptr<GncOptionDB>&) for calling from C++.
 
void gnc_register_color_option (GncOptionDB *db, const char *section, const char *name, const char *key, const char *doc_string, std::string value)
 Create a new color option and register it in the options database.
 
void gnc_register_color_option (GncOptionDBPtr &db, const char *section, const char *name, const char *key, const char *doc_string, std::string value)
 As above but takes a const GncOptionDBPtr& (const std::unique_ptr<GncOptionDB>&) for calling from C++.
 
void gnc_register_internal_option (GncOptionDBPtr &db, const char *section, const char *name, const std::string &value)
 
void gnc_register_internal_option (GncOptionDBPtr &db, const char *section, const char *name, bool value)
 
void gnc_register_report_placement_option (GncOptionDBPtr &db, const char *section, const char *name)
 
void gnc_register_currency_option (GncOptionDB *db, const char *section, const char *name, const char *key, const char *doc_string, gnc_commodity *value)
 Create a new currency option and register it in the options database.
 
void gnc_register_currency_option (const GncOptionDBPtr &db, const char *section, const char *name, const char *key, const char *doc_string, gnc_commodity *value)
 As above but takes a const GncOptionDBPtr& (const std::unique_ptr<GncOptionDB>&) for calling from C++.
 
void gnc_register_currency_option (GncOptionDB *db, const char *section, const char *name, const char *key, const char *doc_string, const char *value)
 As above but with a const char* value, which must be the ISO4217 three-letter symbol for the currency.
 
void gnc_register_currency_option (const GncOptionDBPtr &db, const char *section, const char *name, const char *key, const char *doc_string, const char *value)
 
void gnc_register_invoice_option (GncOptionDB *db, const char *section, const char *name, const char *key, const char *doc_string, GncInvoice *value)
 Create a new invoice option and register it in the options database.
 
void gnc_register_invoice_option (const GncOptionDBPtr &db, const char *section, const char *name, const char *key, const char *doc_string, GncInvoice *value)
 As above but takes a const GncOptionDBPtr& (const std::unique_ptr<GncOptionDB>&) for calling from C++.
 
void gnc_register_taxtable_option (GncOptionDB *db, const char *section, const char *name, const char *key, const char *doc_string, GncTaxTable *value)
 Create a new taxtable option and register it in the options database.
 
void gnc_register_taxtable_option (const GncOptionDBPtr &db, const char *section, const char *name, const char *key, const char *doc_string, GncTaxTable *value)
 As above but takes a const GncOptionDBPtr& (const std::unique_ptr<GncOptionDB>&) for calling from C++.
 
void gnc_register_invoice_print_report_option (GncOptionDB *db, const char *section, const char *name, const char *key, const char *doc_string, std::string value)
 Create a new print report option and register it in the options database.
 
void gnc_register_invoice_print_report_option (const GncOptionDBPtr &db, const char *section, const char *name, const char *key, const char *doc_string, std::string value)
 As above but takes a const GncOptionDBPtr& (const std::unique_ptr<GncOptionDB>&) for calling from C++.
 
void gnc_register_counter_option (GncOptionDB *db, const char *section, const char *name, const char *key, const char *doc_string, int value)
 Create a new counter option and register it in the options database.
 
void gnc_register_counter_option (const GncOptionDBPtr &db, const char *section, const char *name, const char *key, const char *doc_string, double value)
 As above but takes a const GncOptionDBPtr& (const std::unique_ptr<GncOptionDB>&) for calling from C++.
 
void gnc_register_counter_format_option (GncOptionDB *db, const char *section, const char *name, const char *key, const char *doc_string, std::string value)
 Create a new counter format option and register it in the options database.
 
void gnc_register_counter_format_option (GncOptionDBPtr &db, const char *section, const char *name, const char *key, const char *doc_string, std::string value)
 As above but takes a const GncOptionDBPtr& (const std::unique_ptr<GncOptionDB>&) for calling from C++.
 
void gnc_register_dateformat_option (GncOptionDB *db, const char *section, const char *name, const char *key, const char *doc_string, GncOptionDateFormat &&value)
 Create a new date format option and register it in the options database.
 
void gnc_register_dateformat_option (GncOptionDBPtr &db, const char *section, const char *name, const char *key, const char *doc_string, GncOptionDateFormat &&value)
 As above but takes a const GncOptionDBPtr& (const std::unique_ptr<GncOptionDB>&) for calling from C++.
 
void gnc_register_date_option (GncOptionDB *db, const char *section, const char *name, const char *key, const char *doc_string, RelativeDatePeriod period=RelativeDatePeriod::TODAY, RelativeDateUI ui=RelativeDateUI::BOTH)
 Create a new date option and register it in the options database.
 
void gnc_register_date_option (GncOptionDBPtr &db, const char *section, const char *name, const char *key, const char *doc_string, RelativeDatePeriod period=RelativeDatePeriod::TODAY, RelativeDateUI ui=RelativeDateUI::BOTH)
 As above but takes a const GncOptionDBPtr& (const std::unique_ptr<GncOptionDB>&) for calling from C++.
 
void gnc_register_date_option (GncOptionDB *db, const char *section, const char *name, const char *key, const char *doc_string, time64 time, RelativeDateUI ui=RelativeDateUI::BOTH)
 Create a new date option and register it in the options database.
 
void gnc_register_date_option (GncOptionDBPtr &db, const char *section, const char *name, const char *key, const char *doc_string, time64 time, RelativeDateUI ui=RelativeDateUI::BOTH)
 As above but takes a const GncOptionDBPtr& (const std::unique_ptr<GncOptionDB>&) for calling from C++.
 
void gnc_register_date_option (GncOptionDB *db, const char *section, const char *name, const char *key, const char *doc_string, RelativeDatePeriodVec &period_set, bool both=true)
 Create a new date option and register it in the options database.
 
void gnc_register_date_option (GncOptionDBPtr &db, const char *section, const char *name, const char *key, const char *doc_string, RelativeDatePeriodVec &period_set, bool both=true)
 As above but takes a const GncOptionDBPtr& (const std::unique_ptr<GncOptionDB>&) for calling from C++.
 
void gnc_register_start_date_option (GncOptionDB *db, const char *section, const char *name, const char *key, const char *doc_string, bool both=true)
 Create a new start-date option and register it in the options database.
 
void gnc_register_start_date_option (GncOptionDBPtr &db, const char *section, const char *name, const char *key, const char *doc_string, bool both=true)
 As above but takes a const GncOptionDBPtr& (const std::unique_ptr<GncOptionDB>&) for calling from C++.
 
void gnc_register_end_date_option (GncOptionDB *db, const char *section, const char *name, const char *key, const char *doc_string, bool both=true)
 Create a new end-date option and register it in the options database.
 
void gnc_register_end_date_option (GncOptionDBPtr &db, const char *section, const char *name, const char *key, const char *doc_string, bool both=true)
 As above but takes a const GncOptionDBPtr& (const std::unique_ptr<GncOptionDB>&) for calling from C++.
 

Variables

constexpr unsigned relative_date_periods
 
size_t constexpr classifier_size_max {50}
 
size_t constexpr sort_tag_size_max {10}
 
auto constexpr uint16_t_max = std::numeric_limits<uint16_t>::max()
 
template<typename T >
constexpr bool is_GncOwnerValue_v = is_GncOwnerValue<T>::value
 
template<typename T >
constexpr bool is_QofInstanceValue_v = is_QofInstanceValue<T>::value
 
template<typename T >
constexpr bool is_QofQueryValue_v = is_QofQueryValue<T>::value
 
template<typename T >
constexpr bool is_OptionClassifier_v = is_OptionClassifier<T>::value
 
template<typename T , typename U >
constexpr bool is_same_decayed_v = is_same_decayed<T, U>::value
 
template<typename T >
constexpr bool is_RangeValue_v = is_RangeValue<T>::value
 

Detailed Description

GnuCash Options System for Book, Report, and Stylesheet Options.

The GnuCash Options System supports two somewhat different purposes:

The options system is centered on an options database or optiondb. A separate optionsdb is created and instantiated for every use, so the book gets one at the beginning of the session with its values loaded from KVP, and every report gets one when the report is run, as do report stylesheets when they are edited. Customized report and stylesheet options are saved as Scheme code fragments in files in the user's GnuCash Config directory.

Note
Persistence via text scheme code is a security vulnerability as it enables an attacker to make GnuCash execute arbitrary code. The Guile interpreter affords full system access with at least the user's privileges.

Typedef Documentation

◆ GncCallbackVec

using GncCallbackVec = std::vector<GncOptionDBCallback>

Definition at line 101 of file gnc-optiondb-impl.hpp.

◆ GncItem

using GncItem = std::pair<QofIdTypeConst, GncGUID>

class GncOptionQofinstanceValue

QofInstances know what type they are but getting them to tell you is a pain so we put them in a pair with a type identifier.

Definition at line 172 of file gnc-option-impl.hpp.

◆ GncMultichoiceOptionChoices [1/2]

using GncMultichoiceOptionChoices = std::vector<GncMultichoiceOptionEntry>

Definition at line 511 of file gnc-option-impl.hpp.

◆ GncMultichoiceOptionChoices [2/2]

using GncMultichoiceOptionChoices = std::vector<GncMultichoiceOptionEntry>

Definition at line 61 of file gnc-optiondb.hpp.

◆ GncMultichoiceOptionEntry [1/2]

using GncMultichoiceOptionEntry = std::tuple<const std::string, const std::string, GncOptionMultichoiceKeyType>

Definition at line 507 of file gnc-option-impl.hpp.

◆ GncMultichoiceOptionEntry [2/2]

using GncMultichoiceOptionEntry = std::tuple<const std::string, const std::string, GncOptionMultichoiceKeyType>

Definition at line 58 of file gnc-optiondb.hpp.

◆ GncMultichoiceOptionIndexVec

using GncMultichoiceOptionIndexVec = std::vector<uint16_t>

Definition at line 510 of file gnc-option-impl.hpp.

◆ GncOptionAccountList [1/2]

using GncOptionAccountList = std::vector<GncGUID>

Definition at line 793 of file gnc-option-impl.hpp.

◆ GncOptionAccountList [2/2]

using GncOptionAccountList = std::vector<GncGUID>

Definition at line 55 of file gnc-optiondb.hpp.

◆ GncOptionAccountTypeList [1/2]

using GncOptionAccountTypeList = std::vector<GNCAccountType>

Definition at line 795 of file gnc-option-impl.hpp.

◆ GncOptionAccountTypeList [2/2]

using GncOptionAccountTypeList = std::vector<GNCAccountType>

Definition at line 57 of file gnc-optiondb.hpp.

◆ GncOptionDateFormat

using GncOptionDateFormat = std::tuple<QofDateFormat, GNCDateMonthFormat, bool, std::string>

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

◆ GncOptionDBChangeCallback

using GncOptionDBChangeCallback = void (*)(void* user_data)

Definition at line 83 of file gnc-optiondb-impl.hpp.

◆ GncOptionDBPtr

using GncOptionDBPtr = std::unique_ptr<GncOptionDB>

Definition at line 54 of file gnc-optiondb.hpp.

◆ GncOptionReportPlacement

using GncOptionReportPlacement = std::tuple<uint32_t, uint32_t, uint32_t>

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

◆ GncOptionReportPlacementVec

using GncOptionReportPlacementVec = std::vector<GncOptionReportPlacement>

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

◆ GncOptionSectionPtr

using GncOptionSectionPtr = std::shared_ptr<GncOptionSection>

Definition at line 75 of file gnc-optiondb-impl.hpp.

◆ GncOptionUIItemPtr

using GncOptionUIItemPtr = std::unique_ptr<GncOptionUIItem>

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

◆ GncOptionVariant

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

◆ GncOptionVariantPtr

using GncOptionVariantPtr = std::unique_ptr<GncOptionVariant>

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

◆ GncOptionVec

using GncOptionVec = std::vector<GncOption>

Definition at line 52 of file gnc-optiondb-impl.hpp.

◆ GncOwner

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

◆ GncOwnerPtr

using GncOwnerPtr = std::unique_ptr<GncOwner, GncOwnerDeleter>

Definition at line 135 of file gnc-option-impl.hpp.

◆ QofInstance

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

◆ QofQuery

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

◆ RelativeDatePeriodVec

using RelativeDatePeriodVec = std::vector<RelativeDatePeriod>

Definition at line 83 of file gnc-option-date.hpp.

Enumeration Type Documentation

◆ GncOptionMultichoiceKeyType

enum class GncOptionMultichoiceKeyType
strong

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

124{
125 SYMBOL,
126 STRING,
127 NUMBER,
128};

◆ GncOptionUIType

enum class GncOptionUIType : unsigned int
strong

Used by GncOptionClassifier to indicate to dialog-options what control should be displayed for the option.

Definition at line 39 of file gnc-option-uitype.hpp.

40{
41 INTERNAL,
42 BOOLEAN,
43 STRING,
44 TEXT,
45 CURRENCY,
46 COMMODITY,
47 MULTICHOICE,
48 DATE_ABSOLUTE,
49 DATE_RELATIVE,
50 DATE_BOTH,
51 ACCOUNT_LIST,
52 ACCOUNT_SEL,
53 LIST,
54 NUMBER_RANGE,
55 COLOR,
56 FONT,
57 PLOT_SIZE,
58 BUDGET,
59 PIXMAP,
60 RADIOBUTTON,
61 DATE_FORMAT,
62 OWNER,
63 CUSTOMER,
64 VENDOR,
65 EMPLOYEE,
66 INVOICE,
67 JOB,
68 TAX_TABLE,
69 INV_REPORT,
70 QUERY,
71 REPORT_PLACEMENT,
72 MAX_VALUE, //Nake sure this one is always last
73};

◆ RelativeDatePeriod

enum class RelativeDatePeriod : int
strong

Reporting periods relative to the current date.

The original design allowed custom RelativeDatePeriods, but that facility is unused so we'll go with compiled-in enums.

Definition at line 44 of file gnc-option-date.hpp.

45{
46 ABSOLUTE = -1,
47 TODAY,
48 ONE_WEEK_AGO,
49 ONE_WEEK_AHEAD,
50 ONE_MONTH_AGO,
51 ONE_MONTH_AHEAD,
52 THREE_MONTHS_AGO,
53 THREE_MONTHS_AHEAD,
54 SIX_MONTHS_AGO,
55 SIX_MONTHS_AHEAD,
56 ONE_YEAR_AGO,
57 ONE_YEAR_AHEAD,
58 START_THIS_MONTH,
59 END_THIS_MONTH,
60 START_PREV_MONTH,
61 END_PREV_MONTH,
62 START_NEXT_MONTH,
63 END_NEXT_MONTH,
64 START_CURRENT_QUARTER,
65 END_CURRENT_QUARTER,
66 START_PREV_QUARTER,
67 END_PREV_QUARTER,
68 START_NEXT_QUARTER,
69 END_NEXT_QUARTER,
70 START_CAL_YEAR,
71 END_CAL_YEAR,
72 START_PREV_YEAR,
73 END_PREV_YEAR,
74 START_NEXT_YEAR,
75 END_NEXT_YEAR,
76 START_ACCOUNTING_PERIOD,
77 END_ACCOUNTING_PERIOD,
78};

◆ RelativeDateUI

enum RelativeDateUI : uint8_t

Definition at line 825 of file gnc-optiondb.hpp.

826{
827 ABSOLUTE,
828 RELATIVE,
829 BOTH
830};

Function Documentation

◆ gnc_account_list_from_types()

GncOptionAccountList gnc_account_list_from_types ( QofBook book,
const GncOptionAccountTypeList &  types 
)

Extract a list of accounts in the book having one of the GNCAccountTypes in types.

Note that in Scheme it's important to use this function and not to create a list of accounts using gnc-get-descendants-sorted because the latter method produces a SWIGTYPE for the accounts that's incompatible with the SWIGTYPE used in this module.

Parameters
bookThe book whose accounts to search
typesA std::vector of GNCAccountType containing the Account types to include in ther result
Returns
A std::vector<const Account*> of all accounts in the book having the Account types in the types parameter.

Definition at line 780 of file gnc-optiondb.cpp.

782{
783 GncOptionAccountList list;
784 AccountPair funcdata{list, types};
785 Account* base_acct = gnc_book_get_root_account(book);
786 gnc_account_foreach_descendant(base_acct, (AccountCb)find_children,
787 &funcdata);
788 return list;
789}
STRUCTS.

◆ gnc_make_option()

template<typename ValueType >
GncOption * gnc_make_option ( const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
ValueType  value,
GncOptionUIType  ui_type 
)

Free function wrapping GncOption's constructor.

The type of GncOptionValue to create is determined from the UI type. Some GncOptionValue types require more parameters for their constructors and can't be created with this function.

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

267{
268 return new GncOption(section, name, key, doc_string, value, ui_type);
269}
Represents the public interface for an option.

◆ gnc_option_db_book_options()

void gnc_option_db_book_options ( GncOptionDB odb)

Register the standard option set for a QofBook.

Parameters
odbThe GncOptionDB

Definition at line 1199 of file gnc-optiondb.cpp.

1200{
1201 constexpr const char* business_section{N_("Business")};
1202 constexpr const char* counter_section{N_("Counters")};
1203 static const std::string empty_string{""};
1204
1205//Accounts Tab
1206
1207 gnc_register_number_range_option<double>(odb, OPTION_SECTION_ACCOUNTS,
1208 OPTION_NAME_AUTO_READONLY_DAYS, "a",
1209 N_("Choose the number of days after which transactions will be read-only and cannot be edited anymore. This threshold is marked by a red line in the account register windows. If zero, all transactions can be edited and none are read-only."),
1210 0.0, 0.0, 3650.0, 1.0);
1211
1212 gnc_register_simple_boolean_option(odb, OPTION_SECTION_ACCOUNTS,
1213 OPTION_NAME_NUM_FIELD_SOURCE, "b",
1214 N_("Check to have split action field used in registers for 'Num' field in place of transaction number; transaction number shown as 'T-Num' on second line of register. Has corresponding effect on business features, reporting and imports/exports."),
1215 false);
1216 gnc_register_simple_boolean_option(odb, OPTION_SECTION_ACCOUNTS,
1217 OPTION_NAME_TRADING_ACCOUNTS, "a",
1218 N_("Check to have trading accounts used for transactions involving more than one currency or commodity."),
1219 false);
1220
1221//Budgeting Tab
1222
1223 gnc_register_budget_option(odb, OPTION_SECTION_BUDGETING,
1224 OPTION_NAME_DEFAULT_BUDGET, "a",
1225 N_("Budget to be used when none has been otherwise specified."),
1226 nullptr);
1227
1228//Counters Tab
1229
1230 gnc_register_counter_option(odb, counter_section,
1231 N_("Customer number"), "gncCustomera",
1232 N_("The previous customer number generated. This number will be incremented to generate the next customer number."),
1233 0);
1234 gnc_register_counter_format_option(odb, counter_section,
1235 N_("Customer number format"),
1236 "gncCustomerb",
1237 N_("The format string to use for generating customer numbers. This is a printf-style format string."),
1238 empty_string);
1239 gnc_register_counter_option(odb, counter_section,
1240 N_("Employee number"), "gncEmployeea",
1241 N_("The previous employee number generated. This number will be incremented to generate the next employee number."),
1242 0);
1243 gnc_register_counter_format_option(odb, counter_section,
1244 N_("Employee number format"),
1245 "gncEmployeeb",
1246 N_("The format string to use for generating employee numbers. This is a printf-style format string."),
1247 empty_string);
1248 gnc_register_counter_option(odb, counter_section,
1249 N_("Invoice number"), "gncInvoicea",
1250 N_("The previous invoice number generated. This number will be incremented to generate the next invoice number."),
1251 0);
1252 gnc_register_counter_format_option(odb, counter_section,
1253 N_("Invoice number format"),
1254 "gncInvoiceb",
1255 N_("The format string to use for generating invoice numbers. This is a printf-style format string."),
1256 empty_string);
1257 gnc_register_counter_option(odb, counter_section,
1258 N_("Bill number"), "gncBilla",
1259 N_("The previous bill number generated. This number will be incremented to generate the next bill number."),
1260 0);
1261 gnc_register_counter_format_option(odb, counter_section,
1262 N_("Bill number format"), "gncBillb",
1263 N_("The format string to use for generating bill numbers. This is a printf-style format string."),
1264 empty_string);
1265 gnc_register_counter_option(odb, counter_section,
1266 N_("Expense voucher number"), "gncExpVouchera",
1267 N_("The previous expense voucher number generated. This number will be incremented to generate the next voucher number."),
1268 0);
1269 gnc_register_counter_format_option(odb, counter_section,
1270 N_("Expense voucher number format"),
1271 "gncExpVoucherb",
1272 N_("The format string to use for generating expense voucher numbers. This is a printf-style format string."),
1273 empty_string);
1274 gnc_register_counter_option(odb, counter_section,
1275 N_("Job number"), "gncJoba",
1276 N_("The previous job number generated. This number will be incremented to generate the next job number."),
1277 0);
1278 gnc_register_counter_format_option(odb, counter_section,
1279 N_("Job number format"), "gncJobb",
1280 N_("The format string to use for generating job numbers. This is a printf-style format string."),
1281 empty_string);
1282 gnc_register_counter_option(odb, counter_section,
1283 N_("Order number"), "gncOrdera",
1284 N_("The previous order number generated. This number will be incremented to generate the next order number."),
1285 0);
1286 gnc_register_counter_format_option(odb, counter_section,
1287 N_("Order number format"), "gncOrderb",
1288 N_("The format string to use for generating order numbers. This is a printf-style format string."),
1289 empty_string);
1290 gnc_register_counter_option(odb, counter_section,
1291 N_("Vendor number"), "gncVendora",
1292 N_("The previous vendor number generated. This number will be incremented to generate the next vendor number."),
1293 0);
1294 gnc_register_counter_format_option(odb, counter_section,
1295 N_("Vendor number format"), "gncVendorb",
1296 N_("The format string to use for generating vendor numbers. This is a printf-style format string."),
1297 empty_string);
1298
1299//Business Tab
1300
1301 gnc_register_string_option(odb, business_section, N_("Company Name"), "a",
1302 N_("The name of your business."),
1303 empty_string);
1304 gnc_register_text_option(odb, business_section, N_("Company Address"), "b1",
1305 N_("The address of your business."),
1306 empty_string);
1307 gnc_register_string_option(odb, business_section,
1308 N_("Company Contact Person"), "b2",
1309 N_("The contact person to print on invoices."),
1310 empty_string);
1311 gnc_register_string_option(odb, business_section,
1312 N_("Company Phone Number"), "c1",
1313 N_("The contact person to print on invoices."),
1314 empty_string);
1315 gnc_register_string_option(odb, business_section,
1316 N_("Company Fax Number"), "c2",
1317 N_("The fax number of your business."),
1318 empty_string);
1319 gnc_register_string_option(odb, business_section,
1320 N_("Company Email Address"), "c3",
1321 N_ ("The email address of your business."),
1322 empty_string);
1323 gnc_register_string_option(odb, business_section,
1324 N_("Company Website URL"), "c4",
1325 N_("The URL address of your website."),
1326 empty_string);
1327 gnc_register_string_option(odb, business_section, N_("Company ID"), "c5",
1328 N_("The ID for your company (eg 'Tax-ID: 00-000000)."),
1329 empty_string);
1330 gnc_register_invoice_print_report_option(odb, business_section,
1331 OPTION_NAME_DEFAULT_INVOICE_REPORT, "e1",
1332 N_("The invoice report to be used for printing."),
1333 empty_string);
1334 gnc_register_number_range_option<double>(odb, business_section,
1335 OPTION_NAME_DEFAULT_INVOICE_REPORT_TIMEOUT, "e2",
1336 N_("Length of time to change the used invoice report. A value of 0 means disabled."),
1337 0.0, 0.0, 20.0, 1.0);
1338 gnc_register_taxtable_option(odb, business_section,
1339 N_("Default Customer Tax Table"), "f1",
1340 N_("The default tax table to apply to customers."),
1341 nullptr);
1342 gnc_register_taxtable_option(odb, business_section,
1343 N_("Default Vendor Tax Table"), "f2",
1344 N_("The default tax table to apply to vendors."),
1345 nullptr);
1346
1347 gnc_register_dateformat_option(odb, business_section,
1348 N_("Fancy Date Format"), "g",
1349 N_("The default date format used for fancy printed dates."),
1350 {QOF_DATE_FORMAT_UNSET, GNCDATE_MONTH_NUMBER, true, ""});
1351
1352//Tax Tab
1353
1354 gnc_register_string_option(odb, N_("Tax"), N_("Tax Number"), "a",
1355 N_("The electronic tax number of your business"),
1356 empty_string);
1357}
@ QOF_DATE_FORMAT_UNSET
No Fancy Date Format, use Global.
Definition gnc-date.h:131
void gnc_register_dateformat_option(GncOptionDB *db, const char *section, const char *name, const char *key, const char *doc_string, GncOptionDateFormat &&value)
Create a new date format option and register it in the options database.
void gnc_register_text_option(GncOptionDB *db, const char *section, const char *name, const char *key, const char *doc_string, std::string value)
Create a new text option and register it in the options database.
void gnc_register_budget_option(GncOptionDB *db, const char *section, const char *name, const char *key, const char *doc_string, GncBudget *value)
Create a new budget option and register it in the options database.
void gnc_register_string_option(GncOptionDB *db, const char *section, const char *name, const char *key, const char *doc_string, std::string value)
Create a new string option and register it in the options database.
void gnc_register_invoice_print_report_option(GncOptionDB *db, const char *section, const char *name, const char *key, const char *doc_string, std::string value)
Create a new print report option and register it in the options database.
void gnc_register_taxtable_option(GncOptionDB *db, const char *section, const char *name, const char *key, const char *doc_string, GncTaxTable *value)
Create a new taxtable option and register it in the options database.
void gnc_register_counter_format_option(GncOptionDB *db, const char *section, const char *name, const char *key, const char *doc_string, std::string value)
Create a new counter format option and register it in the options database.
void gnc_register_counter_option(GncOptionDB *db, const char *section, const char *name, const char *key, const char *doc_string, int value)
Create a new counter option and register it in the options database.
void gnc_register_simple_boolean_option(GncOptionDB *db, const char *section, const char *name, const char *key, const char *doc_string, bool value)
Create a new simple boolean option and register it in the options database.

◆ gnc_option_db_clean()

void gnc_option_db_clean ( GncOptionDB odb)

Reset all ui_items to the option value.

Parameters
odbThe GncOptionDB.

Definition at line 1175 of file gnc-optiondb.cpp.

1176{
1177 odb->foreach_section(
1178 [](GncOptionSectionPtr& section){
1179 section->foreach_option(
1180 [](GncOption& option) {
1181 option.set_ui_item_from_option();
1182 });
1183 });
1184}

◆ gnc_option_db_commit()

GList * gnc_option_db_commit ( GncOptionDB odb)

Write all changed ui_item values to their options.

Parameters
odbThe GncOptionDB.
Returns
A GList* conatining the names of options that raised exceptions when attempting to set their values. The names are const, free only the list.

Definition at line 1149 of file gnc-optiondb.cpp.

1150{
1151 GList* errors{};
1152 odb->foreach_section(
1153 [&errors](GncOptionSectionPtr& section){
1154 section->foreach_option(
1155 [&errors](GncOption& option) {
1156 try
1157 {
1158 option.set_option_from_ui_item();
1159 }
1160 catch (const std::invalid_argument& err)
1161 {
1162 PWARN("Option %s:%s failed to set its value %s",
1163 option.get_section().c_str(),
1164 option.get_name().c_str(), err.what());
1165 errors = g_list_prepend(errors,
1166 (void*)option.get_name().c_str());
1167 } });
1168 });
1169 if (!errors)
1170 odb->run_callbacks();
1171 return errors;
1172}
#define PWARN(format, args...)
Log a warning.
Definition qoflog.h:250

◆ gnc_option_db_destroy()

void gnc_option_db_destroy ( GncOptionDB odb)

Destruct and release a GncOptionDB.

Parameters
odbThe GncOptionDB.

Definition at line 1143 of file gnc-optiondb.cpp.

1144{
1145 PWARN("Direct Destroy called on GncOptionDB %" G_GUINT64_FORMAT, (uint64_t)odb);
1146}

◆ gnc_option_db_load()

void gnc_option_db_load ( GncOptionDB odb,
QofBook book 
)

Load a book's options into the GncOptionDB.

Parameters
odbThe GncOptionDB
bookThe book in which the options are saved.

Definition at line 1186 of file gnc-optiondb.cpp.

1187{
1188 odb->load_from_kvp(book);
1189}

◆ gnc_option_db_lookup_qofinstance_value()

const QofInstance * gnc_option_db_lookup_qofinstance_value ( GncOptionDB odb,
const char *  section,
const char *  name 
)

Retrieve the QofInstance value of an option in the GncOptionDB.

Parameters
odbthe GncOptionDB
sectionthe section in which the option is stored
namethe option name
Returns
the const QofInstance* of the value or nullptr if the option isn't found or if its value isn't a QofInstance*.

Definition at line 1359 of file gnc-optiondb.cpp.

1361{
1362 auto option{odb->find_option(section, name)};
1363 if (option)
1364 return option->get_value<const QofInstance*>();
1365 else
1366 return nullptr;
1367}

◆ gnc_option_db_new()

GncOptionDB * gnc_option_db_new ( void  )

Create an empty option database.

Returns
A newly allocated GncOptionDB. Use delete to destroy it.

Definition at line 1137 of file gnc-optiondb.cpp.

1138{
1139 return new GncOptionDB;
1140}
Holds all of the options for a book, report, or stylesheet, organized by GncOptionSections.

◆ gnc_option_db_save()

void gnc_option_db_save ( GncOptionDB odb,
QofBook book,
gboolean  clear_options 
)

Save the GncOptionDB contents into a book's options store.

Parameters
odbThe GncOptionDB
bookThe book in which the options are saved.
clear_optionsTRUE if the books existing options should be removed first.

Definition at line 1192 of file gnc-optiondb.cpp.

1194{
1195 odb->save_to_kvp(book, static_cast<bool>(clear_options));
1196}

◆ gnc_register_account_list_limited_option() [1/2]

void gnc_register_account_list_limited_option ( GncOptionDB db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
const GncOptionAccountList &  value,
GncOptionAccountTypeList &&  allowed 
)

Create a new limited account list option and register it in the options database.

Parameters
dbA GncOptionDB* for calling from C. Caller retains ownership.
sectionThe database section for the option.
nameThe option name.
keyA short tag used to sort the controls in the dialog.
doc_stringA description of the option. This will be used in tooltips and should be marked for translation.
valueThe initial and default values for the option.
allowedThe accounts which are available for selection.

Definition at line 746 of file gnc-optiondb.cpp.

752{
753 try
754 {
755 GncOption option{GncOptionAccountListValue{section, name, key, doc_string,
756 GncOptionUIType::ACCOUNT_LIST, value, std::move(allowed)}};
757 db->register_option(section, std::move(option));
758 }
759 catch (const std::invalid_argument& err)
760 {
761 PWARN("Account List Limited Option, value failed validation, option not registered.");
762 }
763}
Set one or more accounts on which to report, optionally restricted to certain account types.

◆ gnc_register_account_list_limited_option() [2/2]

void gnc_register_account_list_limited_option ( GncOptionDBPtr &  db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
const GncOptionAccountList &  value,
GncOptionAccountTypeList &&  allowed 
)
inline

As above but takes a const GncOptionDBPtr& (const std::unique_ptr<GncOptionDB>&) for calling from C++.

Definition at line 308 of file gnc-optiondb.hpp.

314{
315 gnc_register_account_list_limited_option(db.get(), section, name, key,
316 doc_string, value,
317 std::move(allowed));
318}
void gnc_register_account_list_limited_option(GncOptionDB *db, const char *section, const char *name, const char *key, const char *doc_string, const GncOptionAccountList &value, GncOptionAccountTypeList &&allowed)
Create a new limited account list option and register it in the options database.

◆ gnc_register_account_list_option() [1/2]

void gnc_register_account_list_option ( GncOptionDB db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
const GncOptionAccountList &  value 
)

Create a new account list option and register it in the options database.

Parameters
dbA GncOptionDB* for calling from C. Caller retains ownership.
sectionThe database section for the option.
nameThe option name.
keyA short tag used to sort the controls in the dialog.
doc_stringA description of the option. This will be used in tooltips and should be marked for translation.
valueThe initial and default values for the option.

Definition at line 735 of file gnc-optiondb.cpp.

739{
740 GncOption option{GncOptionAccountListValue{section, name, key, doc_string,
741 GncOptionUIType::ACCOUNT_LIST, value}};
742 db->register_option(section, std::move(option));
743}

◆ gnc_register_account_list_option() [2/2]

void gnc_register_account_list_option ( GncOptionDBPtr &  db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
const GncOptionAccountList &  value 
)
inline

As above but takes a const GncOptionDBPtr& (const std::unique_ptr<GncOptionDB>&) for calling from C++.

Definition at line 339 of file gnc-optiondb.hpp.

344{
345 gnc_register_account_list_option(db.get(), section, name, key,
346 doc_string, value);
347}
void gnc_register_account_list_option(GncOptionDB *db, const char *section, const char *name, const char *key, const char *doc_string, const GncOptionAccountList &value)
Create a new account list option and register it in the options database.

◆ gnc_register_account_sel_limited_option() [1/2]

void gnc_register_account_sel_limited_option ( GncOptionDB db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
const Account value,
GncOptionAccountTypeList &&  allowed 
)

Create a limited account selection option and register it in the options database.

Parameters
dbA GncOptionDB* for calling from C. Caller retains ownership.
sectionThe database section for the option.
nameThe option name.
keyA short tag used to sort the controls in the dialog.
doc_stringA description of the option. This will be used in tooltips and should be marked for translation.
valueThe initial and default value for the option.
allowedThe accounts which are available for selection.

Definition at line 793 of file gnc-optiondb.cpp.

798{
799 try
800 {
801 GncOption option{GncOptionAccountSelValue{section, name, key, doc_string,
802 GncOptionUIType::ACCOUNT_SEL, value, std::move(allowed)}};
803 db->register_option(section, std::move(option));
804 }
805 catch (const std::invalid_argument& err)
806 {
807 PWARN("Account Sel Limited Option, value failed validation, option not registerd.");
808 }
809}

◆ gnc_register_account_sel_limited_option() [2/2]

void gnc_register_account_sel_limited_option ( GncOptionDBPtr &  db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
const Account value,
GncOptionAccountTypeList &&  allowed 
)
inline

As above but takes a const GncOptionDBPtr& (const std::unique_ptr<GncOptionDB>&) for calling from C++.

Definition at line 370 of file gnc-optiondb.hpp.

376{
377 gnc_register_account_sel_limited_option(db.get(), section, name, key,
378 doc_string, value,
379 std::move(allowed));
380}
void gnc_register_account_sel_limited_option(GncOptionDB *db, const char *section, const char *name, const char *key, const char *doc_string, const Account *value, GncOptionAccountTypeList &&allowed)
Create a limited account selection option and register it in the options database.

◆ gnc_register_budget_option() [1/2]

void gnc_register_budget_option ( const GncOptionDBPtr &  db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
GncBudget *  value 
)
inline

As above but takes a const GncOptionDBPtr& (const std::unique_ptr<GncOptionDB>&) for calling from C++.

Definition at line 175 of file gnc-optiondb.hpp.

179{
180 gnc_register_budget_option(db.get(), section, name, key, doc_string, value);
181}

◆ gnc_register_budget_option() [2/2]

void gnc_register_budget_option ( GncOptionDB db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
GncBudget *  value 
)

Create a new budget option and register it in the options database.

Parameters
dbA GncOptionDB* for calling from C. Caller retains ownership.
sectionThe database section for the option.
nameThe option name.
keyA short tag used to sort the controls in the dialog.
doc_stringA description of the option. This will be used in tooltips and should be marked for translation.
valueThe initial and default value for the option.

Definition at line 657 of file gnc-optiondb.cpp.

660{
661 GncOption option{GncOptionQofInstanceValue{section, name, key, doc_string,
662 (const QofInstance*)value,
663 GncOptionUIType::BUDGET}};
664 db->register_option(section, std::move(option));
665}

◆ gnc_register_color_option() [1/2]

void gnc_register_color_option ( GncOptionDB db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
std::string  value 
)

Create a new color option and register it in the options database.

Parameters
dbA GncOptionDB* for calling from C. Caller retains ownership.
sectionThe database section for the option.
nameThe option name.
keyA short tag used to sort the controls in the dialog.
doc_stringA description of the option. This will be used in tooltips and should be marked for translation.
valueThe initial and default value for the option.

Definition at line 668 of file gnc-optiondb.cpp.

671{
672 GncOption option{section, name, key, doc_string, value,
673 GncOptionUIType::COLOR};
674 db->register_option(section, std::move(option));
675}

◆ gnc_register_color_option() [2/2]

void gnc_register_color_option ( GncOptionDBPtr &  db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
std::string  value 
)
inline

As above but takes a const GncOptionDBPtr& (const std::unique_ptr<GncOptionDB>&) for calling from C++.

Definition at line 597 of file gnc-optiondb.hpp.

601{
602 gnc_register_color_option(db.get(), section, name, key, doc_string, value);
603}
void gnc_register_color_option(GncOptionDB *db, const char *section, const char *name, const char *key, const char *doc_string, std::string value)
Create a new color option and register it in the options database.

◆ gnc_register_commodity_option() [1/4]

void gnc_register_commodity_option ( const GncOptionDBPtr &  db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
const char *  value 
)
inline

As above but takes a const GncOptionDBPtr& (const std::unique_ptr<GncOptionDB>&) for calling from C++.

Definition at line 223 of file gnc-optiondb.hpp.

228{
229 gnc_register_commodity_option(db.get(), section, name, key,
230 doc_string, value);
231}
void gnc_register_commodity_option(GncOptionDB *db, const char *section, const char *name, const char *key, const char *doc_string, gnc_commodity *value)
Create a new commodity option and register it in the options database.

◆ gnc_register_commodity_option() [2/4]

void gnc_register_commodity_option ( const GncOptionDBPtr &  db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
gnc_commodity *  value 
)
inline

As above but takes a const GncOptionDBPtr& (const std::unique_ptr<GncOptionDB>&) for calling from C++.

Definition at line 201 of file gnc-optiondb.hpp.

206{
207 gnc_register_commodity_option(db.get(), section, name, key,
208 doc_string, value);
209}

◆ gnc_register_commodity_option() [3/4]

void gnc_register_commodity_option ( GncOptionDB db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
const char *  value 
)

As above but with a const char* value, which should be the symbol for the commodity.

All security editor namespaces will be searched to retrieve it.

Definition at line 689 of file gnc-optiondb.cpp.

692{
693 gnc_commodity* commodity{};
694 const auto book{qof_session_get_book(gnc_get_current_session())};
695 const auto commodity_table{gnc_commodity_table_get_table(book)};
696 const auto namespaces{gnc_commodity_table_get_namespaces(commodity_table)};
697 for (auto node = namespaces; node && commodity == nullptr;
698 node = g_list_next(node))
699 {
700 commodity = gnc_commodity_table_lookup(commodity_table,
701 (const char*)(node->data),
702 value);
703 if (commodity)
704 break;
705 }
706 GncOption option{GncOptionCommodityValue{section, name, key, doc_string,
707 commodity,
708 GncOptionUIType::COMMODITY}};
709 db->register_option(section, std::move(option));
710 g_list_free (namespaces);
711}
class GncOptionCommodityValue Commodities are stored with their namespace and mnemonic instead of the...
QofBook * qof_session_get_book(const QofSession *session)
Returns the QofBook of this session.
gnc_commodity_table * gnc_commodity_table_get_table(QofBook *book)
Returns the commodity table associated with a book.
GList * gnc_commodity_table_get_namespaces(const gnc_commodity_table *table)
Return a list of all namespaces in the commodity table.

◆ gnc_register_commodity_option() [4/4]

void gnc_register_commodity_option ( GncOptionDB db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
gnc_commodity *  value 
)

Create a new commodity option and register it in the options database.

Parameters
dbA GncOptionDB* for calling from C. Caller retains ownership.
sectionThe database section for the option.
nameThe option name.
keyA short tag used to sort the controls in the dialog.
doc_stringA description of the option. This will be used in tooltips and should be marked for translation.
valueThe initial and default value for the option.

Definition at line 678 of file gnc-optiondb.cpp.

681{
682 GncOption option{GncOptionCommodityValue{section, name, key, doc_string,
683 value,
684 GncOptionUIType::COMMODITY}};
685 db->register_option(section, std::move(option));
686}

◆ gnc_register_counter_format_option() [1/2]

void gnc_register_counter_format_option ( GncOptionDB db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
std::string  value 
)

Create a new counter format option and register it in the options database.

Parameters
dbA GncOptionDB* for calling from C. Caller retains ownership.
sectionThe database section for the option.
nameThe option name.
keyA short tag used to sort the controls in the dialog.
doc_stringA description of the option. This will be used in tooltips and should be marked for translation.
valueThe initial and default value for the option.

Definition at line 958 of file gnc-optiondb.cpp.

962{
963 GncOption option{section, name, key, doc_string, value,
964 GncOptionUIType::STRING};
965 db->register_option(section, std::move(option));
966}

◆ gnc_register_counter_format_option() [2/2]

void gnc_register_counter_format_option ( GncOptionDBPtr &  db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
std::string  value 
)
inline

As above but takes a const GncOptionDBPtr& (const std::unique_ptr<GncOptionDB>&) for calling from C++.

Definition at line 786 of file gnc-optiondb.hpp.

792{
793 gnc_register_counter_format_option(db.get(), section, name, key,
794 doc_string, value);
795}

◆ gnc_register_counter_option() [1/2]

void gnc_register_counter_option ( const GncOptionDBPtr &  db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
double  value 
)
inline

As above but takes a const GncOptionDBPtr& (const std::unique_ptr<GncOptionDB>&) for calling from C++.

Definition at line 759 of file gnc-optiondb.hpp.

763{
764 gnc_register_counter_option(db.get(), section, name, key,
765 doc_string, value);
766}

◆ gnc_register_counter_option() [2/2]

void gnc_register_counter_option ( GncOptionDB db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
int  value 
)

Create a new counter option and register it in the options database.

Parameters
dbA GncOptionDB* for calling from C. Caller retains ownership.
sectionThe database section for the option.
nameThe option name.
keyA short tag used to sort the controls in the dialog.
doc_stringA description of the option. This will be used in tooltips and should be marked for translation.
valueThe initial and default value for the option.

Definition at line 947 of file gnc-optiondb.cpp.

950{
951 GncOption option{GncOptionRangeValue<int>{section, name, key, doc_string,
952 value, 0, 999999999, 1}};
953 option.set_alternate(true);
954 db->register_option(section, std::move(option));
955}
Used for numeric ranges and plot sizes.

◆ gnc_register_currency_option() [1/4]

void gnc_register_currency_option ( const GncOptionDBPtr &  db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
const char *  value 
)
inline

Definition at line 653 of file gnc-optiondb.hpp.

658{
659 gnc_register_currency_option(db.get(), section, name, key,
660 doc_string, value);
661}
void gnc_register_currency_option(GncOptionDB *db, const char *section, const char *name, const char *key, const char *doc_string, gnc_commodity *value)
Create a new currency option and register it in the options database.

◆ gnc_register_currency_option() [2/4]

void gnc_register_currency_option ( const GncOptionDBPtr &  db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
gnc_commodity *  value 
)
inline

As above but takes a const GncOptionDBPtr& (const std::unique_ptr<GncOptionDB>&) for calling from C++.

Definition at line 633 of file gnc-optiondb.hpp.

638{
639 gnc_register_currency_option(db.get(), section, name, key,
640 doc_string, value);
641}

◆ gnc_register_currency_option() [3/4]

void gnc_register_currency_option ( GncOptionDB db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
const char *  value 
)

As above but with a const char* value, which must be the ISO4217 three-letter symbol for the currency.

Definition at line 990 of file gnc-optiondb.cpp.

993{
994 const auto book{qof_session_get_book(gnc_get_current_session())};
995 const auto commodity_table{gnc_commodity_table_get_table(book)};
996 const auto commodity = gnc_commodity_table_lookup(commodity_table,
997 "CURRENCY",
998 value);
1000 section, name, key, doc_string, commodity, GncOptionUIType::CURRENCY
1001 }};
1002 db->register_option(section, std::move(option));
1003}

◆ gnc_register_currency_option() [4/4]

void gnc_register_currency_option ( GncOptionDB db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
gnc_commodity *  value 
)

Create a new currency option and register it in the options database.

Parameters
dbA GncOptionDB* for calling from C. Caller retains ownership.
sectionThe database section for the option.
nameThe option name.
keyA short tag used to sort the controls in the dialog.
doc_stringA description of the option. This will be used in tooltips and should be marked for translation.
valueThe initial and default value for the option. It is checked with gnc_commodity_is_currency.

Definition at line 979 of file gnc-optiondb.cpp.

982{
984 section, name, key, doc_string, value, GncOptionUIType::CURRENCY
985 }};
986 db->register_option(section, std::move(option));
987}

◆ gnc_register_date_option() [1/6]

void gnc_register_date_option ( GncOptionDB db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
RelativeDatePeriod  period = RelativeDatePeriod::TODAY,
RelativeDateUI  ui = RelativeDateUI::BOTH 
)

Create a new date option and register it in the options database.

Parameters
dbA GncOptionDB* for calling from C. Caller retains ownership.
sectionThe database section for the option.
nameThe option name.
keyA short tag used to sort the controls in the dialog.
doc_stringA description of the option. This will be used in tooltips and should be marked for translation.
periodThe default/starting relative date value for the option.
uiWhat UI to display, relative, absolute, or both.

Definition at line 1020 of file gnc-optiondb.cpp.

1024{
1025 auto ui_type = ui == RelativeDateUI::BOTH ? GncOptionUIType::DATE_BOTH :
1026 ui == RelativeDateUI::RELATIVE ? GncOptionUIType::DATE_RELATIVE :
1027 GncOptionUIType::DATE_ABSOLUTE;
1028 GncOption option{GncOptionDateValue(section, name, key, doc_string,
1029 ui_type, period)};
1030 db->register_option(section, std::move(option));
1031}
A legal date value is a pair of either a RelativeDatePeriod, the absolute flag and a time64,...

◆ gnc_register_date_option() [2/6]

void gnc_register_date_option ( GncOptionDB db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
RelativeDatePeriodVec &  period_set,
bool  both = true 
)

Create a new date option and register it in the options database.

Parameters
dbA GncOptionDB* for calling from C. Caller retains ownership.
sectionThe database section for the option.
nameThe option name.
keyA short tag used to sort the controls in the dialog.
doc_stringA description of the option. This will be used in tooltips and should be marked for translation.
period_setA vector of relative date periods to display in the relative control.
bothWhether to display both a relative and absolute control or a onla a relative control.

Definition at line 1034 of file gnc-optiondb.cpp.

1039{
1040 auto is_absolute = period_set.size() == 1 &&
1041 period_set.front() == RelativeDatePeriod::ABSOLUTE;
1042 auto ui_type = both ? GncOptionUIType::DATE_BOTH :
1043 is_absolute ? GncOptionUIType::DATE_ABSOLUTE : GncOptionUIType::DATE_RELATIVE;
1044 GncOption option{GncOptionDateValue(section, name, key, doc_string,
1045 ui_type, period_set)};
1046 if (is_absolute)
1047 option.set_default_value(gnc_time(nullptr));
1048 db->register_option(section, std::move(option));
1049}
time64 gnc_time(time64 *tbuf)
get the current time
Definition gnc-date.cpp:262

◆ gnc_register_date_option() [3/6]

void gnc_register_date_option ( GncOptionDB db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
time64  time,
RelativeDateUI  ui = RelativeDateUI::BOTH 
)

Create a new date option and register it in the options database.

Parameters
dbA GncOptionDB* for calling from C. Caller retains ownership.
sectionThe database section for the option.
nameThe option name.
keyA short tag used to sort the controls in the dialog.
doc_stringA description of the option. This will be used in tooltips and should be marked for translation.
timeThe initial time to set in the option.
uiWhat UI to display, relative, absolute, or both.

Definition at line 1006 of file gnc-optiondb.cpp.

1010{
1011 auto ui_type = ui == RelativeDateUI::BOTH ? GncOptionUIType::DATE_BOTH :
1012 ui == RelativeDateUI::RELATIVE ? GncOptionUIType::DATE_RELATIVE :
1013 GncOptionUIType::DATE_ABSOLUTE;
1014 GncOption option{GncOptionDateValue(section, name, key, doc_string,
1015 ui_type, time)};
1016 db->register_option(section, std::move(option));
1017}

◆ gnc_register_date_option() [4/6]

void gnc_register_date_option ( GncOptionDBPtr &  db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
RelativeDatePeriod  period = RelativeDatePeriod::TODAY,
RelativeDateUI  ui = RelativeDateUI::BOTH 
)
inline

As above but takes a const GncOptionDBPtr& (const std::unique_ptr<GncOptionDB>&) for calling from C++.

Definition at line 853 of file gnc-optiondb.hpp.

859{
860 gnc_register_date_option(db.get(), section, name, key, doc_string,
861 period, ui);
862}
void gnc_register_date_option(GncOptionDB *db, const char *section, const char *name, const char *key, const char *doc_string, RelativeDatePeriod period=RelativeDatePeriod::TODAY, RelativeDateUI ui=RelativeDateUI::BOTH)
Create a new date option and register it in the options database.

◆ gnc_register_date_option() [5/6]

void gnc_register_date_option ( GncOptionDBPtr &  db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
RelativeDatePeriodVec &  period_set,
bool  both = true 
)
inline

As above but takes a const GncOptionDBPtr& (const std::unique_ptr<GncOptionDB>&) for calling from C++.

Definition at line 912 of file gnc-optiondb.hpp.

917{
918 gnc_register_date_option(db.get(), section, name, key, doc_string,
919 period_set, both);
920}

◆ gnc_register_date_option() [6/6]

void gnc_register_date_option ( GncOptionDBPtr &  db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
time64  time,
RelativeDateUI  ui = RelativeDateUI::BOTH 
)
inline

As above but takes a const GncOptionDBPtr& (const std::unique_ptr<GncOptionDB>&) for calling from C++.

Definition at line 883 of file gnc-optiondb.hpp.

887{
888 gnc_register_date_option(db.get(), section, name, key, doc_string,
889 time, ui);
890}

◆ gnc_register_dateformat_option() [1/2]

void gnc_register_dateformat_option ( GncOptionDB db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
GncOptionDateFormat &&  value 
)

Create a new date format option and register it in the options database.

Parameters
dbA GncOptionDB* for calling from C. Caller retains ownership.
sectionThe database section for the option.
nameThe option name.
keyA short tag used to sort the controls in the dialog.
doc_stringA description of the option. This will be used in tooltips and should be marked for translation.
valueThe initial and default value for the option.

Definition at line 969 of file gnc-optiondb.cpp.

972{
973 GncOption option{section, name, key, doc_string, std::move(value),
974 GncOptionUIType::DATE_FORMAT};
975 db->register_option(section, std::move(option));
976}

◆ gnc_register_dateformat_option() [2/2]

void gnc_register_dateformat_option ( GncOptionDBPtr &  db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
GncOptionDateFormat &&  value 
)
inline

As above but takes a const GncOptionDBPtr& (const std::unique_ptr<GncOptionDB>&) for calling from C++.

Definition at line 815 of file gnc-optiondb.hpp.

820{
821 gnc_register_dateformat_option(db.get(), section, name, key,
822 doc_string, std::move(value));
823}

◆ gnc_register_end_date_option() [1/2]

void gnc_register_end_date_option ( GncOptionDB db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
bool  both = true 
)

Create a new end-date option and register it in the options database.

Parameters
dbA GncOptionDB* for calling from C. Caller retains ownership.
sectionThe database section for the option.
nameThe option name.
keyA short tag used to sort the controls in the dialog.
doc_stringA description of the option. This will be used in tooltips and should be marked for translation.
bothWhether to display both a relative and absolute control or a onla a relative control.

Definition at line 1089 of file gnc-optiondb.cpp.

1092{
1093 auto ui_type = both ? GncOptionUIType::DATE_BOTH :
1094 GncOptionUIType::DATE_RELATIVE;
1095 GncOption option{GncOptionDateValue(section, name, key, doc_string,
1096 ui_type, end_dates)};
1097 db->register_option(section, std::move(option));
1098}

◆ gnc_register_end_date_option() [2/2]

void gnc_register_end_date_option ( GncOptionDBPtr &  db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
bool  both = true 
)
inline

As above but takes a const GncOptionDBPtr& (const std::unique_ptr<GncOptionDB>&) for calling from C++.

Definition at line 966 of file gnc-optiondb.hpp.

969{
970 gnc_register_end_date_option(db.get(), section, name, key, doc_string,
971 both);
972}
void gnc_register_end_date_option(GncOptionDB *db, const char *section, const char *name, const char *key, const char *doc_string, bool both=true)
Create a new end-date option and register it in the options database.

◆ gnc_register_font_option() [1/2]

void gnc_register_font_option ( const GncOptionDBPtr &  db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
std::string  value 
)
inline

As above but takes a const GncOptionDBPtr& (const std::unique_ptr<GncOptionDB>&) for calling from C++.

Definition at line 150 of file gnc-optiondb.hpp.

154{
155 gnc_register_font_option(db.get(), section, name, key, doc_string, value);
156}
void gnc_register_font_option(GncOptionDB *db, const char *section, const char *name, const char *key, const char *doc_string, std::string value)
Create a new font option and register it in the options database.

◆ gnc_register_font_option() [2/2]

void gnc_register_font_option ( GncOptionDB db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
std::string  value 
)

Create a new font option and register it in the options database.

Parameters
dbA GncOptionDB* for calling from C. Caller retains ownership.
sectionThe database section for the option.
nameThe option name.
keyA short tag used to sort the controls in the dialog.
doc_stringA description of the option. This will be used in tooltips and should be marked for translation.
valueThe initial and default value for the option.

Definition at line 647 of file gnc-optiondb.cpp.

650{
651 GncOption option{section, name, key, doc_string, value,
652 GncOptionUIType::FONT};
653 db->register_option(section, std::move(option));
654}

◆ gnc_register_internal_option() [1/2]

void gnc_register_internal_option ( GncOptionDBPtr &  db,
const char *  section,
const char *  name,
bool  value 
)

Definition at line 1126 of file gnc-optiondb.cpp.

1129{
1130 GncOption option{
1131 GncOptionValue<bool>{section, name, "", "", value,
1132 GncOptionUIType::INTERNAL}};
1133 db->register_option(section, std::move(option));
1134}
The generic option-value class.

◆ gnc_register_internal_option() [2/2]

void gnc_register_internal_option ( GncOptionDBPtr &  db,
const char *  section,
const char *  name,
const std::string &  value 
)

Definition at line 1115 of file gnc-optiondb.cpp.

1118{
1119 GncOption option{
1120 GncOptionValue<std::string>{section, name, "", "", value,
1121 GncOptionUIType::INTERNAL}};
1122 db->register_option(section, std::move(option));
1123}

◆ gnc_register_invoice_option() [1/2]

void gnc_register_invoice_option ( const GncOptionDBPtr &  db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
GncInvoice *  value 
)
inline

As above but takes a const GncOptionDBPtr& (const std::unique_ptr<GncOptionDB>&) for calling from C++.

Definition at line 680 of file gnc-optiondb.hpp.

685{
686 gnc_register_invoice_option(db.get(), section, name, key,
687 doc_string, value);
688}
void gnc_register_invoice_option(GncOptionDB *db, const char *section, const char *name, const char *key, const char *doc_string, GncInvoice *value)
Create a new invoice option and register it in the options database.

◆ gnc_register_invoice_option() [2/2]

void gnc_register_invoice_option ( GncOptionDB db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
GncInvoice *  value 
)

Create a new invoice option and register it in the options database.

Parameters
dbA GncOptionDB* for calling from C. Caller retains ownership.
sectionThe database section for the option.
nameThe option name.
keyA short tag used to sort the controls in the dialog.
doc_stringA description of the option. This will be used in tooltips and should be marked for translation.
valueThe initial and default value for the option.

Definition at line 915 of file gnc-optiondb.cpp.

918{
919 GncOption option{GncOptionQofInstanceValue{section, name, key, doc_string,
920 (const QofInstance*)value,
921 GncOptionUIType::INVOICE}};
922 db->register_option(section, std::move(option));
923}

◆ gnc_register_invoice_print_report_option() [1/2]

void gnc_register_invoice_print_report_option ( const GncOptionDBPtr &  db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
std::string  value 
)
inline

As above but takes a const GncOptionDBPtr& (const std::unique_ptr<GncOptionDB>&) for calling from C++.

Definition at line 733 of file gnc-optiondb.hpp.

737{
738 gnc_register_invoice_print_report_option(db.get(), section, name, key,
739 doc_string, value);
740}

◆ gnc_register_invoice_print_report_option() [2/2]

void gnc_register_invoice_print_report_option ( GncOptionDB db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
std::string  value 
)

Create a new print report option and register it in the options database.

Parameters
dbA GncOptionDB* for calling from C. Caller retains ownership.
sectionThe database section for the option.
nameThe option name.
doc_stringA description of the option. This will be used in tooltips and should be marked for translation.
valueThe initial and default value for the option.

Definition at line 937 of file gnc-optiondb.cpp.

940{
941 GncOption option{section, name, key, doc_string,
942 value, GncOptionUIType::INV_REPORT};
943 db->register_option(section, std::move(option));
944}

◆ gnc_register_list_option() [1/2]

void gnc_register_list_option ( GncOptionDB db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
const char *  value,
GncMultichoiceOptionChoices &&  list 
)

Create a new list option and register it in the options database.

Parameters
dbA GncOptionDB* for calling from C. Caller retains ownership.
sectionThe database section for the option.
nameThe option name.
keyA short tag used to sort the controls in the dialog.
doc_stringA description of the option. This will be used in tooltips and should be marked for translation.
valueThe initial and default value for the option.
listThe values available for selection. Note that this parameter will be moved from so using it after this call will result in undefined behavior.

Definition at line 831 of file gnc-optiondb.cpp.

835{
836 GncOption option{GncOptionMultichoiceValue{section, name, key, doc_string,
837 value, std::move(list), GncOptionUIType::LIST}};
838 db->register_option(section, std::move(option));
839}
Multichoice options have a vector of valid options (GncMultichoiceOptionChoices) and validate the sel...

◆ gnc_register_list_option() [2/2]

void gnc_register_list_option ( GncOptionDBPtr &  db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
const char *  value,
GncMultichoiceOptionChoices &&  list 
)
inline

As above but takes a const GncOptionDBPtr& (const std::unique_ptr<GncOptionDB>&) for calling from C++.

Definition at line 431 of file gnc-optiondb.hpp.

435{
436 gnc_register_list_option(db.get(), section, name, key, doc_string,
437 value, std::move(list));
438}
void gnc_register_list_option(GncOptionDB *db, const char *section, const char *name, const char *key, const char *doc_string, const char *value, GncMultichoiceOptionChoices &&list)
Create a new list option and register it in the options database.

◆ gnc_register_multichoice_option() [1/2]

void gnc_register_multichoice_option ( GncOptionDB db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
const char *  default_val,
GncMultichoiceOptionChoices &&  value 
)

Create a new multichoice option and register it in the options database.

Parameters
dbA GncOptionDB* for calling from C. Caller retains ownership.
sectionThe database section for the option.
nameThe option name.
keyA short tag used to sort the controls in the dialog.
doc_stringA description of the option. This will be used in tooltips and should be marked for translation.
valueThe set of possible values for the option. Only one can be selected. Note that the value will be moved from the parameter and using the parameter after this call will result in undefined behavior.

Definition at line 812 of file gnc-optiondb.cpp.

816{
817 std::string defval{default_val};
818 auto found{std::find_if(choices.begin(), choices.end(),
819 [&defval](auto& choice)->bool {
820 return defval == std::get<0>(choice);
821 })};
822 if (found == choices.end())
823 defval = (choices.empty() ? std::string{"None"} :
824 std::get<0>(choices.at(0)));
825 GncOption option{GncOptionMultichoiceValue{section, name, key, doc_string,
826 defval.c_str(), std::move(choices)}};
827 db->register_option(section, std::move(option));
828}

◆ gnc_register_multichoice_option() [2/2]

void gnc_register_multichoice_option ( GncOptionDBPtr &  db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
const char *  default_val,
GncMultichoiceOptionChoices &&  value 
)
inline

As above but takes a const GncOptionDBPtr& (const std::unique_ptr<GncOptionDB>&) for calling from C++.

Definition at line 401 of file gnc-optiondb.hpp.

406{
407 gnc_register_multichoice_option(db.get(), section, name,
408 key, doc_string, default_val,
409 std::move(value));
410}
void gnc_register_multichoice_option(GncOptionDB *db, const char *section, const char *name, const char *key, const char *doc_string, const char *default_val, GncMultichoiceOptionChoices &&value)
Create a new multichoice option and register it in the options database.

◆ gnc_register_number_plot_size_option() [1/4]

void gnc_register_number_plot_size_option ( const GncOptionDBPtr &  db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
float  value 
)
inline

Definition at line 518 of file gnc-optiondb.hpp.

524{
525 gnc_register_number_plot_size_option(db.get(), section, name, key,
526 doc_string, static_cast<int>(value));
527}
void gnc_register_number_plot_size_option(GncOptionDB *db, const char *section, const char *name, const char *key, const char *doc_string, int value)
Create a new plot-size option and register it in the options database.

◆ gnc_register_number_plot_size_option() [2/4]

void gnc_register_number_plot_size_option ( const GncOptionDBPtr &  db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
int  value 
)
inline

As above but takes a const GncOptionDBPtr& (const std::unique_ptr<GncOptionDB>&) for calling from C++.

Definition at line 507 of file gnc-optiondb.hpp.

513{
514 gnc_register_number_plot_size_option(db.get(), section, name, key,
515 doc_string, value);
516}

◆ gnc_register_number_plot_size_option() [3/4]

void gnc_register_number_plot_size_option ( GncOptionDB db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
float  value 
)
inline

Definition at line 493 of file gnc-optiondb.hpp.

498{
499 gnc_register_number_plot_size_option(db, section, name, key,
500 doc_string, static_cast<int>(value));
501}

◆ gnc_register_number_plot_size_option() [4/4]

void gnc_register_number_plot_size_option ( GncOptionDB db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
int  value 
)

Create a new plot-size option and register it in the options database.

Parameters
dbA GncOptionDB* for calling from C. Caller retains ownership.
sectionThe database section for the option.
nameThe option name.
keyA short tag used to sort the controls in the dialog.
doc_stringA description of the option. This will be used in tooltips and should be marked for translation.
valueThe initial and default value for the option.

Definition at line 865 of file gnc-optiondb.cpp.

869{
870//65K is 10x reasonable, but it's a convenient constant.
871 GncOption option{GncOptionRangeValue<int>{section, name, key, doc_string,
872 value, 10, UINT16_MAX, 1, GncOptionUIType::PLOT_SIZE}};
873 db->register_option(section, std::move(option));
874}

◆ gnc_register_number_range_option() [1/2]

template<typename ValueType >
void gnc_register_number_range_option ( GncOptionDB db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
ValueType  value,
ValueType  min,
ValueType  max,
ValueType  step 
)

Create a new number range option and register it in the options database.

These are normally associated with spin controls and ValueType is normally double, but it's templated to permit other numeric types if needed.

Parameters
dbA GncOptionDB* for calling from C. Caller retains ownership.
sectionThe database section for the option.
nameThe option name.
keyA short tag used to sort the controls in the dialog.
doc_stringA description of the option. This will be used in tooltips and should be marked for translation.
valueThe initial and default value for the option.
minThe minimum value for the spin control.
maxThe maximum value for the spin control.
stepThe step size (increment) of the spin control.

Definition at line 845 of file gnc-optiondb.cpp.

849{
850 try
851 {
852 GncOption option{GncOptionRangeValue<ValueType>{section, name, key,
853 doc_string, value, min,
854 max, step}};
855 db->register_option(section, std::move(option));
856 }
857 catch(const std::invalid_argument& err)
858 {
859 PWARN("Number Range Option %s, option not registerd.",
860 err.what());
861 }
862}

◆ gnc_register_number_range_option() [2/2]

template<typename ValueType >
void gnc_register_number_range_option ( GncOptionDBPtr &  db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
ValueType  value,
ValueType  min,
ValueType  max,
ValueType  step 
)

As above but takes a const GncOptionDBPtr& (const std::unique_ptr<GncOptionDB>&) for calling from C++.

Definition at line 466 of file gnc-optiondb.hpp.

471{
472 gnc_register_number_range_option<ValueType>(db.get(), section, name,
473 key, doc_string, value,
474 min, max, step);
475}

◆ gnc_register_owner_option() [1/2]

void gnc_register_owner_option ( GncOptionDB db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
const GncOwner value,
GncOwnerType  type 
)

Create a new GncOwner option and register it in the options database.

Parameters
dbA GncOptionDB* for calling from C. Caller retains ownership.
sectionThe database section for the option.
nameThe option name.
keyA short tag used to sort the controls in the dialog.
doc_stringA description of the option. This will be used in tooltips and should be marked for translation.
valueThe initial and default value for the option.
typeThe type of owner, determines the UI type.

Definition at line 886 of file gnc-optiondb.cpp.

890{
891 GncOptionUIType uitype;
892 switch (type)
893 {
894 case GNC_OWNER_CUSTOMER:
895 uitype = GncOptionUIType::CUSTOMER;
896 break;
897 case GNC_OWNER_EMPLOYEE:
898 uitype = GncOptionUIType::EMPLOYEE;
899 break;
900 case GNC_OWNER_JOB:
901 uitype = GncOptionUIType::JOB;
902 break;
903 case GNC_OWNER_VENDOR:
904 uitype = GncOptionUIType::VENDOR;
905 break;
906 default:
907 uitype = GncOptionUIType::INTERNAL;
908 };
909 GncOption option{GncOptionGncOwnerValue{section, name, key, doc_string,
910 value, uitype}};
911 db->register_option(section, std::move(option));
912}
GncOptionUIType
Used by GncOptionClassifier to indicate to dialog-options what control should be displayed for the op...

◆ gnc_register_owner_option() [2/2]

void gnc_register_owner_option ( GncOptionDBPtr &  db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
const GncOwner value,
GncOwnerType  type 
)
inline

As above but takes a const GncOptionDBPtr& (const std::unique_ptr<GncOptionDB>&) for calling from C++.

Definition at line 571 of file gnc-optiondb.hpp.

576{
577 gnc_register_owner_option(db.get(), section, name, key, doc_string, value, type);
578}
void gnc_register_owner_option(GncOptionDB *db, const char *section, const char *name, const char *key, const char *doc_string, const GncOwner *value, GncOwnerType type)
Create a new GncOwner option and register it in the options database.

◆ gnc_register_pixmap_option() [1/2]

void gnc_register_pixmap_option ( GncOptionDB db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
std::string  value 
)

Create a new pixmap option and register it in the options database.

Parameters
dbA GncOptionDB* for calling from C. Caller retains ownership.
sectionThe database section for the option.
nameThe option name.
keyA short tag used to sort the controls in the dialog.
doc_stringA description of the option. This will be used in tooltips and should be marked for translation.
valueThe initial and default value for the option.

Definition at line 725 of file gnc-optiondb.cpp.

728{
729 GncOption option{section, name, key, doc_string, value,
730 GncOptionUIType::PIXMAP};
731 db->register_option(section, std::move(option));
732}

◆ gnc_register_pixmap_option() [2/2]

void gnc_register_pixmap_option ( GncOptionDBPtr &  db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
std::string  value 
)
inline

As above but takes a const GncOptionDBPtr& (const std::unique_ptr<GncOptionDB>&) for calling from C++.

Definition at line 279 of file gnc-optiondb.hpp.

283{
284 gnc_register_pixmap_option(db.get(), section, name, key, doc_string, value);
285}
void gnc_register_pixmap_option(GncOptionDB *db, const char *section, const char *name, const char *key, const char *doc_string, std::string value)
Create a new pixmap option and register it in the options database.

◆ gnc_register_query_option() [1/2]

void gnc_register_query_option ( GncOptionDB db,
const char *  section,
const char *  name,
const QofQuery value 
)

Create a new QofQuery option and register it in the options database.

Query options have no UI component so they don't get a key or a docstring.

Parameters
dbA GncOptionDB* for calling from C. Caller retains ownership.
sectionThe database section for the option.
nameThe option name.
valueThe initial and default value for the option.

Definition at line 877 of file gnc-optiondb.cpp.

879{
880 GncOption option{section, name, "", "", value,
881 GncOptionUIType::INTERNAL};
882 db->register_option(section, std::move(option));
883}

◆ gnc_register_query_option() [2/2]

void gnc_register_query_option ( GncOptionDBPtr &  db,
const char *  section,
const char *  name,
const QofQuery value 
)
inline

As above but takes a const GncOptionDBPtr& (const std::unique_ptr<GncOptionDB>&) for calling from C++.

Definition at line 545 of file gnc-optiondb.hpp.

548{
549 gnc_register_query_option(db.get(), section, name, value);
550}
void gnc_register_query_option(GncOptionDB *db, const char *section, const char *name, const QofQuery *value)
Create a new QofQuery option and register it in the options database.

◆ gnc_register_report_placement_option()

void gnc_register_report_placement_option ( GncOptionDBPtr &  db,
const char *  section,
const char *  name 
)

Definition at line 1101 of file gnc-optiondb.cpp.

1103{
1104 /* This is a special option with it's own UI file so we have fake values to pass
1105 * to the template creation function.
1106 */
1107 GncOptionReportPlacementVec value;
1109 "no_key", "nodoc_string",
1110 value,GncOptionUIType::REPORT_PLACEMENT}};
1111 db->register_option(section, std::move(option));
1112}

◆ gnc_register_simple_boolean_option() [1/2]

void gnc_register_simple_boolean_option ( const GncOptionDBPtr &  db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
bool  value 
)
inline

As above but takes a const GncOptionDBPtr& (const std::unique_ptr<GncOptionDB>&) for calling from C++.

Definition at line 251 of file gnc-optiondb.hpp.

257{
258 gnc_register_simple_boolean_option(db.get(), section, name, key,
259 doc_string, value);
260}

◆ gnc_register_simple_boolean_option() [2/2]

void gnc_register_simple_boolean_option ( GncOptionDB db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
bool  value 
)

Create a new simple boolean option and register it in the options database.

Parameters
dbA GncOptionDB* for calling from C. Caller retains ownership.
sectionThe database section for the option.
nameThe option name.
keyA short tag used to sort the controls in the dialog.
doc_stringA description of the option. This will be used in tooltips and should be marked for translation.
valueThe initial and default value for the option.

Definition at line 714 of file gnc-optiondb.cpp.

718{
719 GncOption option{section, name, key, doc_string, value,
720 GncOptionUIType::BOOLEAN};
721 db->register_option(section, std::move(option));
722}

◆ gnc_register_start_date_option() [1/2]

void gnc_register_start_date_option ( GncOptionDB db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
bool  both = true 
)

Create a new start-date option and register it in the options database.

Parameters
dbA GncOptionDB* for calling from C. Caller retains ownership.
sectionThe database section for the option.
nameThe option name.
keyA short tag used to sort the controls in the dialog.
doc_stringA description of the option. This will be used in tooltips and should be marked for translation.
bothWhether to display both a relative and absolute control or a onla a relative control.

Definition at line 1065 of file gnc-optiondb.cpp.

1068{
1069 auto ui_type = both ? GncOptionUIType::DATE_BOTH :
1070 GncOptionUIType::DATE_RELATIVE;
1071 GncOption option{GncOptionDateValue(section, name, key, doc_string,
1072 ui_type, begin_dates)};
1073 db->register_option(section, std::move(option));
1074}

◆ gnc_register_start_date_option() [2/2]

void gnc_register_start_date_option ( GncOptionDBPtr &  db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
bool  both = true 
)
inline

As above but takes a const GncOptionDBPtr& (const std::unique_ptr<GncOptionDB>&) for calling from C++.

Definition at line 940 of file gnc-optiondb.hpp.

944{
945 gnc_register_start_date_option(db.get(), section, name, key, doc_string,
946 both);
947}
void gnc_register_start_date_option(GncOptionDB *db, const char *section, const char *name, const char *key, const char *doc_string, bool both=true)
Create a new start-date option and register it in the options database.

◆ gnc_register_string_option() [1/2]

void gnc_register_string_option ( const GncOptionDBPtr &  db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
std::string  value 
)
inline

As above but takes a const GncOptionDBPtr& (const std::unique_ptr<GncOptionDB>&) for calling from C++.

Definition at line 99 of file gnc-optiondb.hpp.

103{
104 gnc_register_string_option(db.get(), section, name, key,
105 doc_string, value);
106}

◆ gnc_register_string_option() [2/2]

void gnc_register_string_option ( GncOptionDB db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
std::string  value 
)

Create a new string option and register it in the options database.

Parameters
dbA GncOptionDB* for calling from C. Caller retains ownership.
sectionThe database section for the option.
nameThe option name.
keyA short tag used to sort the controls in the dialog.
doc_stringA description of the option. This will be used in tooltips and should be marked for translation.
valueThe initial and default value for the option.

Definition at line 626 of file gnc-optiondb.cpp.

629{
630 GncOption option{section, name, key, doc_string, value,
631 GncOptionUIType::STRING};
632 db->register_option(section, std::move(option));
633}

◆ gnc_register_taxtable_option() [1/2]

void gnc_register_taxtable_option ( const GncOptionDBPtr &  db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
GncTaxTable value 
)
inline

As above but takes a const GncOptionDBPtr& (const std::unique_ptr<GncOptionDB>&) for calling from C++.

Definition at line 707 of file gnc-optiondb.hpp.

712{
713 gnc_register_taxtable_option(db.get(), section, name, key,
714 doc_string, value);
715}

◆ gnc_register_taxtable_option() [2/2]

void gnc_register_taxtable_option ( GncOptionDB db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
GncTaxTable value 
)

Create a new taxtable option and register it in the options database.

Parameters
dbA GncOptionDB* for calling from C. Caller retains ownership.
sectionThe database section for the option.
nameThe option name.
keyA short tag used to sort the controls in the dialog.
doc_stringA description of the option. This will be used in tooltips and should be marked for translation.
valueThe initial and default value for the option.

Definition at line 926 of file gnc-optiondb.cpp.

929{
930 GncOption option{GncOptionQofInstanceValue{section, name, key, doc_string,
931 (const QofInstance*)value,
932 GncOptionUIType::TAX_TABLE}};
933 db->register_option(section, std::move(option));
934}

◆ gnc_register_text_option() [1/2]

void gnc_register_text_option ( const GncOptionDBPtr &  db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
std::string  value 
)
inline

As above but takes a const GncOptionDBPtr& (const std::unique_ptr<GncOptionDB>&) for calling from C++.

Definition at line 125 of file gnc-optiondb.hpp.

129{
130 gnc_register_text_option(db.get(), section, name, key, doc_string, value);
131}

◆ gnc_register_text_option() [2/2]

void gnc_register_text_option ( GncOptionDB db,
const char *  section,
const char *  name,
const char *  key,
const char *  doc_string,
std::string  value 
)

Create a new text option and register it in the options database.

Parameters
dbA GncOptionDB* for calling from C. Caller retains ownership.
sectionThe database section for the option.
nameThe option name.
keyA short tag used to sort the controls in the dialog.
doc_stringA description of the option. This will be used in tooltips and should be marked for translation.
valueThe initial and default value for the option.

Definition at line 636 of file gnc-optiondb.cpp.

639{
640 GncOption option{section, name, key, doc_string, value,
641 GncOptionUIType::TEXT};
642 db->register_option(section, std::move(option));
643
644}

◆ gnc_relative_date_description()

const char * gnc_relative_date_description ( RelativeDatePeriod  per)

Provide the description of a relative date.

This string is localizable.

Parameters
periodThe relative date period.
Returns
A constant string or nullptr if the period is ABSOLUTE. The string's lifetime will be that of the Relative Date Period. It must not be freed and should be copied if the period might be destroyed before the using code is finished.

Definition at line 374 of file gnc-option-date.cpp.

375{
376 if (per == RelativeDatePeriod::ABSOLUTE)
377 return nullptr;
378 return checked_reldate(per).m_description;
379}

◆ gnc_relative_date_display_string()

const char * gnc_relative_date_display_string ( RelativeDatePeriod  per)

Provide the string representation of a relative date for displaying value to a user.

This string is localizable.

Parameters
periodThe relative date period.
Returns
A constant string or nullptr if the period is ABSOLUTE. The string's lifetime will be that of the Relative Date Period. It must not be freed and should be copied if the period might be destroyed before the using code is finished.

Definition at line 367 of file gnc-option-date.cpp.

368{
369 if (per == RelativeDatePeriod::ABSOLUTE)
370 return nullptr;
371 return checked_reldate(per).m_display;
372}

◆ gnc_relative_date_from_storage_string()

RelativeDatePeriod gnc_relative_date_from_storage_string ( const char *  str)

Convert a relative date storage string back to a RelativeDatePeriod value.

Parameters
Astring representation obtained from gnc_relative_date_storage_string.
Returns
A RelativeDatePeriod value.

Definition at line 382 of file gnc-option-date.cpp.

383{
384 auto per = std::find_if(reldates.begin(), reldates.end(),
385 [str](auto rel) -> bool
386 {
387 return strcmp(str, rel.m_storage) == 0;
388 });
389 return per != reldates.end() ? per->m_period : RelativeDatePeriod::ABSOLUTE;
390}

◆ gnc_relative_date_is_ending()

bool gnc_relative_date_is_ending ( RelativeDatePeriod  per)

Report whether the relative date represents the end of a date range.

For example END_LAST_MONTH is the end of a range.

Parameters
periodThe Relative Date Period to check.
Returns
true if the date is the end of a date range.

Definition at line 351 of file gnc-option-date.cpp.

352{
353 if (per == RelativeDatePeriod::ABSOLUTE)
354 return false;
355 return checked_reldate(per).m_type == RelativeDateType::END;
356}

◆ gnc_relative_date_is_single()

bool gnc_relative_date_is_single ( RelativeDatePeriod  per)

Report whether the relative date represents a period offset to today's date rather than the beginning or end of a date range.

For example ONE_MONTH_AGO will be made concrete as the same day as today in the previous month.

Parameters
periodThe Relative Date Period to check.
Returns
true if the date is stand-alone.

Definition at line 333 of file gnc-option-date.cpp.

334{
335 if (per == RelativeDatePeriod::ABSOLUTE)
336 return false;
337 auto reldate = checked_reldate(per);
338 return reldate.m_type == RelativeDateType::LAST ||
339 reldate.m_type == RelativeDateType::NEXT;
340}

◆ gnc_relative_date_is_starting()

bool gnc_relative_date_is_starting ( RelativeDatePeriod  per)

Report whether the relative date represents the beginning of a date range.

For example START_LAST_MONTH is the beginning of a range.

Parameters
periodThe Relative Date Period to check.
Returns
true if the date is the beginning of a date range

Definition at line 343 of file gnc-option-date.cpp.

344{
345 if (per == RelativeDatePeriod::ABSOLUTE)
346 return false;
347 return checked_reldate(per).m_type == RelativeDateType::START;
348}

◆ gnc_relative_date_storage_string()

const char * gnc_relative_date_storage_string ( RelativeDatePeriod  per)

Provide the string representation of a relative date for persisting the value.

This string is not localizable.

Parameters
periodThe relative date period.
Returns
A constant string or nullptr if the period is ABSOLUTE. The string's lifetime will be that of the Relative Date Period. It must not be freed and should be copied if the period might be destroyed before the using code is finished.

Definition at line 359 of file gnc-option-date.cpp.

360{
361 if (per == RelativeDatePeriod::ABSOLUTE)
362 return nullptr;
363 return checked_reldate(per).m_storage;
364}

◆ gnc_relative_date_to_time64()

time64 gnc_relative_date_to_time64 ( RelativeDatePeriod  period,
time64  now_t = static_cast< time64 >(GncDateTime()) 
)

Convert a RelativeDatePeriod value to a concrete time64 by applying the value to the current time.

For example if it is now 3:15:42 PM local time 3 June, calling this with a period RelativeDatePeriod::ONE_WEEK_AHEAD will return a time64 representing 3:15:42 PM local time 10 June of this year. Times for START periods are changed to midnight local time and for END periods to 23:59:59 local time so for example if the period is instead RelativeDatePeriod::START_THIS_MONTH the time64 will represent 00:00:00 1 June and if it is RelativeDatePeriod::END_THIS_MONTH the time64 will be for 23:59:59 30 June, both in the current time zone.

Parameters
periodThe relative date period to use to calculate the concrete date.
now_tOptional "now" date. Primarily for testing.
Returns
a time64.

Definition at line 519 of file gnc-option-date.cpp.

520{
521 if (period == RelativeDatePeriod::TODAY)
522 return now_t;
523 if (period == RelativeDatePeriod::START_ACCOUNTING_PERIOD)
524 return gnc_accounting_period_fiscal_start();
525 if (period == RelativeDatePeriod::END_ACCOUNTING_PERIOD)
526 return gnc_accounting_period_fiscal_end();
527
528 auto now{static_cast<tm>(GncDateTime(now_t))};
529 struct tm acct_per =
530 static_cast<tm>(GncDateTime(gnc_accounting_period_fiscal_start()));
531 auto offset = reldate_offset(period);
532 bool is_offset_quarter =
533 offset == RelativeDateOffset::QUARTER && acct_per.tm_mday > 1;
534
535 switch(offset)
536 {
537 case RelativeDateOffset::NONE:
538 // Report on today so nothing to do
539 break;
540 case RelativeDateOffset::YEAR:
541 if (reldate_is_prev(period))
542 --now.tm_year;
543 else if (reldate_is_next(period))
544 ++now.tm_year;
546 now.tm_mon = 0;
547 else if (gnc_relative_date_is_ending(period))
548 now.tm_mon = 11;
549 break;
550 case RelativeDateOffset::SIX:
551 if (reldate_is_prev(period))
552 now.tm_mon -= 6;
553 else if (reldate_is_next(period))
554 now.tm_mon += 6;
555 break;
556 case RelativeDateOffset::QUARTER:
557 {
558 auto delta = (12 + now.tm_mon - acct_per.tm_mon) % 3;
559 if (is_offset_quarter)
560 {
561 if (delta == 0 && !is_last_day_in_month(now) &&
562 (is_last_day_in_month(acct_per) ||
563 now.tm_mday < acct_per.tm_mday))
564 delta = 3;
565 if (gnc_relative_date_is_ending(period))
566 --delta;
567 }
568 now.tm_mon -= delta;
569 }
570 [[fallthrough]];
571 case RelativeDateOffset::THREE:
572 if (reldate_is_prev(period))
573 now.tm_mon -= 3;
574 else if (reldate_is_next(period))
575 now.tm_mon += 3;
576 if (gnc_relative_date_is_ending(period))
577 now.tm_mon += 2;
578 break;
579 case RelativeDateOffset::MONTH:
580 if (reldate_is_prev(period))
581 --now.tm_mon;
582 else if (reldate_is_next(period))
583 ++now.tm_mon;
584 break;
585 case RelativeDateOffset::WEEK:
586 if (reldate_is_prev(period))
587 now.tm_mday -= 7;
588 else if (reldate_is_next(period))
589 now.tm_mday += 7;
590 }
591 reldate_set_day_and_time( now,
592 checked_reldate(period).m_type,
593 is_offset_quarter,
594 acct_per);
595 normalize_reldate_tm(now);
596 return static_cast<time64>(GncDateTime(now));
597}
GnuCash DateTime class.
gint64 time64
Most systems that are currently maintained, including Microsoft Windows, BSD-derived Unixes and Linux...
Definition gnc-date.h:87
bool gnc_relative_date_is_ending(RelativeDatePeriod per)
Report whether the relative date represents the end of a date range.
bool gnc_relative_date_is_starting(RelativeDatePeriod per)
Report whether the relative date represents the beginning of a date range.

◆ operator<() [1/2]

bool operator< ( const GncOption right,
const GncOption left 
)
inline

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

223{
224 return right.get_key() < left.get_key();
225}

◆ operator<() [2/2]

bool operator< ( const GncOptionSectionPtr &  right,
const GncOptionSectionPtr &  left 
)
inline

Definition at line 77 of file gnc-optiondb-impl.hpp.

79{
80 return right->get_name() < left->get_name();
81}

◆ operator<<() [1/4]

std::ostream & operator<< ( std::ostream &  ostr,
const RelativeDatePeriod  per 
)

Add the display string to the provided std::ostream.

Parameters
streamthe std::ostream to which to write the period value
periodthe period value to write
Returns
A reference to stream so that the operator can be chained.

Definition at line 599 of file gnc-option-date.cpp.

601{
602 ostr << "'reldate . " << gnc_relative_date_display_string(per);
603 return ostr;
604}
const char * gnc_relative_date_display_string(RelativeDatePeriod per)
Provide the string representation of a relative date for displaying value to a user.

◆ operator<<() [2/4]

std::ostream & operator<< ( std::ostream &  oss,
const GncOption opt 
)
inline

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

229{
230 oss << opt.serialize();
231 return oss;
232}
std::string serialize() const
Get a string suitable for storage representing the option's value.

◆ operator<<() [3/4]

std::ostream & operator<< ( std::ostream &  oss,
const GncOptionCommodityValue opt 
)
inline

Definition at line 322 of file gnc-option-impl.hpp.

324{
325 oss << opt.serialize();
326 return oss;
327}

◆ operator<<() [4/4]

template<class OptType , typename std::enable_if_t< is_OptionClassifier_v< OptType > &&!(is_QofInstanceValue_v< OptType >||is_RangeValue_v< OptType >), int > = 0>
std::ostream & operator<< ( std::ostream &  oss,
const OptType &  opt 
)
inline

Definition at line 308 of file gnc-option-impl.hpp.

309{
310 oss << opt.get_value();
311 return oss;
312}

◆ operator<<< GncOptionAccountListValue >()

template<>
std::ostream & operator<<< GncOptionAccountListValue > ( std::ostream &  oss,
const GncOptionAccountListValue opt 
)
inline

Definition at line 892 of file gnc-option-impl.hpp.

895{
896 auto values{opt.get_value()};
897 bool first = true;
898 for (auto value : values)
899 {
900 if (first)
901 first = false;
902 else
903 oss << " ";
904 char strbuff[GUID_ENCODING_LENGTH+1];
905 guid_to_string_buff (&value, strbuff);
906 oss << strbuff;
907 }
908 return oss;
909}
#define GUID_ENCODING_LENGTH
Number of characters needed to encode a guid as a string not including the null terminator.
Definition guid.h:84
gchar * guid_to_string_buff(const GncGUID *guid, gchar *str)
The guid_to_string_buff() routine puts a null-terminated string encoding of the id into the memory po...
Definition guid.cpp:208

◆ operator<<< GncOptionAccountSelValue >()

template<>
std::ostream & operator<<< GncOptionAccountSelValue > ( std::ostream &  oss,
const GncOptionAccountSelValue opt 
)
inline

Definition at line 1010 of file gnc-option-impl.hpp.

1013{
1014 auto value{opt.get_value()};
1015 oss << qof_instance_to_string(QOF_INSTANCE(value));
1016 return oss;
1017}

◆ operator<<< GncOptionDateValue >()

template<>
std::ostream & operator<<< GncOptionDateValue > ( std::ostream &  oss,
const GncOptionDateValue opt 
)
inline

Definition at line 1167 of file gnc-option-impl.hpp.

1170{
1171 return opt.out_stream(oss);
1172}

◆ operator<<< GncOptionMultichoiceValue >()

template<>
std::ostream & operator<<< GncOptionMultichoiceValue > ( std::ostream &  oss,
const GncOptionMultichoiceValue opt 
)
inline

Definition at line 745 of file gnc-option-impl.hpp.

748{
749 auto vec{opt.get_multiple()};
750 bool first{true};
751 for (auto index : vec)
752 {
753 if (first)
754 first = false;
755 else
756 oss << " ";
757 oss << opt.permissible_value(index);
758 }
759 return oss;
760}

◆ operator<<< GncOptionValue< bool > >()

template<>
std::ostream & operator<<< GncOptionValue< bool > > ( std::ostream &  oss,
const GncOptionValue< bool > &  opt 
)
inline

Definition at line 314 of file gnc-option-impl.hpp.

317{
318 oss << (opt.get_value() ? "#t" : "#f");
319 return oss;
320}

◆ operator>>() [1/3]

std::istream & operator>> ( std::istream &  iss,
GncOption opt 
)
inline

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

236{
237 return opt.in_stream(iss);
238}
std::istream & in_stream(std::istream &iss)
Set the option's value from an input stream.

◆ operator>>() [2/3]

std::istream & operator>> ( std::istream &  iss,
GncOptionCommodityValue opt 
)

Definition at line 1023 of file gnc-option-impl.cpp.

1024{
1025 std::string instr;
1026 iss >> instr;
1027 if (!opt.deserialize(instr))
1028 throw std::invalid_argument("Invalid commodity string in stream.");
1029 return iss;
1030}

◆ operator>>() [3/3]

template<class OptType , typename std::enable_if_t< is_OptionClassifier_v< OptType > &&!(is_QofInstanceValue_v< OptType >||is_RangeValue_v< OptType >), int > = 0>
std::istream & operator>> ( std::istream &  iss,
OptType &  opt 
)
inline

Definition at line 343 of file gnc-option-impl.hpp.

344{
345 if constexpr (std::is_same_v<std::decay_t<decltype(opt.get_value())>, const _gncOwner*> ||
346 std::is_same_v<std::decay_t<decltype(opt.get_value())>, const _QofQuery*> ||
347 std::is_same_v<std::decay_t<decltype(opt.get_value())>, GncOptionDateFormat>)
348 return iss;
349 else
350 {
351 std::decay_t<decltype(opt.get_value())> value;
352 iss >> value;
353 opt.set_value(value);
354 return iss;
355 }
356}
A Query.
Definition qofquery.cpp:75

◆ operator>>< GncOptionAccountListValue >()

template<>
std::istream & operator>>< GncOptionAccountListValue > ( std::istream &  iss,
GncOptionAccountListValue opt 
)
inline

Definition at line 912 of file gnc-option-impl.hpp.

914{
915 GncOptionAccountList values;
916 while (true)
917 {
918 std::string str;
919 std::getline(iss, str, ' ');
920 if (!str.empty())
921 {
922 auto guid{qof_entity_get_guid(qof_instance_from_string(str, opt.get_ui_type()))};
923 values.push_back(*guid);
924 }
925 else
926 break;
927 }
928 opt.set_value(values);
929 iss.clear();
930 return iss;
931}
const GncGUID * qof_entity_get_guid(gconstpointer ent)

◆ operator>>< GncOptionAccountSelValue >()

template<>
std::istream & operator>>< GncOptionAccountSelValue > ( std::istream &  iss,
GncOptionAccountSelValue opt 
)
inline

Definition at line 1020 of file gnc-option-impl.hpp.

1022{
1023 Account* value{nullptr};
1024 std::string str;
1025 std::getline(iss, str, ' ');
1026 if (!str.empty())
1027 value = (Account*)qof_instance_from_string(str, opt.get_ui_type());
1028 opt.set_value(value);
1029 iss.clear();
1030 return iss;
1031}

◆ operator>>< GncOptionDateValue >()

template<>
std::istream & operator>>< GncOptionDateValue > ( std::istream &  iss,
GncOptionDateValue opt 
)
inline

Definition at line 1175 of file gnc-option-impl.hpp.

1177{
1178 return opt.in_stream(iss);
1179}

◆ operator>>< GncOptionMultichoiceValue >()

template<>
std::istream & operator>>< GncOptionMultichoiceValue > ( std::istream &  iss,
GncOptionMultichoiceValue opt 
)
inline

Definition at line 763 of file gnc-option-impl.hpp.

765{
766 GncMultichoiceOptionIndexVec values;
767 while (true)
768 {
769 std::string str;
770 std::getline(iss, str, ' ');
771 if (!str.empty())
772 {
773 auto index = opt.permissible_value_index(str.c_str());
774 if (index != uint16_t_max)
775 values.push_back(index);
776 else
777 {
778 std::string err = str + " is not one of ";
779 err += opt.m_name;
780 err += "'s permissible values.";
781 throw std::invalid_argument(err);
782 }
783 }
784 else
785 break;
786 }
787 opt.set_multiple(values);
788 iss.clear();
789 return iss;
790}

◆ operator>>< GncOptionValue< bool > >()

template<>
std::istream & operator>>< GncOptionValue< bool > > ( std::istream &  iss,
GncOptionValue< bool > &  opt 
)
inline

Definition at line 372 of file gnc-option-impl.hpp.

374{
375 std::string instr;
376 iss >> instr;
377 opt.set_value(instr == "#t" ? true : false);
378 return iss;
379}

◆ operator>>< GncOptionValue< GncOptionReportPlacementVec > >()

template<>
std::istream & operator>>< GncOptionValue< GncOptionReportPlacementVec > > ( std::istream &  iss,
GncOptionValue< GncOptionReportPlacementVec > &  opt 
)
inline

Definition at line 382 of file gnc-option-impl.hpp.

384{
385 uint32_t id, wide, high;
386 iss >> id >> wide >> high;
387 opt.set_value(GncOptionReportPlacementVec{{id, wide, high}});
388 return iss;
389}

◆ output_color_value()

std::ostream & output_color_value ( std::ostream &  oss,
const std::string &  value 
)
inline

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

242{
243 oss << "'(";
244 oss << std::fixed << std::showpoint << std::setprecision(1);
245 auto len{value.length() > 8 ? 8 : value.length()};
246 for (size_t i{}; i < len; i += 2)
247 {
248 oss << static_cast<float>(stoi(value.substr(i, 2), nullptr, 16));
249 if (i < 6)
250 oss << " ";
251 }
252 if (len < 8)
253 oss << 256.0;
254 oss << ")";
255 return oss;
256}

◆ qof_instance_from_guid()

QofInstance * qof_instance_from_guid ( GncGUID guid,
GncOptionUIType  type 
)

Definition at line 671 of file gnc-option-impl.cpp.

672{
673 QofIdType qof_type;
674 switch(type)
675 {
676 case GncOptionUIType::BUDGET:
677 qof_type = "Budget";
678 break;
679 case GncOptionUIType::JOB:
680 qof_type = "gncJob";
681 break;
682 case GncOptionUIType::CUSTOMER:
683 qof_type = "gncCustomer";
684 break;
685 case GncOptionUIType::VENDOR:
686 qof_type = "gncVendor";
687 break;
688 case GncOptionUIType::EMPLOYEE:
689 qof_type = "gncEmployee";
690 break;
691 case GncOptionUIType::INVOICE:
692 qof_type = "gncInvoice";
693 break;
694 case GncOptionUIType::TAX_TABLE:
695 qof_type = "gncTaxTable";
696 break;
697 case GncOptionUIType::ACCOUNT_LIST:
698 case GncOptionUIType::ACCOUNT_SEL:
699 default:
700 qof_type = "Account";
701 break;
702 }
703 auto book{get_current_book()};
704 auto col{qof_book_get_collection(book, qof_type)};
705 return QOF_INSTANCE(qof_collection_lookup_entity(col, guid));
706}
QofCollection * qof_book_get_collection(const QofBook *book, QofIdType entity_type)
Return The table of entities of the given type.
Definition qofbook.cpp:521
QofInstance * qof_collection_lookup_entity(const QofCollection *col, const GncGUID *guid)
Find the entity going only from its guid.
Definition qofid.cpp:209
const gchar * QofIdType
QofIdType declaration.
Definition qofid.h:80

◆ qof_instance_from_string()

QofInstance * qof_instance_from_string ( const std::string &  str,
GncOptionUIType  type 
)

Definition at line 709 of file gnc-option-impl.cpp.

710{
711 QofInstance* retval{nullptr};
712 try {
713 auto guid{static_cast<GncGUID>(gnc::GUID::from_string(str))};
714 retval = qof_instance_from_guid(&guid, type);
715 }
716 catch (const gnc::guid_syntax_exception& err)
717 {
718 PWARN("Failed to convert %s to a GUID", str.c_str());
719 }
720 return retval;
721}
The type used to store guids in C.
Definition guid.h:75

◆ qof_instance_to_string()

std::string qof_instance_to_string ( const QofInstance inst)

Definition at line 724 of file gnc-option-impl.cpp.

725{
726 std::string retval;
727 gnc::GUID guid{*qof_instance_get_guid(inst)};
728 retval = guid.to_string();
729 return retval;
730}
const GncGUID * qof_instance_get_guid(gconstpointer inst)
Return the GncGUID of this instance.

Variable Documentation

◆ classifier_size_max

size_t constexpr classifier_size_max {50}
constexpr

Definition at line 59 of file gnc-option-impl.hpp.

59{50};

◆ is_GncOwnerValue_v

template<typename T >
constexpr bool is_GncOwnerValue_v = is_GncOwnerValue<T>::value
inlineconstexpr

Definition at line 274 of file gnc-option-impl.hpp.

◆ is_OptionClassifier_v

template<typename T >
constexpr bool is_OptionClassifier_v = is_OptionClassifier<T>::value
inlineconstexpr

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

◆ is_QofInstanceValue_v

template<typename T >
constexpr bool is_QofInstanceValue_v = is_QofInstanceValue<T>::value
inlineconstexpr

Definition at line 284 of file gnc-option-impl.hpp.

◆ is_QofQueryValue_v

template<typename T >
constexpr bool is_QofQueryValue_v = is_QofQueryValue<T>::value
inlineconstexpr

Definition at line 294 of file gnc-option-impl.hpp.

◆ is_RangeValue_v

template<typename T >
constexpr bool is_RangeValue_v = is_RangeValue<T>::value
inlineconstexpr

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

◆ is_same_decayed_v

template<typename T , typename U >
constexpr bool is_same_decayed_v = is_same_decayed<T, U>::value
inlineconstexpr

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

◆ relative_date_periods

constexpr unsigned relative_date_periods
constexpr
Initial value:
=
static_cast<unsigned>(RelativeDatePeriod::END_ACCOUNTING_PERIOD) + 2

Definition at line 80 of file gnc-option-date.hpp.

◆ sort_tag_size_max

size_t constexpr sort_tag_size_max {10}
constexpr

Definition at line 60 of file gnc-option-impl.hpp.

60{10};

◆ uint16_t_max

auto constexpr uint16_t_max = std::numeric_limits<uint16_t>::max()
constexpr

Definition at line 80 of file gnc-option-impl.hpp.