GnuCash  2.6.99
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
gnucash-sheet.h
1 /********************************************************************\
2  * This program is free software; you can redistribute it and/or *
3  * modify it under the terms of the GNU General Public License as *
4  * published by the Free Software Foundation; either version 2 of *
5  * the License, or (at your option) any later version. *
6  * *
7  * This program is distributed in the hope that it will be useful, *
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
10  * GNU General Public License for more details. *
11  * *
12  * You should have received a copy of the GNU General Public License*
13  * along with this program; if not, contact: *
14  * *
15  * Free Software Foundation Voice: +1-617-542-5942 *
16  * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
17  * Boston, MA 02110-1301, USA [email protected] *
18  * *
19 \********************************************************************/
20 
21 #ifndef GNUCASH_SHEET_H
22 #define GNUCASH_SHEET_H
23 
24 
25 #include <gtk/gtk.h>
26 #include "split-register-model.h"
27 #include "table-allgui.h"
28 
29 #define CELL_VPADDING 2
30 #define CELL_HPADDING 5
31 
32 
33 #define GNUCASH_TYPE_REGISTER (gnucash_register_get_type ())
34 #define GNUCASH_REGISTER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GNUCASH_TYPE_REGISTER, GnucashRegister))
35 #define GNUCASH_REGISTER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GNUCASH_TYPE_REGISTER))
36 #define GNUCASH_IS_REGISTER(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), GNUCASH_TYPE_REGISTER))
37 
38 
39 #define GNUCASH_TYPE_SHEET (gnucash_sheet_get_type ())
40 #define GNUCASH_SHEET(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GNUCASH_TYPE_SHEET, GnucashSheet))
41 #define GNUCASH_SHEET_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GNUCASH_TYPE_SHEET))
42 #define GNUCASH_IS_SHEET(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), GNUCASH_TYPE_SHEET))
43 
44 
45 typedef struct _SheetBlockStyle SheetBlockStyle;
46 typedef struct _GnucashSheet GnucashSheet;
48 typedef struct _GnucashRegister GnucashRegister;
50 
51 
52 typedef struct
53 {
54  /* The style for this block */
55  SheetBlockStyle *style;
56 
57  gint origin_x; /* x origin of block */
58  gint origin_y; /* y origin of block */
59 
60  gboolean visible; /* is block visible */
61 } SheetBlock;
62 
63 
64 GType gnucash_sheet_get_type (void);
65 GtkWidget *gnucash_sheet_new (Table *table);
66 
67 void gnucash_sheet_table_load (GnucashSheet *sheet, gboolean do_scroll);
68 
69 void gnucash_sheet_recompute_block_offsets (GnucashSheet *sheet);
70 
71 GType gnucash_register_get_type (void);
72 
73 /* this already has scrollbars attached */
74 GtkWidget *gnucash_register_new (Table *table);
75 
76 SheetBlock *gnucash_sheet_get_block (GnucashSheet *sheet,
77  VirtualCellLocation vcell_loc);
78 
79 gint gnucash_sheet_col_max_width (GnucashSheet *sheet,
80  gint virt_col, gint cell_col);
81 
82 void gnucash_sheet_redraw_all (GnucashSheet *sheet);
83 void gnucash_sheet_redraw_help (GnucashSheet *sheet);
84 
85 void gnucash_sheet_redraw_block (GnucashSheet *sheet,
86  VirtualCellLocation vcell_loc);
87 
88 void gnucash_sheet_cursor_set (GnucashSheet *gsheet, VirtualLocation virt_loc);
89 
90 const char * gnucash_sheet_modify_current_cell(GnucashSheet *sheet,
91  const gchar *new_text);
92 
93 gboolean gnucash_sheet_block_set_from_table (GnucashSheet *sheet,
94  VirtualCellLocation vcell_loc);
95 
96 void gnucash_sheet_set_scroll_region (GnucashSheet *sheet);
97 
98 void gnucash_sheet_cursor_set_from_table (GnucashSheet *sheet,
99  gboolean do_scroll);
100 
101 void gnucash_sheet_compute_visible_range (GnucashSheet *sheet);
102 
103 void gnucash_sheet_make_cell_visible (GnucashSheet *sheet,
104  VirtualLocation virt_loc);
105 
106 void gnucash_sheet_show_range (GnucashSheet *sheet,
107  VirtualCellLocation start_loc,
108  VirtualCellLocation end_loc);
109 
110 void gnucash_sheet_update_adjustments (GnucashSheet *sheet);
111 
112 void gnucash_sheet_set_window (GnucashSheet *sheet, GtkWidget *window);
113 
114 void gnucash_register_goto_virt_cell (GnucashRegister *reg,
115  VirtualCellLocation vcell_loc);
116 
117 void gnucash_register_goto_virt_loc (GnucashRegister *reg,
118  VirtualLocation virt_loc);
119 
120 void gnucash_register_goto_next_virt_row (GnucashRegister *reg);
121 
122 typedef gboolean (*VirtualLocationMatchFunc) (VirtualLocation virt_loc,
123  gpointer user_data);
124 
125 void gnucash_register_goto_next_matching_row (GnucashRegister *reg,
126  VirtualLocationMatchFunc match,
127  gpointer user_data);
128 
129 void gnucash_register_attach_popup(GnucashRegister *reg, GtkWidget *popup,
130  gpointer data);
131 
132 gboolean gnucash_register_has_selection (GnucashRegister *reg);
133 void gnucash_register_cut_clipboard (GnucashRegister *reg);
134 void gnucash_register_copy_clipboard (GnucashRegister *reg);
135 void gnucash_register_paste_clipboard (GnucashRegister *reg);
136 void gnucash_register_refresh_from_prefs (GnucashRegister *reg);
137 void gnucash_register_set_moved_cb (GnucashRegister *reg,
138  GFunc cb, gpointer cb_data);
139 
140 GnucashSheet *gnucash_register_get_sheet (GnucashRegister *reg);
141 
142 GdkColor *get_gtkrc_color (GnucashSheet *sheet, RegisterColor field_type);
143 
144 #endif
145 
RegisterColor
Definition: table-allgui.h:160
Declarations for the Table object.