]> Dogcows Code - chaz/homebank/blob - src/ui-currency.h
Merge branch 'upstream'
[chaz/homebank] / src / ui-currency.h
1 /* HomeBank -- Free, easy, personal accounting for everyone.
2 * Copyright (C) 1995-2019 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_CURRENCY_GTK_H__
21 #define __HB_CURRENCY_GTK_H__
22
23 enum
24 {
25 LST_DEFCUR_TOGGLE,
26 LST_DEFCUR_DATAS,
27 NUM_LST_DEFCUR
28 };
29
30 enum
31 {
32 LST_SELCUR_NAME,
33 LST_SELCUR_DATA,
34 NUM_LST_SELCUR
35 };
36
37
38 struct ui_cur_manage_dialog_data
39 {
40 GtkWidget *window;
41
42 GtkWidget *LV_cur;
43 // GtkWidget *CY_curr;
44 // GtkWidget *BT_curr;
45
46 GtkWidget *BB_update;
47 GtkWidget *BT_add;
48 GtkWidget *BT_rem;
49 GtkWidget *BT_edit;
50 GtkWidget *BT_base;
51
52 gint change;
53 };
54
55
56 struct ui_cur_edit_dialog_data
57 {
58 GtkWidget *window;
59
60 GtkWidget *LB_name;
61 GtkWidget *LB_rate;
62 GtkWidget *NB_rate;
63
64 GtkWidget *LB_sample;
65
66 GtkWidget *ST_symbol;
67 GtkWidget *CM_symisprefix;
68 GtkWidget *ST_decimalchar;
69 GtkWidget *ST_groupingchar;
70 GtkWidget *NB_fracdigits;
71
72 };
73
74 enum {
75 CUR_SELECT_MODE_NORMAL,
76 CUR_SELECT_MODE_BASE
77 };
78
79
80 struct ui_cur_select_dialog_data
81 {
82 GtkWidget *window;
83
84 GtkTreeModel *modelfilter;
85 GtkTreeModel *sortmodel;
86 GtkTreeModel *model;
87 GtkWidget *ST_search;
88 GtkWidget *LV_cur;
89 GtkWidget *CM_custom;
90 GtkWidget *LB_custiso, *ST_custiso;
91 GtkWidget *LB_custname, *ST_custname;
92 };
93
94
95 struct curPopContext
96 {
97 GtkTreeModel *model;
98 guint except_key;
99 };
100
101
102 struct curSelectContext
103 {
104 Currency4217 *cur_4217;
105 gchar *cur_name;
106 gchar *cur_iso;
107 };
108
109
110
111 gchar *ui_cur_combobox_get_name(GtkComboBox *entry_box);
112 guint32 ui_cur_combobox_get_key(GtkComboBox *entry_box);
113 guint32 ui_cur_combobox_get_key_add_new(GtkComboBox *entry_box);
114 gboolean ui_cur_combobox_set_active(GtkComboBox *entry_box, guint32 key);
115 void ui_cur_combobox_add(GtkComboBox *entry_box, Currency *cur);
116 void ui_cur_combobox_populate(GtkComboBox *entry_box, GHashTable *hash);
117 void ui_cur_combobox_populate_except(GtkComboBox *entry_box, GHashTable *hash, guint except_key);
118 GtkWidget *ui_cur_combobox_new(GtkWidget *label);
119
120 /* = = = = = = = = = = */
121
122 void ui_cur_listview_add(GtkTreeView *treeview, Currency *item);
123 guint32 ui_cur_listview_get_selected_key(GtkTreeView *treeview);
124 void ui_cur_listview_remove_selected(GtkTreeView *treeview);
125 void ui_cur_listview_populate(GtkWidget *view);
126 GtkWidget *ui_cur_listview_new(gboolean withtoggle);
127
128 gint ui_cur_manage_dialog_update_currencies(GtkWindow *parent);
129
130 GtkWidget *ui_cur_manage_dialog (void);
131
132 gint ui_cur_select_dialog_new(GtkWindow *parent, gint select_mode, struct curSelectContext *ctx);
133
134 void ui_cur_edit_dialog_new(GtkWindow *parent, Currency *cur);
135
136 #endif
137
This page took 0.035922 seconds and 4 git commands to generate.