1 /*
2  * go-doc.h :  A GOffice document
3  *
4  * Copyright (C) 2004-2006 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_DOC_H
22 #define GO_DOC_H
23 
24 #include <goffice/goffice.h>
25 
26 G_BEGIN_DECLS
27 
28 #define GO_TYPE_DOC	    (go_doc_get_type ())
29 #define GO_DOC(o)	    (G_TYPE_CHECK_INSTANCE_CAST ((o), GO_TYPE_DOC, GODoc))
30 #define GO_IS_DOC(o)	    (G_TYPE_CHECK_INSTANCE_TYPE ((o), GO_TYPE_DOC))
31 
32 GType go_doc_get_type (void);
33 
34 void     go_doc_set_pristine             (GODoc *doc, gboolean pristine);
35 gboolean go_doc_is_pristine		 (GODoc const *doc);
36 
37 void	 go_doc_set_dirty		 (GODoc *doc, gboolean is_dirty);
38 gboolean go_doc_is_dirty		 (GODoc const *doc);
39 
40 void     go_doc_set_dirty_time           (GODoc *doc, gint64 t);
41 gint64   go_doc_get_dirty_time           (GODoc const *doc);
42 
43 void     go_doc_set_modtime              (GODoc *doc, GDateTime *modtime);
44 GDateTime *go_doc_get_modtime            (GODoc const *doc);
45 
46 void     go_doc_set_state                (GODoc *doc, guint64 state);
47 void     go_doc_bump_state               (GODoc *doc);
48 guint64  go_doc_get_state                (GODoc *doc);
49 
50 void     go_doc_set_saved_state          (GODoc *doc, guint64 state);
51 guint64  go_doc_get_saved_state          (GODoc *doc);
52 
53 gboolean	 go_doc_set_uri		 (GODoc *doc, char const *uri);
54 char const	*go_doc_get_uri		 (GODoc const *doc);
55 
56 GsfDocMetaData	*go_doc_get_meta_data	 (GODoc const *doc);
57 void		 go_doc_set_meta_data	 (GODoc *doc, GsfDocMetaData *data);
58 void		 go_doc_update_meta_data (GODoc *doc);
59 
60 /* put into GODoc (as properties) */
61 
62 /* Images related functions */
63 GOImage		*go_doc_get_image	(GODoc *doc, char const *id);
64 GOImage		*go_doc_add_image	(GODoc *doc, char const *id, GOImage *image);
65 GHashTable	*go_doc_get_images	(GODoc *doc);
66 void		 go_doc_init_write	(GODoc *doc, GsfXMLOut *output);
67 void		 go_doc_write		(GODoc *doc, GsfXMLOut *output);
68 void		 go_doc_save_image	(GODoc *doc, char const *id);
69 void		 go_doc_init_read	(GODoc *doc, GsfInput *input);
70 void		 go_doc_read		(GODoc *doc, GsfXMLIn *xin, xmlChar const **attrs);
71 void		 go_doc_end_read	(GODoc *doc);
72 GOImage		*go_doc_image_fetch 	(GODoc *doc, char const *id, GType type);
73 void		 go_doc_save_resource (GODoc *doc, GOPersist const *gp);
74 
75 G_END_DECLS
76 
77 #endif /* GO_DOC_H */
78