Introspection non-fixes.
[gnumeric.git] / src / style-conditions.h
blob29d64917c81e2dda71014a7ede6fea2b11dabecd
1 /* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 #ifndef _GNM_STYLE_CONDITIONS_H_
3 # define _GNM_STYLE_CONDITIONS_H_
5 #include "gnumeric.h"
6 #include <dependent.h>
8 G_BEGIN_DECLS
10 /* This is persisted directly in .gnumeric files, DO NOT REMOVE OR REORDER */
11 typedef enum {
12 /* Cell Value */
13 GNM_STYLE_COND_BETWEEN,
14 GNM_STYLE_COND_NOT_BETWEEN,
15 GNM_STYLE_COND_EQUAL,
16 GNM_STYLE_COND_NOT_EQUAL,
17 GNM_STYLE_COND_GT,
18 GNM_STYLE_COND_LT,
19 GNM_STYLE_COND_GTE,
20 GNM_STYLE_COND_LTE,
22 /* Arbitrary expr evaluated at EvalPos */
23 GNM_STYLE_COND_CUSTOM,
25 /* New in Gnumeric 1.8 */
26 GNM_STYLE_COND_CONTAINS_STR = 0x10,
27 GNM_STYLE_COND_NOT_CONTAINS_STR,
28 GNM_STYLE_COND_BEGINS_WITH_STR,
29 GNM_STYLE_COND_NOT_BEGINS_WITH_STR,
30 GNM_STYLE_COND_ENDS_WITH_STR,
31 GNM_STYLE_COND_NOT_ENDS_WITH_STR,
33 GNM_STYLE_COND_CONTAINS_ERR,
34 GNM_STYLE_COND_NOT_CONTAINS_ERR,
36 GNM_STYLE_COND_CONTAINS_BLANKS,
37 GNM_STYLE_COND_NOT_CONTAINS_BLANKS
38 } GnmStyleCondOp;
40 typedef struct {
41 GnmStyle *overlay;
42 GnmDependent deps[2];
43 GnmStyleCondOp op;
44 } GnmStyleCond;
46 GType gnm_style_cond_get_type (void);
47 GnmStyleCond *gnm_style_cond_new (GnmStyleCondOp op, Sheet *sheet);
48 void gnm_style_cond_free (GnmStyleCond *cond);
49 GnmStyleCond *gnm_style_cond_dup (GnmStyleCond const *src);
50 gboolean gnm_style_cond_is_valid (GnmStyleCond const *cond);
52 void gnm_style_cond_set_overlay (GnmStyleCond *cond,
53 GnmStyle *overlay);
55 GnmExprTop const *gnm_style_cond_get_expr (GnmStyleCond const *cond,
56 unsigned idx);
57 void gnm_style_cond_set_expr (GnmStyleCond *cond,
58 GnmExprTop const *texpr,
59 unsigned idx);
61 GnmExprTop const *gnm_style_cond_get_alternate_expr (GnmStyleCond const *cond);
62 void gnm_style_cond_canonicalize (GnmStyleCond *cond);
64 Sheet *gnm_style_cond_get_sheet (GnmStyleCond const *cond);
65 void gnm_style_cond_set_sheet (GnmStyleCond *cond, Sheet *sheet);
67 GType gnm_style_conditions_get_type (void);
68 GnmStyleConditions *gnm_style_conditions_new (Sheet *sheet);
69 GnmStyleConditions *gnm_style_conditions_dup (GnmStyleConditions const *sc);
70 GPtrArray const *gnm_style_conditions_details (GnmStyleConditions const *sc);
71 void gnm_style_conditions_insert (GnmStyleConditions *sc,
72 GnmStyleCond const *cond,
73 int pos);
74 void gnm_style_conditions_delete (GnmStyleConditions *sc,
75 guint pos);
76 GPtrArray *gnm_style_conditions_overlay (GnmStyleConditions const *sc,
77 GnmStyle const *base);
78 int gnm_style_conditions_eval (GnmStyleConditions const *sc,
79 GnmEvalPos const *pos);
81 Sheet *gnm_style_conditions_get_sheet (GnmStyleConditions const *sc);
82 void gnm_style_conditions_set_sheet (GnmStyleConditions *sc,
83 Sheet *sheet);
85 guint32 gnm_style_conditions_hash (GnmStyleConditions const *sc);
87 gboolean gnm_style_conditions_equal (GnmStyleConditions const *sca,
88 GnmStyleConditions const *scb,
89 gboolean relax_sheet);
91 G_END_DECLS
93 #endif /* _GNM_STYLE_CONDITIONS_H_ */