33 #ifndef GNC_OPTIONDB_HPP_ 34 #define GNC_OPTIONDB_HPP_ 50 #include "gnc-datetime.hpp" 54 using GncOptionDBPtr = std::unique_ptr<GncOptionDB>;
55 using GncOptionAccountList = std::vector<GncGUID>;
57 using GncOptionAccountTypeList = std::vector<GNCAccountType>;
58 using GncMultichoiceOptionEntry = std::tuple<
const std::string,
60 GncOptionMultichoiceKeyType>;
61 using GncMultichoiceOptionChoices = std::vector<GncMultichoiceOptionEntry>;
80 const GncOptionAccountTypeList& types);
93 const char* name,
const char* key,
94 const char* doc_string, std::string value);
100 const char* section,
const char* name,
101 const char* key,
const char* doc_string,
119 const char* name,
const char* key,
120 const char* doc_string, std::string value);
127 const char* name,
const char* key,
128 const char* doc_string, std::string value)
144 const char* name,
const char* key,
145 const char* doc_string, std::string value);
151 const char* section,
const char* name,
152 const char* key,
const char* doc_string,
169 const char* name,
const char* key,
170 const char* doc_string, GncBudget* value);
176 const char* section,
const char* name,
177 const char* key,
const char* doc_string,
194 const char* section,
const char* name,
195 const char* key,
const char* doc_string,
196 gnc_commodity* value);
203 const char* name,
const char* key,
204 const char* doc_string,
205 gnc_commodity* value)
216 const char* section,
const char* name,
217 const char* key,
const char* doc_string,
225 const char* name,
const char* key,
226 const char* doc_string,
244 const char* section,
const char* name,
245 const char* key,
const char* doc_string,
255 const char* doc_string,
273 const char* name,
const char* key,
274 const char* doc_string, std::string value);
280 const char* name,
const char* key,
281 const char* doc_string,
300 const char* name,
const char* key,
301 const char* doc_string,
302 const GncOptionAccountList& value,
303 GncOptionAccountTypeList&& allowed);
310 const char* name,
const char* key,
311 const char* doc_string,
312 const GncOptionAccountList& value,
313 GncOptionAccountTypeList&& allowed)
332 const char* name,
const char* key,
333 const char* doc_string,
334 const GncOptionAccountList& value);
341 const char* name,
const char* key,
342 const char* doc_string,
343 const GncOptionAccountList& value)
362 const char* name,
const char* key,
363 const char* doc_string,
365 GncOptionAccountTypeList&& allowed);
372 const char* name,
const char* key,
373 const char* doc_string,
375 GncOptionAccountTypeList&& allowed)
393 const char* section,
const char* name,
394 const char* key,
const char* doc_string,
395 const char* default_val,
396 GncMultichoiceOptionChoices&& value);
402 const char* section,
const char* name,
403 const char* key,
const char* doc_string,
404 const char* default_val,
405 GncMultichoiceOptionChoices&& value)
408 key, doc_string, default_val,
424 const char* name,
const char* key,
425 const char* doc_string,
const char* value,
426 GncMultichoiceOptionChoices&& list);
432 const char* name,
const char* key,
433 const char* doc_string,
const char* value,
434 GncMultichoiceOptionChoices&& list)
437 value, std::move(list));
455 template <
typename ValueType>
457 const char* section,
const char* name,
458 const char* key,
const char* doc_string,
459 ValueType value, ValueType min,
460 ValueType max, ValueType step);
465 template <
typename ValueType>
467 const char* section,
const char* name,
468 const char* key,
const char* doc_string,
469 ValueType value, ValueType min,
470 ValueType max, ValueType step)
472 gnc_register_number_range_option<ValueType>(db.get(), section, name,
473 key, doc_string, value,
488 const char* section,
const char* name,
490 const char* doc_string,
494 const char* section,
const char* name,
496 const char* doc_string,
500 doc_string, static_cast<int>(value));
511 const char* doc_string,
522 const char* doc_string,
526 doc_string,
static_cast<int>(value));
540 const char* name,
const QofQuery* value);
564 const char* name,
const char* key,
565 const char* doc_string,
const GncOwner* value,
572 const char* name,
const char* key,
573 const char* doc_string,
591 const char* name,
const char* key,
592 const char* doc_string, std::string value);
598 const char* name,
const char* key,
599 const char* doc_string,
605 void gnc_register_internal_option(GncOptionDBPtr& db,
606 const char* section,
const char* name,
607 const std::string& value);
609 void gnc_register_internal_option(GncOptionDBPtr& db,
610 const char* section,
const char* name,
613 void gnc_register_report_placement_option(GncOptionDBPtr& db,
614 const char* section,
const char* name);
627 const char* name,
const char* key,
628 const char* doc_string, gnc_commodity* value);
635 const char* name,
const char* key,
636 const char* doc_string,
637 gnc_commodity* value)
649 const char* name,
const char* key,
650 const char* doc_string,
655 const char* name,
const char* key,
656 const char* doc_string,
674 const char* name,
const char* key,
675 const char* doc_string, GncInvoice* value);
682 const char* name,
const char* key,
683 const char* doc_string,
701 const char* name,
const char* key,
708 const char* section,
const char* name,
710 const char* doc_string,
727 const char* name,
const char* key,
728 const char* doc_string, std::string value);
734 const char* section,
const char* name,
735 const char* key,
const char* doc_string,
753 const char* name,
const char* key,
754 const char* doc_string,
int value);
760 const char* section,
const char* name,
761 const char* key,
const char* doc_string,
779 const char* section,
const char* name,
780 const char* key,
const char* doc_string,
790 const char* doc_string,
808 const char* section,
const char* name,
809 const char* key,
const char* doc_string,
810 GncOptionDateFormat&& value);
817 const char* name,
const char* key,
818 const char* doc_string,
819 GncOptionDateFormat&& value)
822 doc_string, std::move(value));
825 enum RelativeDateUI : uint8_t
844 const char* name,
const char* key,
845 const char* doc_string,
847 RelativeDatePeriod::TODAY,
848 RelativeDateUI ui = RelativeDateUI::BOTH);
854 const char* name,
const char* key,
855 const char* doc_string,
857 RelativeDatePeriod::TODAY,
858 RelativeDateUI ui = RelativeDateUI::BOTH)
876 const char* name,
const char* key,
877 const char* doc_string,
time64 time,
878 RelativeDateUI ui = RelativeDateUI::BOTH);
884 const char* name,
const char* key,
885 const char* doc_string,
time64 time,
886 RelativeDateUI ui = RelativeDateUI::BOTH)
904 const char* name,
const char* key,
905 const char* doc_string,
906 RelativeDatePeriodVec& period_set,
913 const char* name,
const char* key,
914 const char* doc_string,
915 RelativeDatePeriodVec& period_set,
934 const char* name,
const char* key,
935 const char* doc_string,
bool both =
true);
942 const char* name,
const char* key,
943 const char* doc_string,
bool both =
true)
960 const char* name,
const char* key,
961 const char* doc_string,
bool both =
true);
967 const char* name,
const char* key,
968 const char* doc_string,
bool both =
true)
976 #endif //GNC_OPTIONDB_HPP_ Holds all of the options for a book, report, or stylesheet, organized by GncOptionSections.
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_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_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_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.
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_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.
C++ Public interface for individual options.
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_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.
Account handling public routines.
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_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_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.
RelativeDatePeriod
Reporting periods relative to the current date.
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_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_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_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.
Tax Table programming interface.
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.
Business Invoice Interface.
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_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_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.
gint64 time64
Most systems that are currently maintained, including Microsoft Windows, BSD-derived Unixes and Linux...
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_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_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_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.
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_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_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.
Commodity handling public routines.
modtime is the internal date of the last modtime See libgnucash/engine/TaxTableBillTermImmutability.txt for an explanation of the following Code that handles refcount, parent, child, invisible and children is identical to that in ::GncBillTerm
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_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. ...