gnc-engine.h

Go to the documentation of this file.
00001 /********************************************************************
00002  * gnc-engine.h  -- top-level include file for Gnucash Engine       *
00003  *                                                                  *
00004  * This program is free software; you can redistribute it and/or    *
00005  * modify it under the terms of the GNU General Public License as   *
00006  * published by the Free Software Foundation; either version 2 of   *
00007  * the License, or (at your option) any later version.              *
00008  *                                                                  *
00009  * This program is distributed in the hope that it will be useful,  *
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
00012  * GNU General Public License for more details.                     *
00013  *                                                                  *
00014  * You should have received a copy of the GNU General Public License*
00015  * along with this program; if not, contact:                        *
00016  *                                                                  *
00017  * Free Software Foundation           Voice:  +1-617-542-5942       *
00018  * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652       *
00019  * Boston, MA  02110-1301,  USA       gnu@gnu.org                   *
00020  *                                                                  *
00021  ********************************************************************/
00036 #ifndef GNC_ENGINE_H
00037 #define GNC_ENGINE_H
00038 
00039 #include <glib.h>
00040 #include "qof.h"
00041 
00043 // @{
00044 #define GNC_MOD_ROOT      "gnc"
00045 #define GNC_MOD_ENGINE    "gnc.engine"
00046 #define GNC_MOD_ACCOUNT   "gnc.account"
00047 #define GNC_MOD_SX        "gnc.engine.sx"
00048 #define GNC_MOD_QUERY     "gnc.query"
00049 #define GNC_MOD_SCRUB     "gnc.scrub"
00050 #define GNC_MOD_LOT       "gnc.lots"
00051 #define GNC_MOD_COMMODITY "gnc.commodity"
00052 #define GNC_MOD_BACKEND   "gnc.backend"
00053 #define GNC_MOD_PRICE     "gnc.pricedb"
00054 #define GNC_MOD_BUSINESS  "gnc.business"
00055 #define GNC_MOD_IO        "gnc.io"
00056 #define GNC_MOD_BOOK      "gnc.book-period"
00057 #define GNC_MOD_GUI       "gnc.gui"
00058 #define GNC_MOD_GUI_SX    "gnc.gui.sx"
00059 #define GNC_MOD_GUILE     "gnc.guile"
00060 #define GNC_MOD_LEDGER    "gnc.ledger"
00061 #define GNC_MOD_REGISTER  "gnc.register"
00062 #define GNC_MOD_HTML      "gnc.html"
00063 #define GNC_MOD_PREFS     "gnc.pref"
00064 #define GNC_MOD_IMPORT    "gnc.import"
00065 #define GNC_MOD_DRUID     "gnc.druids"
00066 #define GNC_MOD_TEST      "gnc.tests"
00067 #define GNC_MOD_BUDGET    "gnc.budget"
00068 
00069 
00087 #define GNC_ID_NONE           QOF_ID_NONE
00088 #define GNC_ID_BOOK           QOF_ID_BOOK
00089 #define GNC_ID_SESSION        QOF_ID_SESSION
00090 #define GNC_ID_NULL           QOF_ID_NULL
00091 
00092 #define GNC_ID_ACCOUNT        "Account"
00093 #define GNC_ID_COMMODITY      "Commodity"
00094 #define GNC_ID_COMMODITY_NAMESPACE "CommodityNamespace"
00095 #define GNC_ID_COMMODITY_TABLE "CommodityTable"
00096 #define GNC_ID_LOT            "Lot"
00097 #define GNC_ID_PERIOD         "Period"
00098 #define GNC_ID_PRICE          "Price"
00099 #define GNC_ID_PRICEDB        "PriceDB"
00100 #define GNC_ID_SPLIT          "Split"
00101 #define GNC_ID_BUDGET         "Budget"
00102 #define GNC_ID_SCHEDXACTION   "SchedXaction"
00103 #define GNC_ID_SXES           "SchedXactions"
00104 #define GNC_ID_SXTG           "SXTGroup"
00105 #define GNC_ID_SXTT           "SXTTrans"
00106 #define GNC_ID_TRANS          "Trans"
00107 
00108 /* TYPES **********************************************************/
00109 
00110 /* CAS: ISTM, it would make more sense to put the typedefs in their
00111    corresponding header files, (e.g. Account.h), and to #include all
00112    the engine API header files right here.  After all, when I jump to
00113    the definition "Account", I want to end up in Account.h, not this
00114    file, like I do now.
00115 
00116    Also, as it is now, if I want to use the engine api, I need to
00117    include this header, plus all the other engine headers for the
00118    types whose functions I call, so this header is providing almost no
00119    benefit of aggregation.  But, if it included all the headers I
00120    could just include this file.  Or would that cause a massive
00121    recompile everytime one engine header changed?
00122    Even if including all the headers here doesn't make sense, I think
00123    distributing the stuff in the "Types" section does.
00124 */
00125 
00126 
00132 typedef struct account_s             Account;
00133 
00144 typedef struct split_s               Split;
00145 
00155 typedef struct transaction_s         Transaction;
00156 
00171 typedef struct gnc_commodity_s       gnc_commodity;
00172 
00174 typedef struct gnc_commodity_namespace_s gnc_commodity_namespace;
00175 
00177 typedef struct gnc_commodity_table_s gnc_commodity_table;
00178 
00188 typedef struct gnc_lot_struct        GNCLot;
00189 
00195 typedef struct gnc_price_s           GNCPrice;
00196 typedef struct gnc_quote_source_s    gnc_quote_source;
00197 
00199 typedef GList                  AccountList;
00201 typedef GList                  LotList;
00203 typedef GList                  SplitList;
00205 typedef GList                  TransList;
00207 typedef GList                  AccountGUIDList;
00209 typedef GList                  BookGUIDList;
00210 
00211 
00212 typedef  gint (*SplitCallback)(Split *s, gpointer data);
00213 typedef  gint (*TransactionCallback)(Transaction *t, void *data);
00214 
00216 typedef void (* gnc_engine_init_hook_t)(int, char **);
00217 
00218 
00222 unsigned int gnucash_major_version (void);
00224 unsigned int gnucash_minor_version (void);
00226 unsigned int gnucash_micro_version (void);
00227 
00231 void gnc_engine_init(int argc, char ** argv);
00232 
00235 void gnc_engine_shutdown (void);
00236 
00238 gboolean gnc_engine_is_initialized(void);
00239 
00241 void gnc_log_default(void);
00242 
00245 void gnc_engine_add_init_hook(gnc_engine_init_hook_t hook);
00246 
00247 #endif
00248 

Generated on Sun Sep 7 05:07:15 2008 for GnuCash by  doxygen 1.5.2