Update Spanish translation
[gnumeric.git] / src / style-conditions.h
blob7971c58d0cb213a20761dbff38e8ea99164f6333
1 #ifndef _GNM_STYLE_CONDITIONS_H_
2 # define _GNM_STYLE_CONDITIONS_H_
4 #include <gnumeric.h>
5 #include <dependent.h>
7 G_BEGIN_DECLS
9 /* This is persisted directly in .gnumeric files, DO NOT REMOVE OR REORDER */
10 typedef enum {
11 /* Cell Value */
12 GNM_STYLE_COND_BETWEEN,
13 GNM_STYLE_COND_NOT_BETWEEN,
14 GNM_STYLE_COND_EQUAL,
15 GNM_STYLE_COND_NOT_EQUAL,
16 GNM_STYLE_COND_GT,
17 GNM_STYLE_COND_LT,
18 GNM_STYLE_COND_GTE,
19 GNM_STYLE_COND_LTE,
21 /* Arbitrary expr evaluated at EvalPos */
22 GNM_STYLE_COND_CUSTOM,
24 /* New in Gnumeric 1.8 */
25 GNM_STYLE_COND_CONTAINS_STR = 0x10,
26 GNM_STYLE_COND_NOT_CONTAINS_STR,
27 GNM_STYLE_COND_BEGINS_WITH_STR,
28 GNM_STYLE_COND_NOT_BEGINS_WITH_STR,
29 GNM_STYLE_COND_ENDS_WITH_STR,
30 GNM_STYLE_COND_NOT_ENDS_WITH_STR,
32 GNM_STYLE_COND_CONTAINS_ERR,
33 GNM_STYLE_COND_NOT_CONTAINS_ERR,
35 GNM_STYLE_COND_CONTAINS_BLANKS,
36 GNM_STYLE_COND_NOT_CONTAINS_BLANKS
37 } GnmStyleCondOp;
39 typedef struct {
40 GnmStyle *overlay;
41 GnmDependent deps[2];
42 GnmStyleCondOp op;
43 } GnmStyleCond;
45 GType gnm_style_cond_get_type (void);
46 GnmStyleCond *gnm_style_cond_new (GnmStyleCondOp op, Sheet *sheet);
47 void gnm_style_cond_free (GnmStyleCond *cond);
48 GnmStyleCond *gnm_style_cond_dup (GnmStyleCond const *src);
49 gboolean gnm_style_cond_is_valid (GnmStyleCond const *cond);
51 void gnm_style_cond_set_overlay (GnmStyleCond *cond,
52 GnmStyle *overlay);
54 GnmExprTop const *gnm_style_cond_get_expr (GnmStyleCond const *cond,
55 unsigned idx);
56 void gnm_style_cond_set_expr (GnmStyleCond *cond,
57 GnmExprTop const *texpr,
58 unsigned idx);
60 GnmExprTop const *gnm_style_cond_get_alternate_expr (GnmStyleCond const *cond);
61 void gnm_style_cond_canonicalize (GnmStyleCond *cond);
63 Sheet *gnm_style_cond_get_sheet (GnmStyleCond const *cond);
64 void gnm_style_cond_set_sheet (GnmStyleCond *cond, Sheet *sheet);
66 GType gnm_style_conditions_get_type (void);
67 GnmStyleConditions *gnm_style_conditions_new (Sheet *sheet);
68 GnmStyleConditions *gnm_style_conditions_dup (GnmStyleConditions const *sc);
69 GPtrArray const *gnm_style_conditions_details (GnmStyleConditions const *sc);
70 void gnm_style_conditions_insert (GnmStyleConditions *sc,
71 GnmStyleCond const *cond,
72 int pos);
73 void gnm_style_conditions_delete (GnmStyleConditions *sc,
74 guint pos);
75 GPtrArray *gnm_style_conditions_overlay (GnmStyleConditions const *sc,
76 GnmStyle const *base);
77 int gnm_style_conditions_eval (GnmStyleConditions const *sc,
78 GnmEvalPos const *pos);
80 Sheet *gnm_style_conditions_get_sheet (GnmStyleConditions const *sc);
81 void gnm_style_conditions_set_sheet (GnmStyleConditions *sc,
82 Sheet *sheet);
84 guint32 gnm_style_conditions_hash (GnmStyleConditions const *sc);
86 gboolean gnm_style_conditions_equal (GnmStyleConditions const *sca,
87 GnmStyleConditions const *scb,
88 gboolean relax_sheet);
90 G_END_DECLS
92 #endif /* _GNM_STYLE_CONDITIONS_H_ */