1 /* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 #ifndef _GNM_SHEET_FILTER_H_
3 # define _GNM_SHEET_FILTER_H_
6 #include <goffice/goffice.h>
11 GNM_FILTER_UNUSED
= -1,
13 GNM_FILTER_OP_EQUAL
= 0, /* exact match, no regecxp */
18 GNM_FILTER_OP_NOT_EQUAL
, /* exact match, no regecxp */
20 GNM_FILTER_OP_BLANKS
= 0x20,
21 GNM_FILTER_OP_NON_BLANKS
= 0x21,
23 GNM_FILTER_OP_TOP_N
= 0x30,
24 GNM_FILTER_OP_BOTTOM_N
= 0x31,
25 GNM_FILTER_OP_TOP_N_PERCENT
= 0x32,
26 GNM_FILTER_OP_BOTTOM_N_PERCENT
= 0x33,
27 /* Next two added in 1.11.6 */
28 GNM_FILTER_OP_TOP_N_PERCENT_N
= 0x34,
29 GNM_FILTER_OP_BOTTOM_N_PERCENT_N
= 0x35,
30 GNM_FILTER_OP_BOTTOM_MASK
= 0x01,
31 GNM_FILTER_OP_REL_N_MASK
= 0x04,
32 GNM_FILTER_OP_PERCENT_MASK
= 0x06,
35 GNM_FILTER_OP_GT_AVERAGE
= 0x40,
36 GNM_FILTER_OP_LT_AVERAGE
= 0x41,
37 GNM_FILTER_OP_WITHIN_STDDEV
= 0x50,
38 GNM_FILTER_OP_OUTSIDE_STDDEV
= 0x51,
40 GNM_FILTER_OP_MATCH
= 0x60, /* regexp */
41 GNM_FILTER_OP_NO_MATCH
= 0x61, /* regexp */
43 GNM_FILTER_OP_TYPE_OP
= 0x00,
44 GNM_FILTER_OP_TYPE_BLANKS
= 0x20,
45 GNM_FILTER_OP_TYPE_BUCKETS
= 0x30,
46 GNM_FILTER_OP_TYPE_AVERAGE
= 0x40,
47 GNM_FILTER_OP_TYPE_STDDEV
= 0x50,
48 GNM_FILTER_OP_TYPE_MATCH
= 0x60,
49 GNM_FILTER_OP_TYPE_MASK
= 0x70
52 struct _GnmFilterCondition
{
68 GType
gnm_filter_condition_get_type (void);
69 GnmFilterCondition
*gnm_filter_condition_dup (GnmFilterCondition
const *src
);
70 void gnm_filter_condition_free (GnmFilterCondition
*cond
);
71 GnmFilterCondition
*gnm_filter_condition_new_single (GnmFilterOp op
, GnmValue
*v
);
72 GnmFilterCondition
*gnm_filter_condition_new_double (GnmFilterOp op0
, GnmValue
*v0
,
73 gboolean join_with_and
,
74 GnmFilterOp op1
, GnmValue
*v1
);
75 GnmFilterCondition
*gnm_filter_condition_new_bucket (gboolean top
,
80 GType
gnm_filter_get_type (void);
81 GnmFilter
*gnm_filter_new (Sheet
*sheet
, GnmRange
const *r
);
82 GnmFilter
*gnm_filter_dup (GnmFilter
const *src
,
84 GnmFilter
* gnm_filter_ref (GnmFilter
*filter
);
85 void gnm_filter_unref (GnmFilter
*filter
);
86 void gnm_filter_remove (GnmFilter
*filter
);
87 void gnm_filter_attach (GnmFilter
*filter
, Sheet
*sheet
);
88 GnmFilterCondition
const *gnm_filter_get_condition (GnmFilter
const *filter
, unsigned i
);
89 void gnm_filter_set_condition (GnmFilter
*filter
, unsigned i
,
90 GnmFilterCondition
*cond
,
92 void gnm_filter_reapply (GnmFilter
*filter
);
94 GnmFilter
*gnm_sheet_filter_at_pos (Sheet
const *sheet
, GnmCellPos
const *pos
);
95 GnmFilter
*gnm_sheet_filter_intersect_rows (Sheet
const *sheet
,
97 GnmRange
*gnm_sheet_filter_can_be_extended (Sheet
const *sheet
,
100 void gnm_sheet_filter_insdel_colrow (Sheet
*sheet
,
101 gboolean is_cols
, gboolean is_insert
,
102 int start
, int count
,
107 #endif /* _GNM_SHEET_FILTER_H_ */