1 /*
2  * gog-series.h :
3  *
4  * Copyright (C) 2003-2004 Jody Goldberg (jody@gnome.org)
5  *
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.
10  *
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.
15  *
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
20  */
21 #ifndef GOG_SERIES_H
22 #define GOG_SERIES_H
23 
24 #include <goffice/goffice.h>
25 
26 G_BEGIN_DECLS
27 
28 typedef enum {
29 	GOG_SERIES_FILL_TYPE_Y_ORIGIN,
30 	GOG_SERIES_FILL_TYPE_X_ORIGIN,
31 	GOG_SERIES_FILL_TYPE_BOTTOM,
32 	GOG_SERIES_FILL_TYPE_LEFT,
33 	GOG_SERIES_FILL_TYPE_TOP,
34 	GOG_SERIES_FILL_TYPE_RIGHT,
35 	GOG_SERIES_FILL_TYPE_ORIGIN,
36 	GOG_SERIES_FILL_TYPE_CENTER,
37 	GOG_SERIES_FILL_TYPE_EDGE,
38 	GOG_SERIES_FILL_TYPE_SELF,
39 	GOG_SERIES_FILL_TYPE_NEXT,
40 	GOG_SERIES_FILL_TYPE_X_AXIS_MIN,
41 	GOG_SERIES_FILL_TYPE_X_AXIS_MAX,
42 	GOG_SERIES_FILL_TYPE_Y_AXIS_MIN,
43 	GOG_SERIES_FILL_TYPE_Y_AXIS_MAX,
44 	GOG_SERIES_FILL_TYPE_INVALID
45 } GogSeriesFillType;
46 
47 #define GOG_TYPE_SERIES_ELEMENT	(gog_series_element_get_type ())
48 #define GOG_SERIES_ELEMENT(o)	(G_TYPE_CHECK_INSTANCE_CAST ((o), GOG_TYPE_SERIES_ELEMENT, GogSeriesElement))
49 #define GOG_IS_SERIES_ELEMENT(o)	(G_TYPE_CHECK_INSTANCE_TYPE ((o), GOG_TYPE_SERIES_ELEMENT))
50 GType gog_series_element_get_type (void);
51 
52 #define GOG_TYPE_SERIES		(gog_series_get_type ())
53 #define GOG_SERIES(o)		(G_TYPE_CHECK_INSTANCE_CAST ((o), GOG_TYPE_SERIES, GogSeries))
54 #define GOG_IS_SERIES(o)	(G_TYPE_CHECK_INSTANCE_TYPE ((o), GOG_TYPE_SERIES))
55 
56 GType gog_series_get_type (void);
57 gboolean      gog_series_is_valid   (GogSeries const *series);
58 gboolean      gog_series_has_legend (GogSeries const *series);
59 GOData       *gog_series_get_name   (GogSeries const *series);
60 GogPlot	     *gog_series_get_plot   (GogSeries const *series);
61 void	      gog_series_set_name   (GogSeries *series,
62 				     GODataScalar *name_src, GError **err);
63 void	      gog_series_set_dim    (GogSeries *series, int dim_i,
64 				     GOData *val, GError **err);
65 void          gog_series_set_XL_dim (GogSeries *series, GogMSDimType ms_type,
66                                      GOData *val, GError **err);
67 int           gog_series_map_XL_dim (GogSeries const *series, GogMSDimType ms_type);
68 void	      gog_series_set_index  (GogSeries *series,
69 				     int ind, gboolean is_manual);
70 
71 unsigned      	  gog_series_num_elements  	(GogSeries const *series);
72 GList const  	 *gog_series_get_overrides 	(GogSeries const *series);
73 
74 unsigned	  gog_series_get_xy_data   	(GogSeries const *series,
75 						 double const **x,
76 						 double const **y);
77 unsigned	  gog_series_get_xyz_data  	(GogSeries const *series,
78 						 double const **x,
79 						 double const **y,
80 						 double const **z);
81 
82 GogSeriesFillType gog_series_get_fill_type 	(GogSeries const *series);
83 void 		  gog_series_set_fill_type 	(GogSeries *series, GogSeriesFillType fill_type);
84 
85 GogDataset   *gog_series_get_interpolation_params (GogSeries const *series);
86 
87 #ifdef GOFFICE_WITH_GTK
88 void 		  gog_series_populate_fill_type_combo 	(GogSeries const *series, GtkComboBox *combo);
89 GogSeriesFillType gog_series_get_fill_type_from_combo 	(GogSeries const *series, GtkComboBox *combo);
90 #endif
91 
92 G_END_DECLS
93 #endif /* GOG_SERIES_H */
94