Update Spanish translation
[gnumeric.git] / src / go-val.h
blobb6a19f8f882a7311a8c62aba8511fb308599e9a1
1 /*
2 * go-val.h :
4 * Copyright (C) 2008 Jody Goldberg (jody@gnome.org)
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; either version 2 of the
9 * License, or (at your option) version 3.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
19 * USA
22 #ifndef GO_VAL_H
23 #define GO_VAL_H
25 #include <value.h> /* remove after move to goffice */
26 #include <gnm-format.h> /* remove after move to goffice */
28 G_BEGIN_DECLS
29 #ifndef GOFFICE_NAMESPACE_DISABLE
31 typedef GnmValue GOVal;
32 #define GO_VAL_TYPE gnm_value_get_type()
34 #define go_val_free value_release
35 #define go_val_dup value_dup
36 #define go_val_new_empty value_new_empty
37 #define go_val_new_float value_new_float
38 #define go_val_new_bool value_new_bool
39 #define go_val_new_str value_new_string
40 #define go_val_new_str_nocopy value_new_string_nocopy
41 #define go_val_get_fmt(v) VALUE_FMT(v)
43 #define go_val_as_float value_get_as_float
45 #define go_val_cmp value_cmp
47 /*******************************************************/
49 typedef GPtrArray GOValArray;
50 void go_val_array_free (GOValArray *a);
51 GOVal *go_val_array_index_steal (GOValArray *a, int i);
52 #define go_val_array_index g_ptr_array_index
54 /*******************************************************/
56 typedef enum {
57 GO_VAL_BUCKET_NONE,
59 GO_VAL_BUCKET_SECOND,
60 GO_VAL_BUCKET_MINUTE,
61 GO_VAL_BUCKET_HOUR,
62 GO_VAL_BUCKET_DAY_OF_YEAR,
63 GO_VAL_BUCKET_WEEKDAY,
64 GO_VAL_BUCKET_MONTH,
65 GO_VAL_BUCKET_CALENDAR_QUARTER,
66 GO_VAL_BUCKET_YEAR,
68 GO_VAL_BUCKET_SERIES_LINEAR,
69 GO_VAL_BUCKET_SERIES_LOG
70 } GOValBucketType;
72 typedef struct {
73 GOValBucketType type;
74 union {
75 struct {
76 gnm_float minimum;
77 gnm_float maximum;
78 } dates;
79 struct {
80 gnm_float minimum;
81 gnm_float maximum;
82 gnm_float step;
83 } series;
84 } details;
85 } GOValBucketer;
87 void go_val_bucketer_init (GOValBucketer *bucketer);
88 GError *go_val_bucketer_validate (GOValBucketer *bucketer);
89 int go_val_bucketer_apply (GOValBucketer const *bucketer, GOVal const *v);
91 #endif
92 G_END_DECLS
94 #endif /* GO_VAL_H */