GnuCash 2.4.99
gnucash-style.h
00001 /********************************************************************\
00002  * This program is free software; you can redistribute it and/or    *
00003  * modify it under the terms of the GNU General Public License as   *
00004  * published by the Free Software Foundation; either version 2 of   *
00005  * the License, or (at your option) any later version.              *
00006  *                                                                  *
00007  * This program is distributed in the hope that it will be useful,  *
00008  * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
00009  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
00010  * GNU General Public License for more details.                     *
00011  *                                                                  *
00012  * You should have received a copy of the GNU General Public License*
00013  * along with this program; if not, contact:                        *
00014  *                                                                  *
00015  * Free Software Foundation           Voice:  +1-617-542-5942       *
00016  * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652       *
00017  * Boston, MA  02110-1301,  USA       gnu@gnu.org                   *
00018  *                                                                  *
00019 \********************************************************************/
00020 
00021 #ifndef GNUCASH_STYLE_H
00022 #define GNUCASH_STYLE_H
00023 
00024 #include <gnome.h>
00025 
00026 #include "gnucash-sheet.h"
00027 
00028 typedef struct
00029 {
00030     gint pixel_height;
00031     gint pixel_width;
00032 
00033     gint origin_x;
00034     gint origin_y;
00035 
00036     gboolean can_span_over;
00037 } CellDimensions;
00038 
00039 typedef struct
00040 {
00041     gint nrows;
00042     gint ncols;
00043 
00044     /* totals, in pixels */
00045     gint height;
00046     gint width;
00047 
00048     /* per cell parameters */
00049     GTable *cell_dimensions;
00050 
00051     gint refcount;
00052 } BlockDimensions;
00053 
00054 struct _SheetBlockStyle
00055 {
00056     CellBlock * cursor;
00057 
00058     gint nrows;
00059     gint ncols;
00060 
00061     BlockDimensions *dimensions;
00062 
00063     gint refcount;
00064 };
00065 
00066 
00067 gboolean gnucash_style_init (void);
00068 
00069 void gnucash_sheet_style_init(void);
00070 
00071 gint gnucash_style_col_is_resizable (SheetBlockStyle *style, int col);
00072 
00073 CellDimensions * gnucash_style_get_cell_dimensions (SheetBlockStyle *style,
00074         int row, int col);
00075 
00076 void gnucash_sheet_set_col_width (GnucashSheet *sheet, int col, int width);
00077 
00078 gint gnucash_style_row_width(SheetBlockStyle *style, int row);
00079 
00080 void gnucash_sheet_styles_set_dimensions (GnucashSheet *sheet, int width);
00081 
00082 void gnucash_sheet_style_destroy (GnucashSheet *sheet, SheetBlockStyle *style);
00083 
00084 void gnucash_sheet_clear_styles (GnucashSheet *sheet);
00085 void gnucash_sheet_create_styles (GnucashSheet *sheet);
00086 
00087 void gnucash_sheet_compile_styles (GnucashSheet *sheet);
00088 
00089 void gnucash_sheet_styles_recompile (GnucashSheet *sheet);
00090 
00091 SheetBlockStyle *gnucash_sheet_get_style (GnucashSheet *sheet,
00092         VirtualCellLocation vcell_loc);
00093 
00094 SheetBlockStyle *
00095 gnucash_sheet_get_style_from_table (GnucashSheet *sheet,
00096                                     VirtualCellLocation vcell_loc);
00097 
00098 SheetBlockStyle *
00099 gnucash_sheet_get_style_from_cursor (GnucashSheet *sheet,
00100                                      const char *cursor_name);
00101 
00102 void gnucash_sheet_style_get_cell_pixel_rel_coords (SheetBlockStyle *style,
00103         gint cell_row,
00104         gint cell_col,
00105         gint *x, gint *y,
00106         gint *w, gint *h);
00107 
00108 void gnucash_style_ref   (SheetBlockStyle *style);
00109 void gnucash_style_unref (SheetBlockStyle *style);
00110 
00111 void gnucash_sheet_get_borders (GnucashSheet *sheet, VirtualLocation virt_loc,
00112                                 PhysicalCellBorders *borders);
00113 
00114 typedef GHashTable *GNCHeaderWidths;
00115 
00116 GNCHeaderWidths gnc_header_widths_new (void);
00117 void gnc_header_widths_destroy (GNCHeaderWidths widths);
00118 void gnc_header_widths_set_width (GNCHeaderWidths widths,
00119                                   const char *cell_name,
00120                                   int width);
00121 int gnc_header_widths_get_width (GNCHeaderWidths widths,
00122                                  const char *cell_name);
00123 
00124 void gnucash_sheet_get_header_widths (GnucashSheet *sheet,
00125                                       GNCHeaderWidths widths);
00126 void gnucash_sheet_set_header_widths (GnucashSheet *sheet,
00127                                       GNCHeaderWidths widths);
00128 
00129 #endif
00130 
00131 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines