2 * Copyright (C) 2007 Holger Hans Peter Freyther
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * 3. Neither the name of Apple, Inc. ("Apple") nor the names of
14 * its contributors may be used to endorse or promote products derived
15 * from this software without specific prior written permission.
17 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
18 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
21 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 #ifndef WEBKIT_WEB_VIEW_H
30 #define WEBKIT_WEB_VIEW_H
34 #include "webkitdefines.h"
35 #include "webkitsettings.h"
39 #define WEBKIT_TYPE_WEB_VIEW (webkit_web_view_get_type())
40 #define WEBKIT_WEB_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_TYPE_WEB_VIEW, WebKitWebView))
41 #define WEBKIT_WEB_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WEBKIT_TYPE_WEB_VIEW, WebKitWebViewClass))
42 #define WEBKIT_IS_WEB_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_TYPE_WEB_VIEW))
43 #define WEBKIT_IS_WEB_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WEBKIT_TYPE_WEB_VIEW))
44 #define WEBKIT_WEB_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), WEBKIT_TYPE_WEB_VIEW, WebKitWebViewClass))
48 WEBKIT_NAVIGATION_RESPONSE_ACCEPT,
49 WEBKIT_NAVIGATION_RESPONSE_IGNORE,
50 WEBKIT_NAVIGATION_RESPONSE_DOWNLOAD
51 } WebKitNavigationResponse;
55 struct _WebKitWebView {
59 struct _WebKitWebViewClass {
60 GtkContainerClass parent;
63 * default handler/virtual methods
64 * DISCUSS: create_web_view needs a request and should we make this a signal with default handler? this would
65 * require someone doing a g_signal_stop_emission_by_name
66 * WebUIDelegate has nothing for create_frame, WebPolicyDelegate as well...
68 WebKitWebView* (*create_web_view) (WebKitWebView* web_view);
71 * TODO: FIXME: Create something like WebPolicyDecisionListener_Protocol instead
73 WebKitNavigationResponse (*navigation_requested) (WebKitWebView* web_view, WebKitWebFrame* frame, WebKitNetworkRequest* request);
75 void (*window_object_cleared) (WebKitWebView* web_view, WebKitWebFrame* frame, JSGlobalContextRef context, JSObjectRef window_object);
76 gchar* (*choose_file) (WebKitWebView* web_view, WebKitWebFrame* frame, const gchar* old_file);
77 gboolean (*script_alert) (WebKitWebView* web_view, WebKitWebFrame* frame, const gchar* alert_message);
78 gboolean (*script_confirm) (WebKitWebView* web_view, WebKitWebFrame* frame, const gchar* confirm_message, gboolean* did_confirm);
79 gboolean (*script_prompt) (WebKitWebView* web_view, WebKitWebFrame* frame, const gchar* message, const gchar* default_value, gchar** value);
80 gboolean (*console_message) (WebKitWebView* web_view, const gchar* message, unsigned int line_number, const gchar* source_id);
85 void (*set_scroll_adjustments) (WebKitWebView*, GtkAdjustment*, GtkAdjustment*);
89 webkit_web_view_get_type (void);
92 webkit_web_view_new (void);
95 webkit_web_view_can_go_backward (WebKitWebView* web_view);
98 webkit_web_view_can_go_forward (WebKitWebView* web_view);
101 webkit_web_view_go_backward (WebKitWebView* web_view);
104 webkit_web_view_go_forward (WebKitWebView* web_view);
107 webkit_web_view_stop_loading (WebKitWebView* web_view);
110 webkit_web_view_open (WebKitWebView* web_view, const gchar* uri);
113 webkit_web_view_reload (WebKitWebView *web_view);
116 webkit_web_view_load_string (WebKitWebView* web_view, const gchar* content, const gchar* content_mime_type, const gchar* content_encoding, const gchar* base_uri);
119 webkit_web_view_load_html_string (WebKitWebView* web_view, const gchar* content, const gchar* base_uri);
121 WEBKIT_API WebKitWebFrame*
122 webkit_web_view_get_main_frame (WebKitWebView* web_view);
125 webkit_web_view_execute_script (WebKitWebView* web_view, const gchar* script);
128 webkit_web_view_get_editable (WebKitWebView* web_view);
131 webkit_web_view_set_editable (WebKitWebView* web_view, gboolean flag);