John Ralls
aa246d3096
Make implementation classes and template code visible only in app-utils.
...
So only GncOption and the GncOptionDB free-function interface are public.
We don't want to expose template headers widely, it would blow up compilation
times and might lead to one definition rule violations.
5 years ago
John Ralls
20b3ef8a89
Handle some minor differences between libc++ (clang) and libstdc++ (gcc).
5 years ago
John Ralls
cbd0607e80
Implement load and store options from/to book options.
5 years ago
John Ralls
009219c63d
Much less ugly and fragile.
...
Finding the right form now relies on the form name instead of its
position in the parse tree.
5 years ago
John Ralls
276641ef15
Change parse of option input to generate a parse tree.
...
This is I hope less brittle than the previous character-counting, though
it's still brittle because it relies instead on counting form-depth.
5 years ago
John Ralls
76172af239
Implement saving and loading OptionDB items to/from scheme and
...
key-value string representations.
5 years ago
John Ralls
6ab5618b76
Set a 50-character limit on the saved size of option section and name.
...
Allows use of istream::getline() to retrieve the values, simplifying
delimiter detection.
5 years ago
John Ralls
52d0ec5290
Change GncOptionDateValue design to better match usage.
...
Added advantage that it handles (not correctly, but in the same way as
the old code) the ambiguity between a period starting or ending with
the stored value "relative . today".
5 years ago
John Ralls
883127a59d
Implement operators >> and << on GncOption.
5 years ago
John Ralls
b95ea2c4aa
Add Account-list options.
5 years ago
John Ralls
3f576671aa
Adapt GncOptionMultiChoiceValue to support list options.
...
Main change adds a value field to the constructor to set the value and
default value.
5 years ago
John Ralls
3dc4bc2377
Implement GncOptionDateValue.
5 years ago
John Ralls
435667e8fe
Implement GncOptionMultichoiceValue
...
Replaces GncOptionValue<GncMultiChoiceOptionChoices> because having the
vector as the value obviously wouldn't work and besides it needs
additional functions.
5 years ago
John Ralls
d544f85256
Replace boost::variant and boost::optional with the C++17 std equivs.
5 years ago
John Ralls
694a15ed21
Extract SCM GncOptionDB::lookup_option to gnc-optiondb.i.
5 years ago
John Ralls
9cdcaf0da8
Remove GncOptionDB::set_selectable and convert set_option to a template.
5 years ago
John Ralls
c5fac51a8b
Change the type of OptionUIItem's m_ui_item from void* to GncOptionUIItem.
...
A locally-opaque class wrapping whatever sort of widget ptr one needs.
Thanks, warlord!
5 years ago
John Ralls
3296212aef
Sketch out the rest of the option types.
...
Minimal implentation to get it to compile and pass tests, not functional yet.
5 years ago
John Ralls
4146251cc7
Add GncOptionUIItem manipulation to GncOptionDB.
5 years ago
John Ralls
94628097e4
Use GncOptionUIType parameters in gnc_register_option functions.
5 years ago
John Ralls
3769a356d5
Extract functions find_section and find_option using boost::optional
...
to handle not-found condition.
5 years ago
John Ralls
cf0b1da4fa
Remove GncOptionWrapper.
...
Move the GncOptions into the GncOptionDB. This works with tests but
might not with real reports.
5 years ago
John Ralls
d2655d3fb0
Remove gnc-option-db business convenience functions.
...
gnc_option_db_lookup_invoice_option used only once, so moved its
guts there. The others weren't used at all.
5 years ago
John Ralls
f3eee511e8
Add free functions to create a new GncOptionDB and to register options.
...
The objective of the free functions is to hide the GncOption from language
bindings so that the GncOptions can be moved into the GncOptionDB instead
of having shared ptrs splattered around the heap. Nearly all access to
the options can then be mediated through the GncOptionDB container.
Note that gnc_option_db_new creates the GncOptionDB on the heap and
returns a raw ptr, so it's up to the creator of the GncOptionDB to
call delete on it when it's no longer needed.
5 years ago
John Ralls
455d3c2d60
Add GncOptionDB class.
5 years ago