GnuCash  5.6-150-g038405b370+
gnc-features.h
Go to the documentation of this file.
1 /********************************************************************\
2  * gnc-features.h -- manage GnuCash features table *
3  * Copyright (C) 2011 Derek Atkins <derek@ihtfp.com> *
4  * Copyright (C) 2012 Geert Janssens <geert@kobaltwit.be> *
5  * *
6  * This program is free software; you can redistribute it and/or *
7  * modify it under the terms of the GNU General Public License as *
8  * published by the Free Software Foundation; either version 2 of *
9  * the License, or (at your option) any later version. *
10  * *
11  * This program is distributed in the hope that it will be useful, *
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14  * GNU General Public License for more details. *
15  * *
16  * You should have received a copy of the GNU General Public License*
17  * along with this program; if not, write to the Free Software *
18  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
19  * *
20 \********************************************************************/
21 
36 #ifndef GNC_FEATURES_H
37 #define GNC_FEATURES_H
38 
39 #ifdef __cplusplus
40 #include <string_view>
41 #include <unordered_map>
42 #include <vector>
43 
44 using Feature = std::pair<std::string_view, std::string_view>;
45 using FeaturesTable = std::unordered_map<std::string_view, std::string_view>;
46 using FeatureSet = std::vector<Feature>;
47 
48 extern "C" {
49 #endif
50 
54 #define GNC_FEATURE_CREDIT_NOTES "Credit Notes"
55 #define GNC_FEATURE_NUM_FIELD_SOURCE "Number Field Source"
56 #define GNC_FEATURE_KVP_EXTRA_DATA "Extra data in addresses, jobs or invoice entries"
57 #define GNC_FEATURE_BOOK_CURRENCY "Use a Book-Currency"
58 #define GNC_FEATURE_GUID_BAYESIAN "Account GUID based Bayesian data"
59 #define GNC_FEATURE_GUID_FLAT_BAYESIAN "Account GUID based bayesian with flat KVP"
60 #define GNC_FEATURE_SQLITE3_ISO_DATES "ISO-8601 formatted date strings in SQLite3 databases."
61 #define GNC_FEATURE_REG_SORT_FILTER "Register sort and filter settings stored in .gcm file"
62 #define GNC_FEATURE_BUDGET_UNREVERSED "Use natural signs in budget amounts"
63 #define GNC_FEATURE_BUDGET_SHOW_EXTRA_ACCOUNT_COLS "Show extra account columns in the Budget View"
64 #define GNC_FEATURE_EQUITY_TYPE_OPENING_BALANCE "Use a dedicated opening balance account identified by an 'equity-type' slot"
65 
74 gchar *gnc_features_test_unknown (QofBook *book);
75 
81 void gnc_features_set_unused (QofBook *book, const gchar *feature);
82 
88 void gnc_features_set_used (QofBook *book, const gchar *feature);
89 
90 /*
91  * Returns true if the specified feature is used.
92  */
93 gboolean gnc_features_check_used (QofBook *, char const * feature);
94 
95 #ifdef __cplusplus
96 } /* extern "C" */
97 #endif /*__cplusplus*/
98 #endif /* GNC_FEATURES_H */
99 
void gnc_features_set_used(QofBook *book, const gchar *feature)
Indicate that the current book uses the given feature.
void gnc_features_set_unused(QofBook *book, const gchar *feature)
Indicate that the current book does not use the given feature.
gchar * gnc_features_test_unknown(QofBook *book)
Test if the current book relies on features only introduced in a more recent version of GnuCash...