1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * Copyright (C) 2003-2009 Shaun McCance <shaunm@gnome.org>
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation; either version 2 of the
8 * License, or (at your option) any later version.
10 * This program 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 * General Public License for more details.
15 * You should have received a copy of the GNU General Public
16 * License along with this program; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 * Boston, MA 02111-1307, USA.
20 * Author: Shaun McCance <shaunm@gnome.org>
23 #ifndef __YELP_DOCUMENT_H__
24 #define __YELP_DOCUMENT_H__
26 #include <glib-object.h>
33 #define YELP_TYPE_DOCUMENT (yelp_document_get_type ())
34 #define YELP_DOCUMENT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), YELP_TYPE_DOCUMENT, YelpDocument))
35 #define YELP_DOCUMENT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), YELP_TYPE_DOCUMENT, YelpDocumentClass))
36 #define YELP_IS_DOCUMENT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), YELP_TYPE_DOCUMENT))
37 #define YELP_IS_DOCUMENT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), YELP_TYPE_DOCUMENT))
38 #define YELP_DOCUMENT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), YELP_TYPE_DOCUMENT, YelpDocumentClass))
40 typedef struct _YelpDocument YelpDocument
;
41 typedef struct _YelpDocumentClass YelpDocumentClass
;
42 typedef struct _YelpDocumentPriv YelpDocumentPriv
;
45 YELP_DOCUMENT_SIGNAL_CONTENTS
,
46 YELP_DOCUMENT_SIGNAL_INFO
,
47 YELP_DOCUMENT_SIGNAL_ERROR
50 typedef void (*YelpDocumentCallback
) (YelpDocument
*document
,
51 YelpDocumentSignal signal
,
55 struct _YelpDocument
{
57 YelpDocumentPriv
*priv
;
60 struct _YelpDocumentClass
{
61 GObjectClass parent_class
;
63 /* Virtual Functions */
64 gboolean (*request_page
) (YelpDocument
*document
,
66 GCancellable
*cancellable
,
67 YelpDocumentCallback callback
,
69 const gchar
* (*read_contents
) (YelpDocument
*document
,
70 const gchar
*page_id
);
71 void (*finish_read
) (YelpDocument
*document
,
72 const gchar
*contents
);
73 gchar
* (*get_mime_type
) (YelpDocument
*document
,
74 const gchar
*page_id
);
75 void (*index
) (YelpDocument
*document
);
79 GType
yelp_document_get_type (void);
81 YelpDocument
* yelp_document_get_for_uri (YelpUri
*uri
);
83 gboolean
yelp_document_request_page (YelpDocument
*document
,
85 GCancellable
*cancellable
,
86 YelpDocumentCallback callback
,
89 void yelp_document_give_contents (YelpDocument
*document
,
93 gchar
* yelp_document_get_mime_type (YelpDocument
*document
,
94 const gchar
*page_id
);
95 const gchar
* yelp_document_read_contents (YelpDocument
*document
,
96 const gchar
*page_id
);
97 void yelp_document_finish_read (YelpDocument
*document
,
98 const gchar
*contents
);
100 void yelp_document_index (YelpDocument
*document
);
102 gchar
** yelp_document_list_page_ids (YelpDocument
*document
);
104 gchar
* yelp_document_get_page_id (YelpDocument
*document
,
106 void yelp_document_set_page_id (YelpDocument
*document
,
108 const gchar
*page_id
);
110 gchar
* yelp_document_get_root_id (YelpDocument
*document
,
111 const gchar
*page_id
);
112 void yelp_document_set_root_id (YelpDocument
*document
,
113 const gchar
*page_id
,
114 const gchar
*root_id
);
116 gchar
* yelp_document_get_prev_id (YelpDocument
*document
,
117 const gchar
*page_id
);
118 void yelp_document_set_prev_id (YelpDocument
*document
,
119 const gchar
*page_id
,
120 const gchar
*prev_id
);
122 char * yelp_document_get_next_id (YelpDocument
*document
,
123 const gchar
*page_id
);
124 void yelp_document_set_next_id (YelpDocument
*document
,
125 const gchar
*page_id
,
126 const gchar
*next_id
);
128 gchar
* yelp_document_get_up_id (YelpDocument
*document
,
129 const gchar
*page_id
);
130 void yelp_document_set_up_id (YelpDocument
*document
,
131 const gchar
*page_id
,
134 gchar
* yelp_document_get_root_title (YelpDocument
*document
,
135 const gchar
*page_id
);
137 gchar
* yelp_document_get_page_title (YelpDocument
*document
,
138 const gchar
*page_id
);
139 void yelp_document_set_page_title (YelpDocument
*document
,
140 const gchar
*page_id
,
143 gchar
* yelp_document_get_page_desc (YelpDocument
*document
,
144 const gchar
*page_id
);
145 void yelp_document_set_page_desc (YelpDocument
*document
,
146 const gchar
*page_id
,
149 gchar
* yelp_document_get_page_icon (YelpDocument
*document
,
150 const gchar
*page_id
);
151 void yelp_document_set_page_icon (YelpDocument
*document
,
152 const gchar
*page_id
,
155 gboolean
yelp_document_has_page (YelpDocument
*document
,
156 const gchar
*page_id
);
158 void yelp_document_signal (YelpDocument
*document
,
159 const gchar
*page_id
,
160 YelpDocumentSignal signal
,
161 const GError
*error
);
162 void yelp_document_error_pending (YelpDocument
*document
,
163 const GError
*error
);
167 #endif /* __YELP_DOCUMENT_H__ */