GnuCash
5.6-150-g038405b370+
|
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 More... | |
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 |
A Query. | |
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 | 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 | 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. | |
enum | 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. More... | |
bool | gnc_relative_date_is_starting (RelativeDatePeriod) |
Report whether the relative date represents the beginning of a date range. More... | |
bool | gnc_relative_date_is_ending (RelativeDatePeriod) |
Report whether the relative date represents the end of a date range. More... | |
const char * | gnc_relative_date_storage_string (RelativeDatePeriod) |
Provide the string representation of a relative date for persisting the value. More... | |
const char * | gnc_relative_date_display_string (RelativeDatePeriod) |
Provide the string representation of a relative date for displaying value to a user. More... | |
const char * | gnc_relative_date_description (RelativeDatePeriod) |
Provide the description of a relative date. More... | |
RelativeDatePeriod | gnc_relative_date_from_storage_string (const char *) |
Convert a relative date storage string back to a RelativeDatePeriod value. More... | |
time64 | gnc_relative_date_to_time64 (RelativeDatePeriod) |
Convert a RelativeDatePeriod value to a concrete time64 by applying the value to the current time. More... | |
std::ostream & | operator<< (std::ostream &, const RelativeDatePeriod) |
Add the display string to the provided std::ostream. More... | |
QofInstance * | qof_instance_from_string (const std::string &str, GncOptionUIType type) |
QofInstance * | qof_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 > | |
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. More... | |
bool | operator< (const GncOptionSectionPtr &right, const GncOptionSectionPtr &left) |
GncOptionDB * | gnc_option_db_new (void) |
Create an empty option database. More... | |
void | gnc_option_db_destroy (GncOptionDB *odb) |
Destruct and release a GncOptionDB. More... | |
GList * | gnc_option_db_commit (GncOptionDB *odb) |
Write all changed ui_item values to their options. More... | |
void | gnc_option_db_clean (GncOptionDB *odb) |
Reset all ui_items to the option value. More... | |
void | gnc_option_db_load (GncOptionDB *odb, QofBook *book) |
Load a book's options into the GncOptionDB. More... | |
void | gnc_option_db_save (GncOptionDB *odb, QofBook *book, gboolean clear_options) |
Save the GncOptionDB contents into a book's options store. More... | |
void | gnc_option_db_book_options (GncOptionDB *) |
Register the standard option set for a QofBook. More... | |
const QofInstance * | gnc_option_db_lookup_qofinstance_value (GncOptionDB *, const char *, const char *) |
Retrieve the QofInstance value of an option in the GncOptionDB. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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 |
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.
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.
|
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.
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.
book | The book whose accounts to search |
types | A std::vector of GNCAccountType containing the Account types to include in ther result |
Definition at line 779 of file gnc-optiondb.cpp.
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.
void gnc_option_db_book_options | ( | GncOptionDB * | ) |
Register the standard option set for a QofBook.
odb | The GncOptionDB |
Definition at line 1198 of file gnc-optiondb.cpp.
void gnc_option_db_clean | ( | GncOptionDB * | odb | ) |
Reset all ui_items to the option value.
odb | The GncOptionDB. |
Definition at line 1174 of file gnc-optiondb.cpp.
GList* gnc_option_db_commit | ( | GncOptionDB * | odb | ) |
Write all changed ui_item values to their options.
odb | The GncOptionDB. |
Definition at line 1148 of file gnc-optiondb.cpp.
void gnc_option_db_destroy | ( | GncOptionDB * | odb | ) |
Destruct and release a GncOptionDB.
odb | The GncOptionDB. |
Definition at line 1142 of file gnc-optiondb.cpp.
void gnc_option_db_load | ( | GncOptionDB * | odb, |
QofBook * | book | ||
) |
Load a book's options into the GncOptionDB.
odb | The GncOptionDB |
book | The book in which the options are saved. |
Definition at line 1185 of file gnc-optiondb.cpp.
const QofInstance* gnc_option_db_lookup_qofinstance_value | ( | GncOptionDB * | , |
const char * | , | ||
const char * | |||
) |
Retrieve the QofInstance value of an option in the GncOptionDB.
odb | the GncOptionDB |
section | the section in which the option is stored |
name | the option name |
Definition at line 1358 of file gnc-optiondb.cpp.
GncOptionDB* gnc_option_db_new | ( | void | ) |
Create an empty option database.
Definition at line 1136 of file gnc-optiondb.cpp.
void gnc_option_db_save | ( | GncOptionDB * | odb, |
QofBook * | book, | ||
gboolean | clear_options | ||
) |
Save the GncOptionDB contents into a book's options store.
odb | The GncOptionDB |
book | The book in which the options are saved. |
clear_options | TRUE if the books existing options should be removed first. |
Definition at line 1191 of file gnc-optiondb.cpp.
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.
db | A GncOptionDB* for calling from C. Caller retains ownership. |
section | The database section for the option. |
name | The option name. |
key | A short tag used to sort the controls in the dialog. |
doc_string | A description of the option. This will be used in tooltips and should be marked for translation. |
value | The initial and default values for the option. |
allowed | The accounts which are available for selection. |
Definition at line 745 of file gnc-optiondb.cpp.
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.
db | A GncOptionDB* for calling from C. Caller retains ownership. |
section | The database section for the option. |
name | The option name. |
key | A short tag used to sort the controls in the dialog. |
doc_string | A description of the option. This will be used in tooltips and should be marked for translation. |
value | The initial and default values for the option. |
Definition at line 734 of file gnc-optiondb.cpp.
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.
db | A GncOptionDB* for calling from C. Caller retains ownership. |
section | The database section for the option. |
name | The option name. |
key | A short tag used to sort the controls in the dialog. |
doc_string | A description of the option. This will be used in tooltips and should be marked for translation. |
value | The initial and default value for the option. |
allowed | The accounts which are available for selection. |
Definition at line 792 of file gnc-optiondb.cpp.
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.
db | A GncOptionDB* for calling from C. Caller retains ownership. |
section | The database section for the option. |
name | The option name. |
key | A short tag used to sort the controls in the dialog. |
doc_string | A description of the option. This will be used in tooltips and should be marked for translation. |
value | The initial and default value for the option. |
Definition at line 657 of file gnc-optiondb.cpp.
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.
db | A GncOptionDB* for calling from C. Caller retains ownership. |
section | The database section for the option. |
name | The option name. |
key | A short tag used to sort the controls in the dialog. |
doc_string | A description of the option. This will be used in tooltips and should be marked for translation. |
value | The initial and default value for the option. |
Definition at line 668 of file gnc-optiondb.cpp.
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.
db | A GncOptionDB* for calling from C. Caller retains ownership. |
section | The database section for the option. |
name | The option name. |
key | A short tag used to sort the controls in the dialog. |
doc_string | A description of the option. This will be used in tooltips and should be marked for translation. |
value | The initial and default value for the option. |
Definition at line 678 of file gnc-optiondb.cpp.
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.
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.
db | A GncOptionDB* for calling from C. Caller retains ownership. |
section | The database section for the option. |
name | The option name. |
key | A short tag used to sort the controls in the dialog. |
doc_string | A description of the option. This will be used in tooltips and should be marked for translation. |
value | The initial and default value for the option. |
Definition at line 957 of file gnc-optiondb.cpp.
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.
db | A GncOptionDB* for calling from C. Caller retains ownership. |
section | The database section for the option. |
name | The option name. |
key | A short tag used to sort the controls in the dialog. |
doc_string | A description of the option. This will be used in tooltips and should be marked for translation. |
value | The initial and default value for the option. |
Definition at line 946 of file gnc-optiondb.cpp.
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.
db | A GncOptionDB* for calling from C. Caller retains ownership. |
section | The database section for the option. |
name | The option name. |
key | A short tag used to sort the controls in the dialog. |
doc_string | A description of the option. This will be used in tooltips and should be marked for translation. |
value | The initial and default value for the option. It is checked with gnc_commodity_is_currency. |
Definition at line 978 of file gnc-optiondb.cpp.
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.
db | A GncOptionDB* for calling from C. Caller retains ownership. |
section | The database section for the option. |
name | The option name. |
key | A short tag used to sort the controls in the dialog. |
doc_string | A description of the option. This will be used in tooltips and should be marked for translation. |
period | The default/starting relative date value for the option. |
ui | What UI to display, relative, absolute, or both. |
Definition at line 1019 of file gnc-optiondb.cpp.
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.
db | A GncOptionDB* for calling from C. Caller retains ownership. |
section | The database section for the option. |
name | The option name. |
key | A short tag used to sort the controls in the dialog. |
doc_string | A description of the option. This will be used in tooltips and should be marked for translation. |
time | The initial time to set in the option. |
ui | What UI to display, relative, absolute, or both. |
Definition at line 1005 of file gnc-optiondb.cpp.
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.
db | A GncOptionDB* for calling from C. Caller retains ownership. |
section | The database section for the option. |
name | The option name. |
key | A short tag used to sort the controls in the dialog. |
doc_string | A description of the option. This will be used in tooltips and should be marked for translation. |
period_set | A vector of relative date periods to display in the relative control. |
both | Whether to display both a relative and absolute control or a onla a relative control. |
Definition at line 1033 of file gnc-optiondb.cpp.
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.
db | A GncOptionDB* for calling from C. Caller retains ownership. |
section | The database section for the option. |
name | The option name. |
key | A short tag used to sort the controls in the dialog. |
doc_string | A description of the option. This will be used in tooltips and should be marked for translation. |
value | The initial and default value for the option. |
Definition at line 968 of file gnc-optiondb.cpp.
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.
db | A GncOptionDB* for calling from C. Caller retains ownership. |
section | The database section for the option. |
name | The option name. |
key | A short tag used to sort the controls in the dialog. |
doc_string | A description of the option. This will be used in tooltips and should be marked for translation. |
both | Whether to display both a relative and absolute control or a onla a relative control. |
Definition at line 1088 of file gnc-optiondb.cpp.
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.
db | A GncOptionDB* for calling from C. Caller retains ownership. |
section | The database section for the option. |
name | The option name. |
key | A short tag used to sort the controls in the dialog. |
doc_string | A description of the option. This will be used in tooltips and should be marked for translation. |
value | The initial and default value for the option. |
Definition at line 647 of file gnc-optiondb.cpp.
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.
db | A GncOptionDB* for calling from C. Caller retains ownership. |
section | The database section for the option. |
name | The option name. |
key | A short tag used to sort the controls in the dialog. |
doc_string | A description of the option. This will be used in tooltips and should be marked for translation. |
value | The initial and default value for the option. |
Definition at line 914 of file gnc-optiondb.cpp.
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.
db | A GncOptionDB* for calling from C. Caller retains ownership. |
section | The database section for the option. |
name | The option name. |
doc_string | A description of the option. This will be used in tooltips and should be marked for translation. |
value | The initial and default value for the option. |
Definition at line 936 of file gnc-optiondb.cpp.
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.
db | A GncOptionDB* for calling from C. Caller retains ownership. |
section | The database section for the option. |
name | The option name. |
key | A short tag used to sort the controls in the dialog. |
doc_string | A description of the option. This will be used in tooltips and should be marked for translation. |
value | The initial and default value for the option. |
list | The 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 830 of file gnc-optiondb.cpp.
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.
db | A GncOptionDB* for calling from C. Caller retains ownership. |
section | The database section for the option. |
name | The option name. |
key | A short tag used to sort the controls in the dialog. |
doc_string | A description of the option. This will be used in tooltips and should be marked for translation. |
value | The 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 811 of file gnc-optiondb.cpp.
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.
db | A GncOptionDB* for calling from C. Caller retains ownership. |
section | The database section for the option. |
name | The option name. |
key | A short tag used to sort the controls in the dialog. |
doc_string | A description of the option. This will be used in tooltips and should be marked for translation. |
value | The initial and default value for the option. |
Definition at line 864 of file gnc-optiondb.cpp.
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.
db | A GncOptionDB* for calling from C. Caller retains ownership. |
section | The database section for the option. |
name | The option name. |
key | A short tag used to sort the controls in the dialog. |
doc_string | A description of the option. This will be used in tooltips and should be marked for translation. |
value | The initial and default value for the option. |
min | The minimum value for the spin control. |
max | The maximum value for the spin control. |
step | The step size (increment) of the spin control. |
Definition at line 844 of file gnc-optiondb.cpp.
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.
db | A GncOptionDB* for calling from C. Caller retains ownership. |
section | The database section for the option. |
name | The option name. |
key | A short tag used to sort the controls in the dialog. |
doc_string | A description of the option. This will be used in tooltips and should be marked for translation. |
value | The initial and default value for the option. |
type | The type of owner, determines the UI type. |
Definition at line 885 of file gnc-optiondb.cpp.
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.
db | A GncOptionDB* for calling from C. Caller retains ownership. |
section | The database section for the option. |
name | The option name. |
key | A short tag used to sort the controls in the dialog. |
doc_string | A description of the option. This will be used in tooltips and should be marked for translation. |
value | The initial and default value for the option. |
Definition at line 724 of file gnc-optiondb.cpp.
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.
db | A GncOptionDB* for calling from C. Caller retains ownership. |
section | The database section for the option. |
name | The option name. |
value | The initial and default value for the option. |
Definition at line 876 of file gnc-optiondb.cpp.
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.
db | A GncOptionDB* for calling from C. Caller retains ownership. |
section | The database section for the option. |
name | The option name. |
key | A short tag used to sort the controls in the dialog. |
doc_string | A description of the option. This will be used in tooltips and should be marked for translation. |
value | The initial and default value for the option. |
Definition at line 713 of file gnc-optiondb.cpp.
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.
db | A GncOptionDB* for calling from C. Caller retains ownership. |
section | The database section for the option. |
name | The option name. |
key | A short tag used to sort the controls in the dialog. |
doc_string | A description of the option. This will be used in tooltips and should be marked for translation. |
both | Whether to display both a relative and absolute control or a onla a relative control. |
Definition at line 1064 of file gnc-optiondb.cpp.
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.
db | A GncOptionDB* for calling from C. Caller retains ownership. |
section | The database section for the option. |
name | The option name. |
key | A short tag used to sort the controls in the dialog. |
doc_string | A description of the option. This will be used in tooltips and should be marked for translation. |
value | The initial and default value for the option. |
Definition at line 626 of file gnc-optiondb.cpp.
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.
db | A GncOptionDB* for calling from C. Caller retains ownership. |
section | The database section for the option. |
name | The option name. |
key | A short tag used to sort the controls in the dialog. |
doc_string | A description of the option. This will be used in tooltips and should be marked for translation. |
value | The initial and default value for the option. |
Definition at line 925 of file gnc-optiondb.cpp.
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.
db | A GncOptionDB* for calling from C. Caller retains ownership. |
section | The database section for the option. |
name | The option name. |
key | A short tag used to sort the controls in the dialog. |
doc_string | A description of the option. This will be used in tooltips and should be marked for translation. |
value | The initial and default value for the option. |
Definition at line 636 of file gnc-optiondb.cpp.
const char* gnc_relative_date_description | ( | RelativeDatePeriod | ) |
Provide the description of a relative date.
This string is localizable.
period | The relative date period. |
Definition at line 374 of file gnc-option-date.cpp.
const char* gnc_relative_date_display_string | ( | RelativeDatePeriod | ) |
Provide the string representation of a relative date for displaying value to a user.
This string is localizable.
period | The relative date period. |
Definition at line 367 of file gnc-option-date.cpp.
RelativeDatePeriod gnc_relative_date_from_storage_string | ( | const char * | ) |
Convert a relative date storage string back to a RelativeDatePeriod value.
A | string representation obtained from gnc_relative_date_storage_string. |
Definition at line 382 of file gnc-option-date.cpp.
bool gnc_relative_date_is_ending | ( | RelativeDatePeriod | ) |
Report whether the relative date represents the end of a date range.
For example END_LAST_MONTH is the end of a range.
period | The Relative Date Period to check. |
Definition at line 351 of file gnc-option-date.cpp.
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.
For example ONE_MONTH_AGO will be made concrete as the same day as today in the previous month.
period | The Relative Date Period to check. |
Definition at line 333 of file gnc-option-date.cpp.
bool gnc_relative_date_is_starting | ( | RelativeDatePeriod | ) |
Report whether the relative date represents the beginning of a date range.
For example START_LAST_MONTH is the beginning of a range.
period | The Relative Date Period to check. |
Definition at line 343 of file gnc-option-date.cpp.
const char* gnc_relative_date_storage_string | ( | RelativeDatePeriod | ) |
Provide the string representation of a relative date for persisting the value.
This string is not localizable.
period | The relative date period. |
Definition at line 359 of file gnc-option-date.cpp.
time64 gnc_relative_date_to_time64 | ( | RelativeDatePeriod | ) |
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.
period | The relative date period to use to calculate the concrete date. |
Definition at line 487 of file gnc-option-date.cpp.
std::ostream& operator<< | ( | std::ostream & | , |
const RelativeDatePeriod | |||
) |
Add the display string to the provided std::ostream.
stream | the std::ostream to which to write the period value |
period | the period value to write |
Definition at line 560 of file gnc-option-date.cpp.
constexpr unsigned relative_date_periods |
Definition at line 80 of file gnc-option-date.hpp.