1 #ifndef _GNM_SHEET_STYLE_H_
2 # define _GNM_SHEET_STYLE_H_
5 #include <style-border.h>
9 struct _GnmStyleRegion
{
10 GnmRange range
; /* must be 1st */
16 int row
, start_col
, end_col
;
18 GnmStyle
const **styles
;
19 GnmBorder
const **top
;
20 GnmBorder
const **bottom
;
21 GnmBorder
const **vertical
;
24 GnmStyle
*sheet_style_default (Sheet
const *sheet
);
25 GnmStyle
const *sheet_style_get (Sheet
const *sheet
, int col
, int row
);
26 GnmStyle
*sheet_style_find (Sheet
const *sheet
, GnmStyle
*st
);
27 void sheet_style_get_row (Sheet
const *sheet
, GnmStyleRow
*sr
);
28 GnmStyle
**sheet_style_get_row2 (Sheet
const *sheet
, int row
);
29 void sheet_style_apply_border (Sheet
*sheet
, GnmRange
const *range
,
31 void sheet_style_apply_range (Sheet
*sheet
, GnmRange
const *range
,
33 void sheet_style_apply_range2 (Sheet
*sheet
, GnmRange
const *range
,
35 void sheet_style_set_range (Sheet
*sheet
, GnmRange
const *range
,
37 void sheet_style_apply_col (Sheet
*sheet
, int col
,
39 void sheet_style_apply_row (Sheet
*sheet
, int row
,
41 void sheet_style_set_pos (Sheet
*sheet
, int col
, int row
,
43 void sheet_style_apply_pos (Sheet
*sheet
, int col
, int row
,
46 void sheet_style_insdel_colrow (GnmExprRelocateInfo
const *rinfo
);
47 void sheet_style_relocate (GnmExprRelocateInfo
const *rinfo
);
48 unsigned int sheet_style_find_conflicts (Sheet
const *sheet
, GnmRange
const *r
,
50 GnmBorder
*borders
[GNM_STYLE_BORDER_EDGE_MAX
]);
51 void sheet_style_get_extent (Sheet
const *sheet
, GnmRange
*r
);
52 void sheet_style_get_nondefault_extent (Sheet
const *sheet
, GnmRange
*extent
,
53 const GnmRange
*src
, GnmStyle
**col_defaults
);
54 guint8
* sheet_style_get_nondefault_rows (Sheet
const *sheet
,
55 GnmStyle
**col_defaults
);
57 gboolean
sheet_style_is_default (Sheet
const *sheet
, const GnmRange
*r
, GnmStyle
**col_defaults
);
58 void style_row_init (GnmBorder
const * * *prev_vert
,
59 GnmStyleRow
*sr
, GnmStyleRow
*next_sr
,
60 int start_col
, int end_col
,
61 gpointer mem
, gboolean hide_grid
);
62 GnmHLink
*sheet_style_region_contains_link (Sheet
const *sheet
, GnmRange
const *r
);
63 void sheet_style_foreach (Sheet
const *sheet
,
66 void sheet_style_range_foreach (Sheet
const *sheet
, GnmRange
const *r
,
70 GnmStyle
**sheet_style_most_common (Sheet
const *sheet
, gboolean is_col
);
72 void sheet_style_init (Sheet
*sheet
);
73 void sheet_style_resize (Sheet
*sheet
, int cols
, int rows
);
74 void sheet_style_shutdown (Sheet
*sheet
);
76 void sheet_style_set_auto_pattern_color (Sheet
*sheet
,
77 GnmColor
*grid_color
);
78 GnmColor
*sheet_style_get_auto_pattern_color (Sheet
const *sheet
);
79 void sheet_style_update_grid_color (Sheet
const *sheet
);
81 GnmStyle
const *style_list_get_style (GnmStyleList
const *l
, int col
, int row
);
82 void style_list_free (GnmStyleList
*l
);
83 GnmStyleList
*sheet_style_get_range (Sheet
const *sheet
, GnmRange
const *r
);
85 typedef gboolean (*sheet_style_set_list_cb_t
) (GnmRange
*range
,
88 GnmSpanCalcFlags
sheet_style_set_list (Sheet
*sheet
,
89 GnmCellPos
const *corner
,
90 GnmStyleList
const *l
,
91 sheet_style_set_list_cb_t range_modify
,
94 GnmStyleList
*sheet_style_collect_conditions (Sheet
const *sheet
,
96 GnmStyleList
*sheet_style_collect_hlinks (Sheet
const *sheet
,
98 GnmStyleList
*sheet_style_collect_validations (Sheet
const *sheet
,
101 GType
gnm_style_region_get_type (void); /* boxed type */
102 GnmStyleRegion
*gnm_style_region_new (GnmRange
const *range
, GnmStyle
*style
);
103 void gnm_style_region_free (GnmStyleRegion
*sr
);
106 /* For internal use only */
107 void sheet_style_unlink (Sheet
*sheet
, GnmStyle
*st
);
109 void sheet_style_optimize (Sheet
*sheet
);
111 void sheet_style_clear_style_dependents (Sheet
*sheet
, GnmRange
const *r
);
115 #endif /* _GNM_SHEET_STYLE_H_ */