GUI: Move .ui files from goffice resources to glib resources
[gnumeric.git] / src / go-val.h
blob5d9779c54bab37959ac50297794ec0076dff093d
1 /* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3 * go-val.h :
5 * Copyright (C) 2008 Jody Goldberg (jody@gnome.org)
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; either version 2 of the
10 * License, or (at your option) version 3.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
20 * USA
23 #ifndef GO_VAL_H
24 #define GO_VAL_H
26 #include "value.h" /* remove after move to goffice */
27 #include "gnm-format.h" /* remove after move to goffice */
29 G_BEGIN_DECLS
30 #ifndef GOFFICE_NAMESPACE_DISABLE
32 typedef GnmValue GOVal;
33 #define GO_VAL_TYPE gnm_value_get_type()
35 #define go_val_free value_release
36 #define go_val_dup value_dup
37 #define go_val_new_empty value_new_empty
38 #define go_val_new_float value_new_float
39 #define go_val_new_bool value_new_bool
40 #define go_val_new_str value_new_string
41 #define go_val_new_str_nocopy value_new_string_nocopy
42 #define go_val_get_fmt(v) VALUE_FMT(v)
44 #define go_val_as_float value_get_as_float
46 #define go_val_cmp value_cmp
48 /*******************************************************/
50 typedef GPtrArray GOValArray;
51 void go_val_array_free (GOValArray *a);
52 GOVal *go_val_array_index_steal (GOValArray *a, int i);
53 #define go_val_array_index g_ptr_array_index
55 /*******************************************************/
57 typedef enum {
58 GO_VAL_BUCKET_NONE,
60 GO_VAL_BUCKET_SECOND,
61 GO_VAL_BUCKET_MINUTE,
62 GO_VAL_BUCKET_HOUR,
63 GO_VAL_BUCKET_DAY_OF_YEAR,
64 GO_VAL_BUCKET_WEEKDAY,
65 GO_VAL_BUCKET_MONTH,
66 GO_VAL_BUCKET_CALENDAR_QUARTER,
67 GO_VAL_BUCKET_YEAR,
69 GO_VAL_BUCKET_SERIES_LINEAR,
70 GO_VAL_BUCKET_SERIES_LOG
71 } GOValBucketType;
73 typedef struct {
74 GOValBucketType type;
75 union {
76 struct {
77 gnm_float minimum;
78 gnm_float maximum;
79 } dates;
80 struct {
81 gnm_float minimum;
82 gnm_float maximum;
83 gnm_float step;
84 } series;
85 } details;
86 } GOValBucketer;
88 void go_val_bucketer_init (GOValBucketer *bucketer);
89 GError *go_val_bucketer_validate (GOValBucketer *bucketer);
90 int go_val_bucketer_apply (GOValBucketer const *bucketer, GOVal const *v);
92 #endif
93 G_END_DECLS
95 #endif /* GO_VAL_H */