Move plugin init code
[gnumeric.git] / src / go-data-cache.h
blobfb8a24d381b480e027a0042a5b1a51cfe152a600
1 /*
2 * go-data-cache.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
21 #ifndef GO_DATA_CACHE_H
22 #define GO_DATA_CACHE_H
24 #include <goffice-data.h> /* remove after move to goffice */
25 #include <goffice/goffice.h>
26 #include <go-val.h>
27 #include <glib-object.h>
29 G_BEGIN_DECLS
30 #ifndef GOFFICE_NAMESPACE_DISABLE
32 #define GO_DATA_CACHE_TYPE (go_data_cache_get_type ())
33 #define GO_DATA_CACHE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GO_DATA_CACHE_TYPE, GODataCache))
34 #define IS_GO_DATA_CACHE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GO_DATA_CACHE_TYPE))
36 GType go_data_cache_get_type (void);
38 GODataCacheSource *go_data_cache_get_source (GODataCache const *dc);
39 void go_data_cache_set_source (GODataCache *dc,
40 GODataCacheSource *src);
41 void go_data_cache_add_field (GODataCache *dc,
42 GODataCacheField *field);
43 void go_data_cache_import_start (GODataCache *dc, unsigned int expected_records);
44 void go_data_cache_import_done (GODataCache *dc, unsigned int actual_records);
45 void go_data_cache_set_index (GODataCache *dc,
46 int field, unsigned int record_num, unsigned int idx);
47 void go_data_cache_set_val (GODataCache *dc,
48 int field, unsigned int record_num, GOVal *v);
49 int go_data_cache_get_index (GODataCache const *dc,
50 GODataCacheField const *field, unsigned int record_num);
52 /* Data Access */
53 unsigned int go_data_cache_num_items (GODataCache const *dc);
54 unsigned int go_data_cache_num_fields (GODataCache const *dc);
55 GODataCacheField *go_data_cache_get_field (GODataCache const *dc, int i);
57 /* Actions */
58 void go_data_cache_permute (GODataCache const *dc,
59 GArray const *field_order,
60 GArray *permutation);
62 /* debug util */
63 void go_data_cache_dump (GODataCache *dc,
64 GArray const *field_order,
65 GArray const *permutation);
66 void go_data_cache_dump_value (GOVal const *v);
68 #endif
69 G_END_DECLS
71 #endif /* GO_DATA_CACHE_H */