]>
Dogcows Code - chaz/homebank/blob - src/homebank.h
9acc5fc8f9c5ef25a2379c73c6fab003a18a55f4
1 /* HomeBank -- Free, easy, personal accounting for everyone.
2 * Copyright (C) 1995-2014 Maxime DOYEN
4 * This file is part of HomeBank.
6 * HomeBank is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * HomeBank 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.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef __HOMEBANK_H__
21 #define __HOMEBANK_H__
27 #include <ctype.h> /* isprint */
32 #include <stdlib.h> /* atoi, atof, atol */
33 #include <string.h> /* memset, memcpy, strcmp, strcpy */
37 #include <glib/gstdio.h>
41 #include "hb-preferences.h"
43 #include "hb-transaction.h"
44 #include "hb-account.h"
45 #include "hb-archive.h"
46 #include "hb-assign.h"
47 #include "hb-category.h"
48 #include "hb-encoding.h"
49 #include "hb-export.h"
50 #include "hb-filter.h"
51 #include "hb-import.h"
54 #include "hb-report.h"
56 #include "hb-hbfile.h"
59 #include "ui-dialogs.h"
61 #include "ui-widgets.h"
63 #define _(str) gettext (str)
64 #define gettext_noop(str) (str)
65 #define N_(str) gettext_noop (str)
68 /* = = = = = = = = = = = = = = = = */
69 /* = = = = = = = = = = = = = = = = = = = = = = = = */
70 /* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =*/
72 #define HB_UNSTABLE FALSE
73 #define HB_VERSION "4.6.3"
74 #define FILE_VERSION 0.9
75 #define PREF_VERSION 460
77 #if HB_UNSTABLE == FALSE
78 #define PROGNAME "HomeBank"
79 #define HB_DATA_PATH "homebank"
81 #define PROGNAME "HomeBank " HB_VERSION " (unstable)"
82 #define HB_DATA_PATH "homebank_unstable"
86 #define GETTEXT_PACKAGE "homebank"
87 #define LOCALE_DIR "locale"
88 #define PIXMAPS_DIR "images"
89 #define HELP_DIR "help"
90 #define PACKAGE_VERSION HB_VERSION
91 #define PACKAGE "homebank"
92 #define VERSION HB_VERSION
94 //#define PORTABLE_APP
100 /* container spacing */
101 #define PHI 1.61803399
103 #define HB_MAINBOX_SPACING 12
104 #define HB_BOX_SPACING 6
106 #define HB_HSPACE_SPACING 18 /* used to separate dialog block */
107 #define HB_TABROW_SPACING 6
108 #define HB_TABCOL_SPACING 6
110 /* widget minimum width */
111 #define HB_MINWIDTH_LIST 161
112 #define HB_MINWIDTH_COMBO 80
115 /* for transaction dialog */
116 #define GTK_RESPONSE_ADD 1
119 #define HB_NUMBER_SAMPLE 20457.99
137 /* Custom HomeBank named icons */
138 #define HB_STOCK_ACCOUNT "hb-account"
139 #define HB_STOCK_ARCHIVE "hb-archive"
140 #define HB_STOCK_ASSIGN "hb-assign"
141 #define HB_STOCK_BUDGET "hb-budget"
142 #define HB_STOCK_CATEGORY "hb-category"
143 #define HB_STOCK_PAYEE "hb-payee"
144 #define HB_STOCK_FILTER "hb-filter"
145 #define HB_STOCK_OPE_ADD "hb-ope-add"
146 #define HB_STOCK_OPE_HERIT "hb-ope-herit"
147 #define HB_STOCK_OPE_EDIT "hb-ope-edit"
148 #define HB_STOCK_OPE_SHOW "hb-ope-show"
149 #define HB_STOCK_OPE_DELETE "hb-ope-delete"
150 #define HB_STOCK_OPE_VALID "hb-ope-valid"
151 #define HB_STOCK_OPE_REMIND "hb-ope-remind"
152 #define HB_STOCK_OPE_AUTO "hb-ope-auto"
153 #define HB_STOCK_REP_STATS "hb-rep-stats"
154 #define HB_STOCK_REP_TIME "hb-rep-time"
155 #define HB_STOCK_REP_BALANCE "hb-rep-balance"
156 #define HB_STOCK_REP_BUDGET "hb-rep-budget"
157 #define HB_STOCK_REP_CAR "hb-rep-vehicle"
161 ** Global application datas
166 GHashTable
*h_cur
; //currencies
167 GHashTable
*h_acc
; //accounts
168 GHashTable
*h_pay
; //payees
169 GHashTable
*h_cat
; //categories
170 GHashTable
*h_tag
; //tags
171 GHashTable
*h_rul
; //assign rules
173 GHashTable
*h_memo
; //memo/description
175 GList
*arc_list
; //archives
176 GList
*ope_list
; //transactions
178 // hbfile (saved properties)
184 guint32 vehicle_category
;
185 //guint32 kcur; // base currency
187 // hbfile (unsaved properties)
189 gboolean hbfile_is_new
;
191 gboolean xhb_hasbak
; //file has backup (*.xhb~) used for revert menu sensitivity
193 // really global stuffs
195 guint32 today
; //today's date
196 gint define_off
; //>0 when a stat, account window is opened
199 GtkWidget
*mainwindow
; //should be global to access attached window data
200 GdkPixbuf
*lst_pixbuf
[NUM_LST_PIXBUF
];
201 gint lst_pixbuf_maxwidth
;
205 gint
homebank_alienfile_recognize(gchar
*filename
);
206 gchar
*homebank_filepath_with_extention(gchar
*path
, gchar
*extension
);
207 gchar
*homebank_filename_without_extention(gchar
*path
);
208 void homebank_file_ensure_xhb(void);
209 void homebank_backup_current_file(gchar
*pathname
);
210 gboolean
homebank_util_url_show (const gchar
*url
);
211 gboolean
homebank_lastopenedfiles_load(void);
212 gboolean
homebank_lastopenedfiles_save(void);
215 void homebank_window_set_icon_from_file(GtkWindow
*window
, gchar
*filename
);
217 const gchar
*homebank_app_get_config_dir (void);
218 const gchar
*homebank_app_get_images_dir (void);
219 const gchar
*homebank_app_get_pixmaps_dir (void);
220 const gchar
*homebank_app_get_locale_dir (void);
221 const gchar
*homebank_app_get_help_dir (void);
222 const gchar
*homebank_app_get_datas_dir (void);
223 const gchar
*homebank_app_get_pkglib_dir (void);
224 guint32
homebank_app_date_get_julian(void);
226 /* - - - - obsolete things - - - - */
230 typedef struct _budget Budget;
This page took 0.050552 seconds and 4 git commands to generate.