GnuCash  2.6.99
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
gnc-engine.h
Go to the documentation of this file.
1 /********************************************************************
2  * gnc-engine.h -- top-level include file for Gnucash Engine *
3  * *
4  * This program is free software; you can redistribute it and/or *
5  * modify it under the terms of the GNU General Public License as *
6  * published by the Free Software Foundation; either version 2 of *
7  * the License, or (at your option) any later version. *
8  * *
9  * This program is distributed in the hope that it will be useful, *
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12  * GNU General Public License for more details. *
13  * *
14  * You should have received a copy of the GNU General Public License*
15  * along with this program; if not, contact: *
16  * *
17  * Free Software Foundation Voice: +1-617-542-5942 *
18  * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
19  * Boston, MA 02110-1301, USA [email protected] *
20  * *
21  ********************************************************************/
36 #ifndef GNC_ENGINE_H
37 #define GNC_ENGINE_H
38 
39 #include <glib.h>
40 #include "qof.h"
41 
43 // @{
44 #define GNC_MOD_ROOT "gnc"
45 #define GNC_MOD_ENGINE "gnc.engine"
46 #define GNC_MOD_ACCOUNT "gnc.account"
47 #define GNC_MOD_SX "gnc.engine.sx"
48 #define GNC_MOD_QUERY "gnc.query"
49 #define GNC_MOD_SCRUB "gnc.scrub"
50 #define GNC_MOD_LOT "gnc.lots"
51 #define GNC_MOD_COMMODITY "gnc.commodity"
52 #define GNC_MOD_BACKEND "gnc.backend"
53 #define GNC_MOD_PRICE "gnc.pricedb"
54 #define GNC_MOD_BUSINESS "gnc.business"
55 #define GNC_MOD_IO "gnc.io"
56 #define GNC_MOD_BOOK "gnc.book-period"
57 #define GNC_MOD_GUI "gnc.gui"
58 #define GNC_MOD_GUI_SX "gnc.gui.sx"
59 #define GNC_MOD_GUILE "gnc.guile"
60 #define GNC_MOD_LEDGER "gnc.ledger"
61 #define GNC_MOD_REGISTER "gnc.register"
62 #define GNC_MOD_HTML "gnc.html"
63 #define GNC_MOD_PREFS "gnc.pref"
64 #define GNC_MOD_IMPORT "gnc.import"
65 #define GNC_MOD_ASSISTANT "gnc.assistant"
66 #define GNC_MOD_TEST "gnc.tests"
67 #define GNC_MOD_BUDGET "gnc.budget"
68 
69 
87 #define GNC_ID_NONE QOF_ID_NONE
88 #define GNC_ID_BOOK QOF_ID_BOOK
89 #define GNC_ID_SESSION QOF_ID_SESSION
90 #define GNC_ID_NULL QOF_ID_NULL
91 
92 #define GNC_ID_ACCOUNT "Account"
93 #define GNC_ID_COMMODITY "Commodity"
94 #define GNC_ID_COMMODITY_NAMESPACE "CommodityNamespace"
95 #define GNC_ID_COMMODITY_TABLE "CommodityTable"
96 #define GNC_ID_LOT "Lot"
97 #define GNC_ID_PERIOD "Period"
98 #define GNC_ID_PRICE "Price"
99 #define GNC_ID_PRICEDB "PriceDB"
100 #define GNC_ID_SPLIT "Split"
101 #define GNC_ID_BUDGET "Budget"
102 #define GNC_ID_SCHEDXACTION "SchedXaction"
103 #define GNC_ID_SXES "SchedXactions"
104 #define GNC_ID_SXTG "SXTGroup"
105 #define GNC_ID_SXTT "SXTTrans"
106 #define GNC_ID_TRANS "Trans"
107 
108 /* TYPES **********************************************************/
109 
110 /* CAS: ISTM, it would make more sense to put the typedefs in their
111  corresponding header files, (e.g. Account.h), and to #include all
112  the engine API header files right here. After all, when I jump to
113  the definition "Account", I want to end up in Account.h, not this
114  file, like I do now.
115 
116  Also, as it is now, if I want to use the engine api, I need to
117  include this header, plus all the other engine headers for the
118  types whose functions I call, so this header is providing almost no
119  benefit of aggregation. But, if it included all the headers I
120  could just include this file. Or would that cause a massive
121  recompile every time one engine header changed?
122  Even if including all the headers here doesn't make sense, I think
123  distributing the stuff in the "Types" section does.
124 */
125 
126 
132 typedef struct account_s Account;
133 
144 typedef struct split_s Split;
145 
155 typedef struct transaction_s Transaction;
156 
172 
175 
178 
188 typedef struct gnc_lot_s GNCLot;
189 
195 typedef struct gnc_price_s GNCPrice;
196 typedef struct gnc_quote_source_s gnc_quote_source;
197 
199 typedef GList AccountList;
201 typedef GList LotList;
203 typedef GList SplitList;
205 typedef GList TransList;
207 typedef GList AccountGUIDList;
209 typedef GList BookGUIDList;
210 
211 typedef void (*EngineCommitErrorCallback)( gpointer data, QofBackendError errcode );
212 
213 typedef gint (*SplitCallback)(Split *s, gpointer data);
214 typedef gint (*TransactionCallback)(Transaction *t, void *data);
215 
217 typedef void (* gnc_engine_init_hook_t)(int, char **);
218 
219 
225 void gnc_engine_init(int argc, char ** argv);
226 
232 void gnc_engine_init_static(int argc, char ** argv);
233 
236 void gnc_engine_shutdown (void);
237 
239 gboolean gnc_engine_is_initialized(void);
240 
242 void gnc_log_default(void);
243 
247 
250 void gnc_engine_add_commit_error_callback( EngineCommitErrorCallback cb, gpointer data );
251 
252 void gnc_engine_signal_commit_error( QofBackendError errcode );
253 
257 #define GNC_INVOICE_ID "gncInvoice"
258 #define GNC_INVOICE_GUID "invoice-guid"
259 #define GNC_OWNER_ID "gncOwner"
260 #define GNC_OWNER_TYPE "owner-type"
261 #define GNC_OWNER_GUID "owner-guid"
262 #define GNC_SX_ID "sched-xaction"
263 
264 
265 #endif
266 
GList BookGUIDList
Definition: gnc-engine.h:209
GList TransList
Definition: gnc-engine.h:205
void(* gnc_engine_init_hook_t)(int, char **)
Definition: gnc-engine.h:217
GList LotList
Definition: gnc-engine.h:201
QofBackendError
The errors that can be reported to the GUI & other front-end users.
Definition: qofbackend.h:59
void gnc_engine_shutdown(void)
Definition: gnc-engine.c:160
gboolean gnc_engine_is_initialized(void)
Definition: gnc-engine.c:179
void gnc_engine_add_commit_error_callback(EngineCommitErrorCallback cb, gpointer data)
Definition: gnc-engine.c:197
void gnc_engine_init_static(int argc, char **argv)
Definition: gnc-engine.c:147
GList SplitList
Definition: gnc-engine.h:203
void gnc_log_default(void)
Definition: gnc-engine.c:189
void gnc_engine_init(int argc, char **argv)
Definition: gnc-engine.c:139
void gnc_engine_add_init_hook(gnc_engine_init_hook_t hook)
Definition: gnc-engine.c:173
GList AccountList
Definition: gnc-engine.h:199
Definition: SplitP.h:71
GList AccountGUIDList
Definition: gnc-engine.h:207