GnuCash  5.6-150-g038405b370+
gnucash-sheet.h
Go to the documentation of this file.
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 gnu@gnu.org *
18  * *
19 \********************************************************************/
20 
21 #ifndef GNUCASH_SHEET_H
22 #define GNUCASH_SHEET_H
23 
24 #include <gtk/gtk.h>
25 #include "split-register-model.h"
26 #include "table-allgui.h"
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
40 #define GNUCASH_TYPE_SHEET (gnucash_sheet_get_type ())
41 #define GNUCASH_SHEET(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GNUCASH_TYPE_SHEET, GnucashSheet))
42 #define GNUCASH_SHEET_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GNUCASH_TYPE_SHEET))
43 #define GNUCASH_IS_SHEET(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), GNUCASH_TYPE_SHEET))
44 
45 
46 typedef struct _SheetBlockStyle SheetBlockStyle;
47 typedef struct _GnucashSheet GnucashSheet;
48 typedef struct _GnucashSheetClass GnucashSheetClass;
49 
50 
51 typedef struct
52 {
54  SheetBlockStyle *style;
55 
56  gint origin_x;
57  gint origin_y;
59  gboolean visible;
60 } SheetBlock;
61 
62 
63 GType gnucash_sheet_get_type (void);
64 GtkWidget *gnucash_sheet_new (Table *table);
65 
66 void gnucash_sheet_table_load (GnucashSheet *sheet, gboolean do_scroll);
67 
68 void gnucash_sheet_recompute_block_offsets (GnucashSheet *sheet);
69 
70 SheetBlock *gnucash_sheet_get_block (GnucashSheet *sheet,
71  VirtualCellLocation vcell_loc);
72 
73 gint gnucash_sheet_col_max_width (GnucashSheet *sheet,
74  gint virt_col, gint cell_col);
75 
76 void gnucash_sheet_redraw_all (GnucashSheet *sheet);
77 void gnucash_sheet_redraw_help (GnucashSheet *sheet);
78 
79 void gnucash_sheet_redraw_block (GnucashSheet *sheet,
80  VirtualCellLocation vcell_loc);
81 
82 const char * gnucash_sheet_modify_current_cell (GnucashSheet *sheet,
83  const gchar *new_text);
84 
85 gboolean gnucash_sheet_block_set_from_table (GnucashSheet *sheet,
86  VirtualCellLocation vcell_loc);
87 
88 void gnucash_sheet_set_scroll_region (GnucashSheet *sheet);
89 
90 void gnucash_sheet_cursor_set_from_table (GnucashSheet *sheet,
91  gboolean do_scroll);
92 
93 void gnucash_sheet_compute_visible_range (GnucashSheet *sheet);
94 
95 void gnucash_sheet_make_cell_visible (GnucashSheet *sheet,
96  VirtualLocation virt_loc);
97 
98 void gnucash_sheet_show_range (GnucashSheet *sheet,
99  VirtualCellLocation start_loc,
100  VirtualCellLocation end_loc);
101 
102 void gnucash_sheet_update_adjustments (GnucashSheet *sheet);
103 
104 void gnucash_sheet_set_window (GnucashSheet *sheet, GtkWidget *window);
105 
106 void gnucash_get_style_classes (GnucashSheet *sheet, GtkStyleContext *stylectxt,
107  RegisterColor field_type, gboolean use_neg_class);
108 
109 void gnucash_sheet_set_text_bounds (GnucashSheet *sheet, GdkRectangle *rect,
110  gint x, gint y, gint width, gint height);
111 
112 gint gnucash_sheet_get_text_offset (GnucashSheet *sheet, const VirtualLocation virt_loc,
113  gint rect_width, gint logical_width);
114 
115 gboolean gnucash_sheet_is_read_only (GnucashSheet *sheet);
116 
117 void gnucash_sheet_set_has_focus (GnucashSheet *sheet, gboolean has_focus);
118 
119 #ifdef __cplusplus
120 }
121 #endif
122 
124 #endif
TableModels specialized for SplitRegister and template SplitRegister.
void gnucash_get_style_classes(GnucashSheet *sheet, GtkStyleContext *stylectxt, RegisterColor field_type, gboolean use_neg_class)
Map a cell color type to a css style class.
gboolean visible
y origin of block
Definition: gnucash-sheet.h:59
SheetBlockStyle * style
The style for this block.
Definition: gnucash-sheet.h:54
Declarations for the Table object.
RegisterColor
Color definitions used for table elements.
Definition: table-allgui.h:182
gint origin_y
x origin of block
Definition: gnucash-sheet.h:57