1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * Copyright (C) 2009 Shaun McCance <shaunm@gnome.org>
4 * Copyright (C) 2014 Igalia S.L.
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) any later version.
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 GNU
14 * General Public License for more details.
16 * You should have received a copy of the GNU General Public
17 * License along with this program; if not, see <http://www.gnu.org/licenses/>.
19 * Author: Shaun McCance <shaunm@gnome.org>
22 #ifndef __YELP_VIEW_H__
23 #define __YELP_VIEW_H__
26 #include <webkit2/webkit2.h>
28 #include "yelp-document.h"
33 #define YELP_TYPE_VIEW (yelp_view_get_type ())
34 #define YELP_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), YELP_TYPE_VIEW, YelpView))
35 #define YELP_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), YELP_TYPE_VIEW, YelpViewClass))
36 #define YELP_IS_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), YELP_TYPE_VIEW))
37 #define YELP_IS_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), YELP_TYPE_VIEW))
38 #define YELP_VIEW_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), YELP_TYPE_VIEW, YelpViewClass))
40 typedef struct _YelpView YelpView
;
41 typedef struct _YelpViewClass YelpViewClass
;
42 typedef gboolean (* YelpViewActionValidFunc
) (YelpView
*view
, GtkAction
*action
, gchar
*uri
, gpointer data
);
51 WebKitWebViewClass parent_class
;
53 gboolean (* external_uri
) (YelpView
*view
,
58 YELP_VIEW_STATE_BLANK
,
59 YELP_VIEW_STATE_LOADING
,
60 YELP_VIEW_STATE_LOADED
,
64 GType
yelp_view_get_type (void);
66 GtkWidget
* yelp_view_new (void);
67 void yelp_view_load (YelpView
*view
,
69 void yelp_view_load_uri (YelpView
*view
,
71 void yelp_view_load_document (YelpView
*view
,
73 YelpDocument
*document
);
74 YelpDocument
* yelp_view_get_document (YelpView
*view
);
76 void yelp_view_register_actions (YelpView
*view
,
79 void yelp_view_add_link_action (YelpView
*view
,
81 YelpViewActionValidFunc func
,
83 YelpUri
* yelp_view_get_active_link_uri (YelpView
*view
);
84 gchar
* yelp_view_get_active_link_text (YelpView
*view
);
88 #endif /* __YELP_VIEW_H__ */