33 #ifndef GNC_OPTIONDB_HPP_ 34 #define GNC_OPTIONDB_HPP_ 49 #include "gnc-datetime.hpp" 53 using GncOptionDBPtr = std::unique_ptr<GncOptionDB>;
54 using GncOptionAccountList = std::vector<GncGUID>;
56 using GncOptionAccountTypeList = std::vector<GNCAccountType>;
57 using GncMultichoiceOptionEntry = std::tuple<
const std::string,
59 GncOptionMultichoiceKeyType>;
60 using GncMultichoiceOptionChoices = std::vector<GncMultichoiceOptionEntry>;
79 const GncOptionAccountTypeList& types);
92 const char* name,
const char* key,
93 const char* doc_string, std::string value);
99 const char* section,
const char* name,
100 const char* key,
const char* doc_string,
118 const char* name,
const char* key,
119 const char* doc_string, std::string value);
126 const char* name,
const char* key,
127 const char* doc_string, std::string value)
143 const char* name,
const char* key,
144 const char* doc_string, std::string value);
150 const char* section,
const char* name,
151 const char* key,
const char* doc_string,
168 const char* name,
const char* key,
169 const char* doc_string, GncBudget* value);
175 const char* section,
const char* name,
176 const char* key,
const char* doc_string,
193 const char* section,
const char* name,
194 const char* key,
const char* doc_string,
195 gnc_commodity* value);
202 const char* name,
const char* key,
203 const char* doc_string,
204 gnc_commodity* value)
215 const char* section,
const char* name,
216 const char* key,
const char* doc_string,
224 const char* name,
const char* key,
225 const char* doc_string,
243 const char* section,
const char* name,
244 const char* key,
const char* doc_string,
254 const char* doc_string,
272 const char* name,
const char* key,
273 const char* doc_string, std::string value);
279 const char* name,
const char* key,
280 const char* doc_string,
299 const char* name,
const char* key,
300 const char* doc_string,
301 const GncOptionAccountList& value,
302 GncOptionAccountTypeList&& allowed);
309 const char* name,
const char* key,
310 const char* doc_string,
311 const GncOptionAccountList& value,
312 GncOptionAccountTypeList&& allowed)
331 const char* name,
const char* key,
332 const char* doc_string,
333 const GncOptionAccountList& value);
340 const char* name,
const char* key,
341 const char* doc_string,
342 const GncOptionAccountList& value)
361 const char* name,
const char* key,
362 const char* doc_string,
364 GncOptionAccountTypeList&& allowed);
371 const char* name,
const char* key,
372 const char* doc_string,
374 GncOptionAccountTypeList&& allowed)
392 const char* section,
const char* name,
393 const char* key,
const char* doc_string,
394 const char* default_val,
395 GncMultichoiceOptionChoices&& value);
401 const char* section,
const char* name,
402 const char* key,
const char* doc_string,
403 const char* default_val,
404 GncMultichoiceOptionChoices&& value)
407 key, doc_string, default_val,
423 const char* name,
const char* key,
424 const char* doc_string,
const char* value,
425 GncMultichoiceOptionChoices&& list);
431 const char* name,
const char* key,
432 const char* doc_string,
const char* value,
433 GncMultichoiceOptionChoices&& list)
436 value, std::move(list));
454 template <
typename ValueType>
456 const char* section,
const char* name,
457 const char* key,
const char* doc_string,
458 ValueType value, ValueType min,
459 ValueType max, ValueType step);
464 template <
typename ValueType>
466 const char* section,
const char* name,
467 const char* key,
const char* doc_string,
468 ValueType value, ValueType min,
469 ValueType max, ValueType step)
471 gnc_register_number_range_option<ValueType>(db.get(), section, name,
472 key, doc_string, value,
487 const char* section,
const char* name,
489 const char* doc_string,
493 const char* section,
const char* name,
495 const char* doc_string,
499 doc_string, static_cast<int>(value));
510 const char* doc_string,
521 const char* doc_string,
525 doc_string,
static_cast<int>(value));
539 const char* name,
const QofQuery* value);
563 const char* name,
const char* key,
564 const char* doc_string,
const GncOwner* value,
571 const char* name,
const char* key,
572 const char* doc_string,
590 const char* name,
const char* key,
591 const char* doc_string, std::string value);
597 const char* name,
const char* key,
598 const char* doc_string,
604 void gnc_register_internal_option(GncOptionDBPtr& db,
605 const char* section,
const char* name,
606 const std::string& value);
608 void gnc_register_internal_option(GncOptionDBPtr& db,
609 const char* section,
const char* name,
612 void gnc_register_report_placement_option(GncOptionDBPtr& db,
613 const char* section,
const char* name);
626 const char* name,
const char* key,
627 const char* doc_string, gnc_commodity* value);
634 const char* name,
const char* key,
635 const char* doc_string,
636 gnc_commodity* value)
648 const char* name,
const char* key,
649 const char* doc_string,
654 const char* name,
const char* key,
655 const char* doc_string,
673 const char* name,
const char* key,
674 const char* doc_string, GncInvoice* value);
681 const char* name,
const char* key,
682 const char* doc_string,
700 const char* name,
const char* key,
707 const char* section,
const char* name,
709 const char* doc_string,
726 const char* name,
const char* key,
727 const char* doc_string, std::string value);
733 const char* section,
const char* name,
734 const char* key,
const char* doc_string,
752 const char* name,
const char* key,
753 const char* doc_string,
int value);
759 const char* section,
const char* name,
760 const char* key,
const char* doc_string,
778 const char* section,
const char* name,
779 const char* key,
const char* doc_string,
789 const char* doc_string,
807 const char* section,
const char* name,
808 const char* key,
const char* doc_string,
809 GncOptionDateFormat&& value);
816 const char* name,
const char* key,
817 const char* doc_string,
818 GncOptionDateFormat&& value)
821 doc_string, std::move(value));
824 enum RelativeDateUI : uint8_t
843 const char* name,
const char* key,
844 const char* doc_string,
846 RelativeDatePeriod::TODAY,
847 RelativeDateUI ui = RelativeDateUI::BOTH);
853 const char* name,
const char* key,
854 const char* doc_string,
856 RelativeDatePeriod::TODAY,
857 RelativeDateUI ui = RelativeDateUI::BOTH)
875 const char* name,
const char* key,
876 const char* doc_string,
time64 time,
877 RelativeDateUI ui = RelativeDateUI::BOTH);
883 const char* name,
const char* key,
884 const char* doc_string,
time64 time,
885 RelativeDateUI ui = RelativeDateUI::BOTH)
903 const char* name,
const char* key,
904 const char* doc_string,
905 RelativeDatePeriodVec& period_set,
912 const char* name,
const char* key,
913 const char* doc_string,
914 RelativeDatePeriodVec& period_set,
933 const char* name,
const char* key,
934 const char* doc_string,
bool both =
true);
941 const char* name,
const char* key,
942 const char* doc_string,
bool both =
true)
959 const char* name,
const char* key,
960 const char* doc_string,
bool both =
true);
966 const char* name,
const char* key,
967 const char* doc_string,
bool both =
true)
975 #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. ...