GnuCash  4.12-527-g05ffd3d4eb
Typedefs | Enumerations | Functions

The primary C++ interface to options for books, reports, and stylesheets. More...

#include <string>
#include <functional>
#include <exception>
#include <optional>
#include <iostream>
#include <config.h>
#include "Account.h"
#include "gnc-budget.h"
#include "gnc-commodity.h"
#include "gncInvoice.h"
#include "gncTaxTable.h"
#include "gnc-option.hpp"
#include "gnc-datetime.hpp"

Go to the source code of this file.

Typedefs

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  RelativeDateUI : uint8_t { ABSOLUTE, RELATIVE, BOTH }
 

Functions

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_counter_option (GncOptionDB *db, const char *section, const char *name, const char *key, const char *doc_string, double 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, std::string 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, std::string 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++.
 

Detailed Description

The primary C++ interface to options for books, reports, and stylesheets.

Author
Copyright 2019-2021 John Ralls jrall.nosp@m.s@ce.nosp@m.ridwe.nosp@m.n.us

Definition in file gnc-optiondb.hpp.