1 /* GXPSDocument
2  *
3  * Copyright (C) 2010  Carlos Garcia Campos <carlosgc@gnome.org>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18  */
19 
20 #if !defined (__GXPS_H_INSIDE__) && !defined (GXPS_COMPILATION)
21 #error "Only <libgxps/gxps.h> can be included directly."
22 #endif
23 
24 #ifndef __GXPS_DOCUMENT_H__
25 #define __GXPS_DOCUMENT_H__
26 
27 #include <glib-object.h>
28 #include <gio/gio.h>
29 
30 #include <libgxps/gxps-version.h>
31 
32 #include "gxps-page.h"
33 #include "gxps-document-structure.h"
34 
35 G_BEGIN_DECLS
36 
37 #define GXPS_TYPE_DOCUMENT           (gxps_document_get_type ())
38 #define GXPS_DOCUMENT(obj)           (G_TYPE_CHECK_INSTANCE_CAST (obj, GXPS_TYPE_DOCUMENT, GXPSDocument))
39 #define GXPS_DOCUMENT_CLASS(cls)     (G_TYPE_CHECK_CLASS_CAST (cls, GXPS_TYPE_DOCUMENT, GXPSDocumentClass))
40 #define GXPS_IS_DOCUMENT(obj)        (G_TYPE_CHECK_INSTANCE_TYPE (obj, GXPS_TYPE_DOCUMENT))
41 #define GXPS_IS_DOCUMENT_CLASS(obj)  (G_TYPE_CHECK_CLASS_TYPE (obj, GXPS_TYPE_DOCUMENT))
42 #define GXPS_DOCUMENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GXPS_TYPE_DOCUMENT, GXPSDocumentClass))
43 
44 typedef struct _GXPSDocument        GXPSDocument;
45 typedef struct _GXPSDocumentClass   GXPSDocumentClass;
46 typedef struct _GXPSDocumentPrivate GXPSDocumentPrivate;
47 
48 /**
49  * GXPSDocument:
50  *
51  * The <structname>GXPSDocument</structname> struct contains
52  * only private fields and should not be directly accessed.
53  */
54 struct _GXPSDocument {
55 	GObject parent;
56 
57         /*< private >*/
58 	GXPSDocumentPrivate *priv;
59 };
60 
61 struct _GXPSDocumentClass {
62 	GObjectClass parent_class;
63 };
64 
65 GXPS_AVAILABLE_IN_ALL
66 GType                  gxps_document_get_type            (void) G_GNUC_CONST;
67 
68 GXPS_AVAILABLE_IN_ALL
69 guint                  gxps_document_get_n_pages         (GXPSDocument *doc);
70 GXPS_AVAILABLE_IN_ALL
71 GXPSPage              *gxps_document_get_page            (GXPSDocument *doc,
72 							  guint         n_page,
73 							  GError      **error);
74 GXPS_AVAILABLE_IN_ALL
75 gboolean               gxps_document_get_page_size       (GXPSDocument *doc,
76 							  guint         n_page,
77 							  gdouble      *width,
78 							  gdouble      *height);
79 GXPS_AVAILABLE_IN_ALL
80 gint                   gxps_document_get_page_for_anchor (GXPSDocument *doc,
81 							  const gchar  *anchor);
82 GXPS_AVAILABLE_IN_ALL
83 GXPSDocumentStructure *gxps_document_get_structure       (GXPSDocument *doc);
84 
85 G_END_DECLS
86 
87 #endif /* __GXPS_DOCUMENT_H__ */
88