1 /*  HomeBank -- Free, easy, personal accounting for everyone.
2  *  Copyright (C) 1995-2021 Maxime DOYEN
3  *
4  *  This file is part of HomeBank.
5  *
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.
10  *
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.
15  *
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/>.
18  */
19 
20 #ifndef __HB_MANWINDOW_GTK_H__
21 #define __HB_MANWINDOW_GTK_H__
22 
23 
24 typedef struct _pnlaccgrp PnlAccGrp;
25 
26 struct _pnlaccgrp
27 {
28 	gchar		*name;
29 	//gshort		type;
30 	//gshort		pos;
31 	//gboolean	expanded;
32 	gdouble		bal_clear;
33 	gdouble		bal_recon;
34 	gdouble		bal_today;
35 	gdouble		bal_future;
36 	GPtrArray	*acclist;
37 };
38 
39 
40 
41 struct hbfile_data
42 {
43 	GtkWidget	*window;
44 	GtkWidget	*dbgchange;
45 	GtkCssProvider *provider;
46 
47 	GtkWidget	*menubar;
48 	GtkWidget	*ME_menufile, *ME_menuedit, *ME_menuview, *ME_menuman, *ME_menutxn, *ME_menurep, *ME_menutool, *ME_menuhelp;
49 	GtkWidget	*MI_new, *MI_open, *MI_save, *MI_saveas, *MI_import, *MI_exportqif, *MI_revert, *MI_openbak, *MI_properties, *MI_close, *MI_quit;
50 	GtkWidget	*MI_prefs, *MI_showtbar, *MI_showspend, *MI_showbotlist, *MI_eurominor;
51 	GtkWidget	*MI_manacc, *MI_manpay, *MI_mancat, *MI_mantpl, *MI_manbud, *MI_manbudtable, *MI_manasg, *MI_mancur, *MI_mantag;
52 	GtkWidget	*MI_txnadd, *MI_txnshow, *MI_txnshowall, *MI_scheduler, *MI_addscheduled;
53 	GtkWidget	*MI_repstat, *MI_reptime, *MI_repbal, *MI_repbudg, *MI_repvehi;
54 	GtkWidget	*MI_welcome, *MI_filestats, *MI_anonymise;
55 	GtkWidget	*MI_contents, *MI_online, *MI_updates, *MI_relnote, *MI_problem, *MI_translate, *MI_about;
56 
57 	GtkWidget	*toolbar;
58 	GtkWidget	*BT_new, *BT_open, *BT_save;
59 	GtkWidget	*BT_manacc, *BT_manpay, *BT_mancat, *BT_mantpl, *BT_manbud, *BT_manasg;
60 	GtkWidget	*BT_txnshow, *BT_txnadd;
61 	GtkWidget	*BT_repstat, *BT_reptime, *BT_repbal, *BT_repbudg, *BT_repvehi;
62 	GtkWidget	*BT_help, *BT_donate;
63 
64 	GtkWidget	*vpaned;
65 	GtkWidget	*hpaned;
66 
67 	/* panel: your account */
68 	GtkWidget	*LV_acc;
69 	GtkWidget   *BT_expandall;
70 	GtkWidget   *BT_collapseall;
71 	gboolean	showall;
72 	GSimpleActionGroup *action_group_acc;
73 	GHashTable  *h_accgrp;
74 	PnlAccGrp	*totaccgrp;
75 
76 	GtkWidget	*GR_top;
77 	GtkWidget	*LV_top;
78 	gdouble		toptotal;
79 	GtkWidget	*CY_range;
80 	GtkWidget	*RE_pie;
81 
82 	GtkWidget	*GR_upc;
83 
84 	GtkWidget	*LV_upc;
85 	GtkWidget   *LB_maxpostdate;
86 	GtkWidget   *BT_sched_skip;
87 	GtkWidget   *BT_sched_post;
88 	GtkWidget   *BT_sched_editpost;
89 	GtkWidget	*CY_sched_range;
90 	GtkWidget   *RA_type;
91 
92 	GtkWidget	*stack;
93 	// max is 2=HUB_TXN_TYPE_REMIND, so 3 elt
94 	GtkWidget	*LV_txn[3];
95 
96 	gchar	*wintitle;
97 
98 	Account *acc;
99 
100 	gint	busy;
101 
102 	GtkRecentManager *recent_manager;
103 	GtkWidget *recent_menu;
104 
105 	Filter		*filter;
106 
107 	/*
108 	UBYTE	accnum;
109 	UBYTE	pad0;
110 	struct	Account *acc;
111 
112 	ULONG	mindate, maxdate;
113 	ULONG	change;
114 	ULONG	keyvalue;
115 	UBYTE	title[140];
116 	UBYTE	Filename[108];
117 	UBYTE	csvpath[108];
118 	*/
119 };
120 
121 
122 enum {
123 	HB_WELCOME_OPENLAST = 2,
124 	HB_WELCOME_CREATENEW,
125 	HB_WELCOME_OPENEXISTING,
126 	HB_WELCOME_OPENSAMPLE,
127 	HB_WELCOME_READMANUAL,
128 	HB_WELCOME_CONFIGPREF,
129 };
130 
131 
132 
133 //temporary ?
134 void ui_mainwindow_defarchive(Archive *arc);
135 
136 
137 GtkWidget *create_hbfile_window(GtkWidget *do_widget);
138 void ui_mainwindow_populate_accounts(GtkWidget *widget, gpointer user_data);
139 void ui_mainwindow_open_check(GtkWidget *widget, gchar *filepath);
140 void ui_mainwindow_open_internal(GtkWidget *widget, gpointer user_data);
141 void ui_mainwindow_update(GtkWidget *widget, gpointer user_data);
142 gint ui_mainwindow_action_help_welcome(void);
143 
144 #endif /* __HB_MANWINDOW_GTK_H__ */
145