view: Add a missing cast
[yelp.git] / libyelp / yelp-uri.h
blob7218a8a5ec632f4f4f30e0e67543afca765f8bec
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * Copyright (C) 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, see <http://www.gnu.org/licenses/>.
18 * Author: Shaun McCance <shaunm@gnome.org>
21 #ifndef __YELP_URI_H__
22 #define __YELP_URI_H__
24 #include <glib-object.h>
26 G_BEGIN_DECLS
28 #define YELP_TYPE_URI (yelp_uri_get_type ())
29 #define YELP_URI(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), YELP_TYPE_URI, YelpUri))
30 #define YELP_URI_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), YELP_TYPE_URI, YelpUriClass))
31 #define YELP_IS_URI(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), YELP_TYPE_URI))
32 #define YELP_IS_URI_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), YELP_TYPE_URI))
33 #define YELP_URI_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), YELP_TYPE_URI, YelpUriClass))
35 typedef struct _YelpUri YelpUri;
36 typedef struct _YelpUriClass YelpUriClass;
38 typedef enum {
39 YELP_URI_DOCUMENT_TYPE_UNRESOLVED,
40 YELP_URI_DOCUMENT_TYPE_DOCBOOK,
41 YELP_URI_DOCUMENT_TYPE_MALLARD,
42 YELP_URI_DOCUMENT_TYPE_MAN,
43 YELP_URI_DOCUMENT_TYPE_INFO,
44 YELP_URI_DOCUMENT_TYPE_TEXT,
45 YELP_URI_DOCUMENT_TYPE_HTML,
46 YELP_URI_DOCUMENT_TYPE_XHTML,
47 YELP_URI_DOCUMENT_TYPE_HELP_LIST,
48 YELP_URI_DOCUMENT_TYPE_NOT_FOUND,
49 YELP_URI_DOCUMENT_TYPE_EXTERNAL,
50 YELP_URI_DOCUMENT_TYPE_ERROR
51 } YelpUriDocumentType;
53 struct _YelpUri {
54 GObject parent;
57 struct _YelpUriClass {
58 GObjectClass parent_class;
62 GType yelp_uri_get_type (void);
64 YelpUri * yelp_uri_new (const gchar *arg);
65 YelpUri * yelp_uri_new_relative (YelpUri *base,
66 const gchar *arg);
67 YelpUri * yelp_uri_new_search (YelpUri *base,
68 const gchar *text);
70 void yelp_uri_resolve (YelpUri *uri);
71 void yelp_uri_resolve_sync (YelpUri *uri);
73 gboolean yelp_uri_is_resolved (YelpUri *uri);
74 YelpUriDocumentType yelp_uri_get_document_type (YelpUri *uri);
76 /* Both of these functions return a non-null answer, provided that
77 * the uri has been resolved. */
78 gchar * yelp_uri_get_canonical_uri (YelpUri *uri);
79 gchar * yelp_uri_get_document_uri (YelpUri *uri);
81 GFile * yelp_uri_get_file (YelpUri *uri);
83 gchar ** yelp_uri_get_search_path (YelpUri *uri);
84 gchar * yelp_uri_get_page_id (YelpUri *uri);
85 gchar * yelp_uri_get_frag_id (YelpUri *uri);
86 gchar * yelp_uri_get_query (YelpUri *uri,
87 const gchar *key);
89 gchar * yelp_uri_locate_file_uri (YelpUri *uri,
90 const gchar *filename);
92 G_END_DECLS
94 #endif /* __YELP_URI_H__ */