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_
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_set_range (Sheet
*sheet
, GnmRange
const *range
,
35 void sheet_style_apply_col (Sheet
*sheet
, int col
,
37 void sheet_style_apply_row (Sheet
*sheet
, int row
,
39 void sheet_style_set_pos (Sheet
*sheet
, int col
, int row
,
41 void sheet_style_apply_pos (Sheet
*sheet
, int col
, int row
,
44 void sheet_style_insdel_colrow (GnmExprRelocateInfo
const *rinfo
);
45 void sheet_style_relocate (GnmExprRelocateInfo
const *rinfo
);
46 unsigned int sheet_style_find_conflicts (Sheet
const *sheet
, GnmRange
const *r
,
47 GnmStyle
**style
, GnmBorder
**borders
);
48 void sheet_style_get_extent (Sheet
const *sheet
, GnmRange
*r
);
49 void sheet_style_get_nondefault_extent (Sheet
const *sheet
, GnmRange
*extent
,
50 const GnmRange
*src
, GnmStyle
**col_defaults
);
51 guint8
* sheet_style_get_nondefault_rows (Sheet
const *sheet
,
52 GnmStyle
**col_defaults
);
54 gboolean
sheet_style_is_default (Sheet
const *sheet
, const GnmRange
*r
, GnmStyle
**col_defaults
);
55 void style_row_init (GnmBorder
const * * *prev_vert
,
56 GnmStyleRow
*sr
, GnmStyleRow
*next_sr
,
57 int start_col
, int end_col
,
58 gpointer mem
, gboolean hide_grid
);
59 GnmHLink
*sheet_style_region_contains_link (Sheet
const *sheet
, GnmRange
const *r
);
60 void sheet_style_foreach (Sheet
const *sheet
,
63 void sheet_style_range_foreach (Sheet
const *sheet
, GnmRange
const *r
,
67 GnmStyle
**sheet_style_most_common (Sheet
const *sheet
, gboolean is_col
);
69 void sheet_style_init (Sheet
*sheet
);
70 void sheet_style_resize (Sheet
*sheet
, int cols
, int rows
);
71 void sheet_style_shutdown (Sheet
*sheet
);
73 void sheet_style_set_auto_pattern_color (Sheet
*sheet
,
74 GnmColor
*grid_color
);
75 GnmColor
*sheet_style_get_auto_pattern_color (Sheet
const *sheet
);
76 void sheet_style_update_grid_color (Sheet
const *sheet
);
78 GnmStyle
const *style_list_get_style (GnmStyleList
const *l
, int col
, int row
);
79 void style_list_free (GnmStyleList
*l
);
80 GnmStyleList
*sheet_style_get_range (Sheet
const *sheet
, GnmRange
const *r
);
82 typedef gboolean (*sheet_style_set_list_cb_t
) (GnmRange
*range
,
85 GnmSpanCalcFlags
sheet_style_set_list (Sheet
*sheet
,
86 GnmCellPos
const *corner
,
87 GnmStyleList
const *l
,
88 sheet_style_set_list_cb_t range_modify
,
91 GnmStyleList
*sheet_style_collect_conditions (Sheet
const *sheet
,
93 GnmStyleList
*sheet_style_collect_hlinks (Sheet
const *sheet
,
95 GnmStyleList
*sheet_style_collect_validations (Sheet
const *sheet
,
98 GType
gnm_style_region_get_type (void); /* boxed type */
99 GnmStyleRegion
*gnm_style_region_new (GnmRange
const *range
, GnmStyle
*style
);
100 void gnm_style_region_free (GnmStyleRegion
*sr
);
103 /* For internal use only */
104 void sheet_style_unlink (Sheet
*sheet
, GnmStyle
*st
);
106 void sheet_style_optimize (Sheet
*sheet
);
108 void sheet_style_clear_style_dependents (Sheet
*sheet
, GnmRange
const *r
);
112 #endif /* _GNM_SHEET_STYLE_H_ */