1 /*
2  * go-persist.h :
3  *
4  * Copyright (C) 2003-2008 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 GO_PERSIST_H
22 #define GO_PERSIST_H
23 
24 #include <goffice/goffice.h>
25 #include <libxml/tree.h>
26 #include <gsf/gsf-libxml.h>
27 
28 G_BEGIN_DECLS
29 
30 typedef struct _GOPersist GOPersist;
31 
32 typedef struct {
33 	GTypeInterface base;
34 
35 	void	 (*prep_sax) (GOPersist *gp, GsfXMLIn *xin, xmlChar const **attrs);
36 	void     (*sax_save) (GOPersist const *gp, GsfXMLOut *output);
37 } GOPersistClass;
38 
39 #define GO_TYPE_PERSIST		 (go_persist_get_type ())
40 #define GO_PERSIST(o)		 (G_TYPE_CHECK_INSTANCE_CAST ((o), GO_TYPE_PERSIST, GOPersist))
41 #define GO_IS_PERSIST(o)	 (G_TYPE_CHECK_INSTANCE_TYPE ((o), GO_TYPE_PERSIST))
42 #define GO_PERSIST_CLASS(k)	 (G_TYPE_CHECK_CLASS_CAST ((k), GO_TYPE_PERSIST, GOPersistClass))
43 #define GO_IS_PERSIST_CLASS(k)	 (G_TYPE_CHECK_CLASS_TYPE ((k), GO_TYPE_PERSIST))
44 #define GO_PERSIST_GET_CLASS(o)	 (G_TYPE_INSTANCE_GET_INTERFACE ((o), GO_TYPE_PERSIST, GOPersistClass))
45 
46 GType go_persist_get_type (void);
47 
48 void     go_persist_sax_save (GOPersist const *gp, GsfXMLOut *output);
49 void	 go_persist_prep_sax (GOPersist *gp,
50 			       GsfXMLIn *xin, xmlChar const **attrs);
51 
52 #define GO_PARAM_PERSISTENT	(1 << (G_PARAM_USER_SHIFT+0))
53 
54 G_END_DECLS
55 
56 #endif /* GO_PERSIST_H */
57