GnuCash  2.6.99
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
gnucash-style.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_STYLE_H
22 #define GNUCASH_STYLE_H
23 
24 #include "gnucash-sheet.h"
25 
26 typedef struct
27 {
28  gint pixel_height;
29  gint pixel_width;
30 
31  gint origin_x;
32  gint origin_y;
33 
34  gboolean can_span_over;
36 
37 typedef struct
38 {
39  gint nrows;
40  gint ncols;
41 
42  /* totals, in pixels */
43  gint height;
44  gint width;
45 
46  /* per cell parameters */
47  GTable *cell_dimensions;
48 
49  gint refcount;
51 
53 {
54  CellBlock * cursor;
55 
56  gint nrows;
57  gint ncols;
58 
59  BlockDimensions *dimensions;
60 
61  gint refcount;
62 };
63 
64 
65 gboolean gnucash_style_init (void);
66 
67 void gnucash_sheet_style_init(void);
68 
69 gint gnucash_style_col_is_resizable (SheetBlockStyle *style, int col);
70 
71 CellDimensions * gnucash_style_get_cell_dimensions (SheetBlockStyle *style,
72  int row, int col);
73 
74 void gnucash_sheet_set_col_width (GnucashSheet *sheet, int col, int width);
75 
76 gint gnucash_style_row_width(SheetBlockStyle *style, int row);
77 
78 void gnucash_sheet_styles_set_dimensions (GnucashSheet *sheet, int width);
79 
80 void gnucash_sheet_style_destroy (GnucashSheet *sheet, SheetBlockStyle *style);
81 
82 void gnucash_sheet_clear_styles (GnucashSheet *sheet);
83 void gnucash_sheet_create_styles (GnucashSheet *sheet);
84 
85 void gnucash_sheet_compile_styles (GnucashSheet *sheet);
86 
87 void gnucash_sheet_styles_recompile (GnucashSheet *sheet);
88 
89 SheetBlockStyle *gnucash_sheet_get_style (GnucashSheet *sheet,
90  VirtualCellLocation vcell_loc);
91 
93 gnucash_sheet_get_style_from_table (GnucashSheet *sheet,
94  VirtualCellLocation vcell_loc);
95 
97 gnucash_sheet_get_style_from_cursor (GnucashSheet *sheet,
98  const char *cursor_name);
99 
100 void gnucash_sheet_style_get_cell_pixel_rel_coords (SheetBlockStyle *style,
101  gint cell_row,
102  gint cell_col,
103  gint *x, gint *y,
104  gint *w, gint *h);
105 
106 void gnucash_style_ref (SheetBlockStyle *style);
107 void gnucash_style_unref (SheetBlockStyle *style);
108 
109 void gnucash_sheet_get_borders (GnucashSheet *sheet, VirtualLocation virt_loc,
110  PhysicalCellBorders *borders);
111 
112 typedef GHashTable *GNCHeaderWidths;
113 
114 GNCHeaderWidths gnc_header_widths_new (void);
115 void gnc_header_widths_destroy (GNCHeaderWidths widths);
116 void gnc_header_widths_set_width (GNCHeaderWidths widths,
117  const char *cell_name,
118  int width);
119 int gnc_header_widths_get_width (GNCHeaderWidths widths,
120  const char *cell_name);
121 
122 void gnucash_sheet_get_header_widths (GnucashSheet *sheet,
123  GNCHeaderWidths widths);
124 void gnucash_sheet_set_header_widths (GnucashSheet *sheet,
125  GNCHeaderWidths widths);
126 
127 #endif
128 
129 
Definition: gtable.c:28