/* HomeBank -- Free, easy, personal accounting for everyone.
- * Copyright (C) 1995-2014 Maxime DOYEN
+ * Copyright (C) 1995-2016 Maxime DOYEN
*
* This file is part of HomeBank.
*
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef __HOMEBANK_H__
-#define __HOMEBANK_H__
+#ifndef _HOMEBANK_H_
+#define _HOMEBANK_H_
#ifdef HAVE_CONFIG_H
#include <config.h>
#include "hb-preferences.h"
#include "hb-transaction.h"
+#include "hb-currency.h"
#include "hb-account.h"
#include "hb-archive.h"
#include "hb-assign.h"
#define gettext_noop(str) (str)
#define N_(str) gettext_noop (str)
-/* = = = = = = = = */
/* = = = = = = = = = = = = = = = = */
-/* = = = = = = = = = = = = = = = = = = = = = = = = */
/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =*/
-#define HB_UNSTABLE FALSE
-#define HB_VERSION "4.6.3"
-#define FILE_VERSION 0.9
-#define PREF_VERSION 460
+#define HB_UNSTABLE FALSE
+
+#define HB_VERSION_MAJOR 5
+#define HB_VERSION_MINOR 1
+#define HB_VERSION_MICRO 2
+
+#define HB_VERSION "5.1.2"
+#define HB_VERSION_NUM (HB_VERSION_MAJOR*10000) + (HB_VERSION_MINOR*100) + HB_VERSION_MICRO
+
+#define FILE_VERSION 1.2
+#define PREF_VERSION 512
#if HB_UNSTABLE == FALSE
#define PROGNAME "HomeBank"
#define HB_DATA_PATH "homebank_unstable"
#endif
+
#ifdef G_OS_WIN32
#define GETTEXT_PACKAGE "homebank"
#define LOCALE_DIR "locale"
#define ENABLE_NLS 1
#endif
+
/* container spacing */
-#define PHI 1.61803399
+#define SPACING_TINY 3
+#define SPACING_SMALL 6
+#define SPACING_MEDIUM 12
+#define SPACING_LARGE 18
-#define HB_MAINBOX_SPACING 12
-#define HB_BOX_SPACING 6
-#define HB_HSPACE_SPACING 18 /* used to separate dialog block */
-#define HB_TABROW_SPACING 6
-#define HB_TABCOL_SPACING 6
+#define HB_MINDATE 693596 //01/01/1900
+#define HB_MAXDATE 803533 //31/12/2200
/* widget minimum width */
#define HB_MINWIDTH_LIST 161
-#define HB_MINWIDTH_COMBO 80
+#define HB_MINHEIGHT_LIST 260
+
+#define HB_MINWIDTH_SEARCH 240
+#define HB_MINWIDTH_COLUMN 48
-/* for transaction dialog */
-#define GTK_RESPONSE_ADD 1
+/* miscellaneous */
+#define PHI 1.61803399
+/* official GTK_RESPONSE are negative */
+#define GTK_RESPONSE_ADD 1
+#define GTK_RESPONSE_ADDKEEP 2
-#define HB_NUMBER_SAMPLE 20457.99
+#define HB_NUMBER_SAMPLE 1234567.89
-enum
+typedef enum
{
FILETYPE_UNKNOW,
FILETYPE_HOMEBANK,
FILETYPE_OFX,
FILETYPE_QIF,
FILETYPE_CSV_HB,
- FILETYPE_AMIGA_HB,
+// FILETYPE_AMIGA_HB,
NUM_FILETYPE
-};
+} HbFileType;
-/*
-** stock icons
-*/
-/* Custom HomeBank named icons */
-#define HB_STOCK_ACCOUNT "hb-account"
-#define HB_STOCK_ARCHIVE "hb-archive"
-#define HB_STOCK_ASSIGN "hb-assign"
-#define HB_STOCK_BUDGET "hb-budget"
-#define HB_STOCK_CATEGORY "hb-category"
-#define HB_STOCK_PAYEE "hb-payee"
-#define HB_STOCK_FILTER "hb-filter"
-#define HB_STOCK_OPE_ADD "hb-ope-add"
-#define HB_STOCK_OPE_HERIT "hb-ope-herit"
-#define HB_STOCK_OPE_EDIT "hb-ope-edit"
-#define HB_STOCK_OPE_SHOW "hb-ope-show"
-#define HB_STOCK_OPE_DELETE "hb-ope-delete"
-#define HB_STOCK_OPE_VALID "hb-ope-valid"
-#define HB_STOCK_OPE_REMIND "hb-ope-remind"
-#define HB_STOCK_OPE_AUTO "hb-ope-auto"
-#define HB_STOCK_REP_STATS "hb-rep-stats"
-#define HB_STOCK_REP_TIME "hb-rep-time"
-#define HB_STOCK_REP_BALANCE "hb-rep-balance"
-#define HB_STOCK_REP_BUDGET "hb-rep-budget"
-#define HB_STOCK_REP_CAR "hb-rep-vehicle"
+/* ---- icon size as defined into gtkiconfactory.c ---- */
+/* GTK_ICON_SIZE_MENU 16
+ * GTK_ICON_SIZE_BUTTON 20
+ * GTK_ICON_SIZE_SMALL_TOOLBAR 18
+ * GTK_ICON_SIZE_LARGE_TOOLBAR 24 (default for toolbar)
+ * GTK_ICON_SIZE_DND 32
+ * GTK_ICON_SIZE_DIALOG 48
+ */
+
+/* -------- named icons (Standard Icon Name) -------- */
+#define ICONNAME_NEW "document-new"
+#define ICONNAME_OPEN "document-open"
+#define ICONNAME_SAVE "document-save"
+#define ICONNAME_SAVE_AS "document-save-as" //obsolete
+#define ICONNAME_REVERT "document-revert" //obsolete
+#define ICONNAME_PRINT "document-print" //unused
+#define ICONNAME_PROPERTIES "document-properties" //obsolete
+#define ICONNAME_CLOSE "window-close" //obsolete
+#define ICONNAME_QUIT "application-exit" //obsolete
+#define ICONNAME_FIND "edit-find"
+#define ICONNAME_CLEAR "edit-clear"
+#define ICONNAME_WARNING "dialog-warning"
+#define ICONNAME_ERROR "dialog-error"
+#define ICONNAME_INFO "dialog-information"
+#define ICONNAME_HELP "help-browser" //obsolete
+#define ICONNAME_ABOUT "help-about" //obsolete
+#define ICONNAME_PREFERENCES "preferences-system" //obsolete
+#define ICONNAME_REFRESH "view-refresh"
+
+#define ICONNAME_FOLDER "folder-symbolic"
+
+#define ICONNAME_LIST_ADD "list-add-symbolic"
+#define ICONNAME_LIST_REMOVE "list-remove-symbolic"
+
+//#define ICONNAME_HB_SCHED_SKIP "media-skip-forward"
+//#define ICONNAME_HB_SCHED_POST "media-playback-start"
+
+// custom or gnome not found
+#define ICONNAME_HB_BUTTON_MENU "open-menu-symbolic"
+#define ICONNAME_HB_TOGGLE_SIGN "toggle-sign-symbolic"
+
+
+/* -------- named icons (Custom to homebank) -------- */
+#define ICONNAME_HB_CURRENCY "hb-currency"
+#define ICONNAME_HB_ACCOUNT "hb-account"
+#define ICONNAME_HB_ARCHIVE "hb-archive"
+#define ICONNAME_HB_ASSIGN "hb-assign"
+#define ICONNAME_HB_BUDGET "hb-budget"
+#define ICONNAME_HB_CATEGORY "hb-category"
+#define ICONNAME_HB_PAYEE "hb-payee"
+#define ICONNAME_HB_OPE_SHOW "hb-ope-show" //? "view-register
+#define ICONNAME_HB_REP_STATS "hb-rep-stats"
+#define ICONNAME_HB_REP_TIME "hb-rep-time"
+#define ICONNAME_HB_REP_BALANCE "hb-rep-balance"
+#define ICONNAME_HB_REP_BUDGET "hb-rep-budget"
+#define ICONNAME_HB_REP_CAR "hb-rep-vehicle"
+
+#define ICONNAME_HB_VIEW_LIST "hb-view-list" //"view-list-text"
+#define ICONNAME_HB_VIEW_BAR "hb-view-bar" //"view-chart-bar"
+#define ICONNAME_HB_VIEW_COLUMN "hb-view-column" //"view-chart-column"
+#define ICONNAME_HB_VIEW_LINE "hb-view-line" //"view-chart-line"
+#define ICONNAME_HB_VIEW_STACK "hb-view-stack" //"view-chart-stack"
+#define ICONNAME_HB_VIEW_PIE "hb-view-pie" //"view-chart-pie"
+#define ICONNAME_HB_VIEW_DONUT "hb-view-donut" //"view-chart-donut"
+#define ICONNAME_HB_SHOW_LEGEND "hb-legend" //"view-legend"
+#define ICONNAME_HB_SHOW_RATE "hb-rate" // obsolete ?
+#define ICONNAME_HB_FILTER "hb-filter" //"edit-filter"
+
+#define ICONNAME_HB_FILE_IMPORT "hb-file-import" //document-import
+#define ICONNAME_HB_FILE_EXPORT "hb-file-export" //document-export
+#define ICONNAME_HB_FILE_VALID "hb-file-valid"
+#define ICONNAME_HB_FILE_INVALID "hb-file-invalid"
+
+#define ICONNAME_HB_BUTTON_COLLAPSE "btn-collapse"
+#define ICONNAME_HB_BUTTON_EXPAND "btn-expand"
+#define ICONNAME_HB_BUTTON_SPLIT "btn-split"
+
+#define ICONNAME_HB_OPE_AUTO "hb-ope-auto" //?
+#define ICONNAME_HB_OPE_BUDGET "hb-ope-budget" //?
+#define ICONNAME_HB_OPE_ADD "hb-ope-add" //? "edit-add"
+#define ICONNAME_HB_OPE_HERIT "hb-ope-herit" //? "edit-clone"
+#define ICONNAME_HB_OPE_EDIT "hb-ope-edit" //
+#define ICONNAME_HB_OPE_MULTIEDIT "hb-ope-multiedit" //
+#define ICONNAME_HB_OPE_DELETE "hb-ope-delete" //? "edit-delete"
+#define ICONNAME_CONVERT "hb-ope-convert"
+#define ICONNAME_HB_ASSIGN_RUN "hb-assign-run"
+
+#define ICONNAME_HB_OPE_VALID "hb-ope-valid" // obsolete ?
+#define ICONNAME_HB_OPE_CLEARED "hb-ope-cleared"
+#define ICONNAME_HB_OPE_RECONCILED "hb-ope-reconciled"
+#define ICONNAME_HB_OPE_REMIND "hb-ope-remind"
+
/*
struct HomeBank
{
// hbfile storage
- GHashTable *h_cur; //currencies
- GHashTable *h_acc; //accounts
- GHashTable *h_pay; //payees
- GHashTable *h_cat; //categories
- GHashTable *h_tag; //tags
- GHashTable *h_rul; //assign rules
+ GHashTable *h_cur; //currencies
+ GHashTable *h_acc; //accounts
+ GHashTable *h_pay; //payees
+ GHashTable *h_cat; //categories
+ GHashTable *h_tag; //tags
+ GHashTable *h_rul; //assign rules
+
+ GHashTable *h_memo; //memo/description
- GHashTable *h_memo; //memo/description
+ GList *arc_list; //archives
- GList *arc_list; //archives
- GList *ope_list; //transactions
+ //#1419304 we keep the deleted txn to a stack trash
+ GTrashStack *txn_stk;
// hbfile (saved properties)
- gchar *owner;
- gshort auto_smode;
- gshort auto_weekday;
- gshort auto_nbdays;
+ gchar *owner;
+ gshort auto_smode;
+ gshort auto_weekday;
+ gshort auto_nbdays;
- guint32 vehicle_category;
- //guint32 kcur; // base currency
+ guint32 vehicle_category;
+ guint32 kcur; // base currency
// hbfile (unsaved properties)
- guint changes_count;
- gboolean hbfile_is_new;
- gchar *xhb_filepath;
- gboolean xhb_hasbak; //file has backup (*.xhb~) used for revert menu sensitivity
+ guint changes_count;
+ gboolean hbfile_is_new;
+ gchar *xhb_filepath;
+ gboolean xhb_hasbak; //file has backup (*.xhb~) used for revert menu sensitivity
// really global stuffs
- gboolean first_run;
- guint32 today; //today's date
- gint define_off; //>0 when a stat, account window is opened
- gboolean minor;
+ gboolean first_run;
+ guint32 today; //today's date
+ gint define_off; //>0 when a stat, account window is opened
+ gboolean minor;
- GtkWidget *mainwindow; //should be global to access attached window data
- GdkPixbuf *lst_pixbuf[NUM_LST_PIXBUF];
- gint lst_pixbuf_maxwidth;
+ GtkWidget *mainwindow; //should be global to access attached window data
+ GtkIconTheme *icontheme;
+ //GdkPixbuf *lst_pixbuf[NUM_LST_PIXBUF];
+ //gint lst_pixbuf_maxwidth;
};
gint homebank_alienfile_recognize(gchar *filename);
gchar *homebank_filepath_with_extention(gchar *path, gchar *extension);
gchar *homebank_filename_without_extention(gchar *path);
-void homebank_file_ensure_xhb(void);
-void homebank_backup_current_file(gchar *pathname);
+void homebank_file_ensure_xhb(gchar *filename);
+void homebank_backup_current_file(void);
gboolean homebank_util_url_show (const gchar *url);
gboolean homebank_lastopenedfiles_load(void);
gboolean homebank_lastopenedfiles_save(void);
/* - - - - obsolete things - - - - */
/*
-
typedef struct _budget Budget;
struct _budget
};
*/
-
-
-
#endif