Compilation: fix up tools includes.
[gnumeric.git] / src / criteria.h
blobf6492e0bd00fb8b42a9f792e0c2591d0c783208c
1 #ifndef _GNM_CRITERIA_H_
2 #define _GNM_CRITERIA_H_
4 #include <gnumeric.h>
5 #include <position.h>
6 #include <value.h>
7 #include <number-match.h>
8 #include <sheet.h>
9 #include <cell.h>
10 #include <gutils.h>
11 #include <workbook.h>
12 #include <collect.h>
13 #include <goffice/goffice.h>
15 #include <string.h>
17 G_BEGIN_DECLS
19 typedef struct _GnmCriteria GnmCriteria;
21 typedef gboolean (*GnmCriteriaFunc) (GnmValue const *x, GnmCriteria *crit);
22 struct _GnmCriteria {
23 GnmCriteriaFunc fun;
24 GnmValue *x;
25 int column; /* absolute */
26 CellIterFlags iter_flags;
27 GODateConventions const *date_conv;
28 GORegexp rx;
29 gboolean has_rx;
30 unsigned ref_count; /* for boxed type */
32 GType gnm_criteria_get_type (void);
34 typedef struct {
35 int row; /* absolute */
36 GSList *conditions;
37 } GnmDBCriteria;
39 GnmCriteria *parse_criteria (GnmValue const *crit_val,
40 GODateConventions const *date_conv,
41 gboolean anchor_end);
42 void gnm_criteria_unref (GnmCriteria *criteria);
43 void free_criterias (GSList *criterias);
44 GSList *find_rows_that_match (Sheet *sheet, int first_col,
45 int first_row, int last_col, int last_row,
46 GSList *criterias, gboolean unique_only);
47 GSList *parse_database_criteria (GnmEvalPos const *ep,
48 GnmValue const *database, GnmValue const *criteria);
49 int find_column_of_field (GnmEvalPos const *ep,
50 GnmValue const *database, GnmValue const *field);
52 GnmValue *gnm_ifs_func (GPtrArray *data, GPtrArray *crits, GnmValue const *vals,
53 float_range_function_t fun, GnmStdError err,
54 GnmEvalPos const *ep, CollectFlags flags);
57 G_END_DECLS
59 #endif