00001 /*************************************************************************** 00002 * pilot-qof.h 00003 * 00004 * Sun Apr 17 17:56:17 2005 00005 * Copyright 2005, 2006 Neil Williams 00006 * linux@codehelp.co.uk 00007 ****************************************************************************/ 00008 /* 00009 * This program is free software; you can redistribute it and/or modify 00010 * it under the terms of the GNU General Public License as published by 00011 * the Free Software Foundation; either version 2 of the License, or 00012 * (at your option) any later version. 00013 * 00014 * This program is distributed in the hope that it will be useful, 00015 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 * GNU General Public License for more details. 00018 * 00019 * You should have received a copy of the GNU General Public License 00020 * along with this program; if not, write to the Free Software 00021 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00022 */ 00023 00024 #ifndef _PILOT_QOF_H 00025 #define _PILOT_QOF_H 00026 00092 #include <glib/gprintf.h> 00093 #include "pi-buffer.h" 00094 #include "pi-expense.h" 00095 00097 #define PQ_MOD_PILOT "pilotqof-objects" 00098 00100 #define PQ_MOD_PILOT "pilotqof-objects" 00101 00103 #define PILOT_QOF_LOG "pilot-qof.trace" 00104 00106 #define PQ_MOD_CLI "pilotqof-cli" 00107 00109 #define PQ_DLP_CARD 0 00110 00112 #define PQ_DLP_OFFSET 0 00113 00115 #define PQ_DLP_RECORD 0 00116 00118 #define PQ_DLP_NEW_REC 0 00119 00121 #define PQ_DLP_SET_ID 0 00122 00126 #define PQ_DLP_APPREAD -1 00127 00132 #define PQ_DLP_APPREAD -1 00133 00138 #define PQ_DLP_REC_ATTR 0 00139 00141 #define PQ_DEF_BUFSZ 0xffff 00142 00144 #define PILOT_LINK_SUPPORT "0.12" 00145 00146 //extern int plu_connect (); 00147 00152 #define PQ_PREF_USE_BACKUP 1 00153 00158 #define PQ_PREF_USE_SIZE 0 00159 00161 #define PQ_PREF_VERSION 0 00162 00183 void 00184 pilot_entity_finaliser (QofBook * book, gpointer key, 00185 gpointer data); 00186 00199 void 00200 pilot_qof_pack (QofEntity * ent, gpointer user_data); 00201 00211 void 00212 pilot_qof_unpack (QofEntity * ent, gpointer user_data); 00213 00232 void 00233 pilot_app_unpack (QofIdTypeConst e_type, gpointer user_data); 00234 00242 typedef gint (*QofPack) (QofEntity * ent, gpointer user_data); 00243 00254 typedef struct PilotPack_s 00255 { 00257 QofIdTypeConst e_type; 00260 QofPack pack_func; 00263 QofPack unpack_func; 00266 QofPack free_pack_func; 00269 const gchar *palm_db_name; 00272 QofPack app_info_unpack; 00276 QofPack db_pref_unpack; 00280 gchar *pref_creator; 00283 gint pref_flag; 00284 } PQPack; 00285 00296 gboolean 00297 pilot_qof_pack_register (const PQPack * p); 00298 00304 const PQPack *pilot_qof_pack_lookup (QofIdTypeConst object_type); 00305 00308 typedef struct PQExp_s 00309 { 00311 enum ExpenseDistance unit_of_distance; 00313 gint default_currency; 00315 GList *exp_currency_list; 00316 } PQExpensePref; 00317 00319 typedef struct PQContext_s 00320 { 00322 QofMainContext qof; 00324 gint sd; 00326 gint db; 00328 pi_buffer_t *pi_buf; 00330 pi_buffer_t *app_buf; 00332 CategoryAppInfo_t *pi_cat; 00335 PQExpensePref pi_exp_pref; 00338 guchar pref_buf[PQ_DEF_BUFSZ]; 00340 gchar *port; 00342 gint quiet; 00344 gint ent_category; 00346 const gchar *cat_name; 00348 gchar names[16][16]; 00351 gboolean invoice_city; 00354 gboolean invoice_vendor; 00355 } PQContext; 00356 00363 void qof_cmd_hotsync (PQContext * context); 00364 00367 void pilot_qof_close (void); 00368 00381 PQContext * 00382 pilot_qof_init (void); 00383 00387 #endif /* _PILOT_QOF_H */