1 #ifndef _GNM_SHEET_FILTER_H_
2 # define _GNM_SHEET_FILTER_H_
5 #include <goffice/goffice.h>
10 GNM_FILTER_UNUSED
= -1,
12 GNM_FILTER_OP_EQUAL
= 0, /* exact match, no regecxp */
17 GNM_FILTER_OP_NOT_EQUAL
, /* exact match, no regecxp */
19 GNM_FILTER_OP_BLANKS
= 0x20,
20 GNM_FILTER_OP_NON_BLANKS
= 0x21,
22 GNM_FILTER_OP_TOP_N
= 0x30,
23 GNM_FILTER_OP_BOTTOM_N
= 0x31,
24 GNM_FILTER_OP_TOP_N_PERCENT
= 0x32,
25 GNM_FILTER_OP_BOTTOM_N_PERCENT
= 0x33,
26 /* Next two added in 1.11.6 */
27 GNM_FILTER_OP_TOP_N_PERCENT_N
= 0x34,
28 GNM_FILTER_OP_BOTTOM_N_PERCENT_N
= 0x35,
29 GNM_FILTER_OP_BOTTOM_MASK
= 0x01,
30 GNM_FILTER_OP_REL_N_MASK
= 0x04,
31 GNM_FILTER_OP_PERCENT_MASK
= 0x06,
34 GNM_FILTER_OP_GT_AVERAGE
= 0x40,
35 GNM_FILTER_OP_LT_AVERAGE
= 0x41,
36 GNM_FILTER_OP_WITHIN_STDDEV
= 0x50,
37 GNM_FILTER_OP_OUTSIDE_STDDEV
= 0x51,
39 GNM_FILTER_OP_MATCH
= 0x60, /* regexp */
40 GNM_FILTER_OP_NO_MATCH
= 0x61, /* regexp */
42 GNM_FILTER_OP_TYPE_OP
= 0x00,
43 GNM_FILTER_OP_TYPE_BLANKS
= 0x20,
44 GNM_FILTER_OP_TYPE_BUCKETS
= 0x30,
45 GNM_FILTER_OP_TYPE_AVERAGE
= 0x40,
46 GNM_FILTER_OP_TYPE_STDDEV
= 0x50,
47 GNM_FILTER_OP_TYPE_MATCH
= 0x60,
48 GNM_FILTER_OP_TYPE_MASK
= 0x70
51 struct _GnmFilterCondition
{
67 GType
gnm_filter_condition_get_type (void);
68 GnmFilterCondition
*gnm_filter_condition_dup (GnmFilterCondition
const *src
);
69 void gnm_filter_condition_free (GnmFilterCondition
*cond
);
70 GnmFilterCondition
*gnm_filter_condition_new_single (GnmFilterOp op
, GnmValue
*v
);
71 GnmFilterCondition
*gnm_filter_condition_new_double (GnmFilterOp op0
, GnmValue
*v0
,
72 gboolean join_with_and
,
73 GnmFilterOp op1
, GnmValue
*v1
);
74 GnmFilterCondition
*gnm_filter_condition_new_bucket (gboolean top
,
79 GType
gnm_filter_get_type (void);
80 GnmFilter
*gnm_filter_new (Sheet
*sheet
, GnmRange
const *r
);
81 GnmFilter
*gnm_filter_dup (GnmFilter
const *src
,
83 GnmFilter
* gnm_filter_ref (GnmFilter
*filter
);
84 void gnm_filter_unref (GnmFilter
*filter
);
85 void gnm_filter_remove (GnmFilter
*filter
);
86 void gnm_filter_attach (GnmFilter
*filter
, Sheet
*sheet
);
87 GnmFilterCondition
const *gnm_filter_get_condition (GnmFilter
const *filter
, unsigned i
);
88 void gnm_filter_set_condition (GnmFilter
*filter
, unsigned i
,
89 GnmFilterCondition
*cond
,
91 void gnm_filter_reapply (GnmFilter
*filter
);
93 GnmFilter
*gnm_sheet_filter_at_pos (Sheet
const *sheet
, GnmCellPos
const *pos
);
94 GnmFilter
*gnm_sheet_filter_intersect_rows (Sheet
const *sheet
,
96 GnmRange
*gnm_sheet_filter_can_be_extended (Sheet
const *sheet
,
99 void gnm_sheet_filter_insdel_colrow (Sheet
*sheet
,
100 gboolean is_cols
, gboolean is_insert
,
101 int start
, int count
,
106 #endif /* _GNM_SHEET_FILTER_H_ */