GUI: Move .ui files from goffice resources to glib resources
[gnumeric.git] / src / sheet-style.h
blobff1b7d02632adcfa04846cb6e5a709f4e8ac1fc1
1 /* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 #ifndef _GNM_SHEET_STYLE_H_
3 # define _GNM_SHEET_STYLE_H_
5 #include "gnumeric.h"
6 #include "style-border.h"
8 G_BEGIN_DECLS
10 struct _GnmStyleRegion {
11 GnmRange range; /* must be 1st */
12 GnmStyle *style;
15 struct _GnmStyleRow {
16 gboolean hide_grid;
17 int row, start_col, end_col;
18 Sheet const *sheet;
19 GnmStyle const **styles;
20 GnmBorder const **top;
21 GnmBorder const **bottom;
22 GnmBorder const **vertical;
25 GnmStyle *sheet_style_default (Sheet const *sheet);
26 GnmStyle const *sheet_style_get (Sheet const *sheet, int col, int row);
27 GnmStyle *sheet_style_find (Sheet const *sheet, GnmStyle *st);
28 void sheet_style_get_row (Sheet const *sheet, GnmStyleRow *sr);
29 GnmStyle **sheet_style_get_row2 (Sheet const *sheet, int row);
30 void sheet_style_apply_border (Sheet *sheet, GnmRange const *range,
31 GnmBorder **borders);
32 void sheet_style_apply_range (Sheet *sheet, GnmRange const *range,
33 GnmStyle *pstyle);
34 void sheet_style_apply_range2 (Sheet *sheet, GnmRange const *range,
35 GnmStyle *pstyle);
36 void sheet_style_set_range (Sheet *sheet, GnmRange const *range,
37 GnmStyle *style);
38 void sheet_style_apply_col (Sheet *sheet, int col,
39 GnmStyle *style);
40 void sheet_style_apply_row (Sheet *sheet, int row,
41 GnmStyle *style);
42 void sheet_style_set_pos (Sheet *sheet, int col, int row,
43 GnmStyle *style);
44 void sheet_style_apply_pos (Sheet *sheet, int col, int row,
45 GnmStyle *style);
47 void sheet_style_insdel_colrow (GnmExprRelocateInfo const *rinfo);
48 void sheet_style_relocate (GnmExprRelocateInfo const *rinfo);
49 unsigned int sheet_style_find_conflicts (Sheet const *sheet, GnmRange const *r,
50 GnmStyle **style,
51 GnmBorder *borders[GNM_STYLE_BORDER_EDGE_MAX]);
52 void sheet_style_get_extent (Sheet const *sheet, GnmRange *r);
53 void sheet_style_get_nondefault_extent (Sheet const *sheet, GnmRange *extent,
54 const GnmRange *src, GnmStyle **col_defaults);
55 guint8 * sheet_style_get_nondefault_rows (Sheet const *sheet,
56 GnmStyle **col_defaults);
58 gboolean sheet_style_is_default (Sheet const *sheet, const GnmRange *r, GnmStyle **col_defaults);
59 void style_row_init (GnmBorder const * * *prev_vert,
60 GnmStyleRow *sr, GnmStyleRow *next_sr,
61 int start_col, int end_col,
62 gpointer mem, gboolean hide_grid);
63 GnmHLink *sheet_style_region_contains_link (Sheet const *sheet, GnmRange const *r);
64 void sheet_style_foreach (Sheet const *sheet,
65 GFunc func,
66 gpointer user_data);
67 void sheet_style_range_foreach (Sheet const *sheet, GnmRange const *r,
68 GHFunc func,
69 gpointer user_data);
71 GnmStyle **sheet_style_most_common (Sheet const *sheet, gboolean is_col);
73 void sheet_style_init (Sheet *sheet);
74 void sheet_style_resize (Sheet *sheet, int cols, int rows);
75 void sheet_style_shutdown (Sheet *sheet);
77 void sheet_style_set_auto_pattern_color (Sheet *sheet,
78 GnmColor *grid_color);
79 GnmColor *sheet_style_get_auto_pattern_color (Sheet const *sheet);
80 void sheet_style_update_grid_color (Sheet const *sheet);
82 GnmStyle const *style_list_get_style (GnmStyleList const *l, int col, int row);
83 void style_list_free (GnmStyleList *l);
84 GnmStyleList *sheet_style_get_range (Sheet const *sheet, GnmRange const *r);
86 typedef gboolean (*sheet_style_set_list_cb_t) (GnmRange *range,
87 Sheet const *sheet,
88 gpointer data);
89 GnmSpanCalcFlags sheet_style_set_list (Sheet *sheet,
90 GnmCellPos const *corner,
91 GnmStyleList const *l,
92 sheet_style_set_list_cb_t range_modify,
93 gpointer data);
95 GnmStyleList *sheet_style_collect_conditions (Sheet const *sheet,
96 GnmRange const *r);
97 GnmStyleList *sheet_style_collect_hlinks (Sheet const *sheet,
98 GnmRange const *r);
99 GnmStyleList *sheet_style_collect_validations (Sheet const *sheet,
100 GnmRange const *r);
102 GType gnm_style_region_get_type (void); /* boxed type */
103 GnmStyleRegion *gnm_style_region_new (GnmRange const *range, GnmStyle *style);
104 void gnm_style_region_free (GnmStyleRegion *sr);
107 /* For internal use only */
108 void sheet_style_unlink (Sheet *sheet, GnmStyle *st);
110 void sheet_style_optimize (Sheet *sheet);
112 void sheet_style_clear_style_dependents (Sheet *sheet, GnmRange const *r);
114 G_END_DECLS
116 #endif /* _GNM_SHEET_STYLE_H_ */