2 * Copyright (C) 2007 Holger Hans Peter Freyther
3 * Copyright (C) 2007 Alp Toker <alp@atoker.com>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
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 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public License
16 * along with this library; see the file COPYING.LIB. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
21 #ifndef webkitwebframe_h
22 #define webkitwebframe_h
24 #include <glib-object.h>
27 #include <JavaScriptCore/JSBase.h>
29 #include <webkit/webkitdefines.h>
30 #include <webkit/webkitdomdefines.h>
31 #include <webkit/webkitnetworkrequest.h>
32 #include <webkit/webkitwebdatasource.h>
36 #define WEBKIT_TYPE_WEB_FRAME (webkit_web_frame_get_type())
37 #define WEBKIT_WEB_FRAME(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_TYPE_WEB_FRAME, WebKitWebFrame))
38 #define WEBKIT_WEB_FRAME_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WEBKIT_TYPE_WEB_FRAME, WebKitWebFrameClass))
39 #define WEBKIT_IS_WEB_FRAME(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_TYPE_WEB_FRAME))
40 #define WEBKIT_IS_WEB_FRAME_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WEBKIT_TYPE_WEB_FRAME))
41 #define WEBKIT_WEB_FRAME_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), WEBKIT_TYPE_WEB_FRAME, WebKitWebFrameClass))
43 typedef struct _WebKitWebFramePrivate WebKitWebFramePrivate;
45 struct _WebKitWebFrame {
46 GObject parent_instance;
49 WebKitWebFramePrivate *priv;
52 struct _WebKitWebFrameClass {
53 GObjectClass parent_class;
56 void (*_webkit_reserved1) (void);
57 void (*_webkit_reserved2) (void);
58 void (*_webkit_reserved3) (void);
59 void (*_webkit_reserved4) (void);
60 void (*_webkit_reserved5) (void);
61 void (*_webkit_reserved6) (void);
66 * @WEBKIT_LOAD_PROVISIONAL: No data has been received yet, empty
67 * structures have been allocated to perform the load; the load may
68 * still fail for transport issues such as not being able to resolve a
69 * name, or connect to a port.
70 * @WEBKIT_LOAD_COMMITTED: The first data chunk has arrived, meaning
71 * that the necessary transport requirements are stabilished, and the
72 * load is being performed.
73 * @WEBKIT_LOAD_FIRST_VISUALLY_NON_EMPTY_LAYOUT: The first layout with
74 * actual visible content happened; one or more layouts may have
75 * happened before that caused nothing to be visible on the screen,
76 * because the data available at the time was not significant enough.
77 * @WEBKIT_LOAD_FINISHED: This state means that everything that was
78 * required to display the page has been loaded.
79 * @WEBKIT_LOAD_FAILED: This state means that some error occurred
80 * during the page load that prevented it from being completed. You
81 * can connect to the #WebKitWebView::load-error signal if you want to
82 * know precisely what kind of error occurred.
85 WEBKIT_LOAD_PROVISIONAL,
86 WEBKIT_LOAD_COMMITTED,
88 WEBKIT_LOAD_FIRST_VISUALLY_NON_EMPTY_LAYOUT,
93 webkit_web_frame_get_type (void);
95 #ifndef WEBKIT_DISABLE_DEPRECATED
96 WEBKIT_API WebKitWebFrame *
97 webkit_web_frame_new (WebKitWebView *web_view);
100 WEBKIT_API WebKitWebView *
101 webkit_web_frame_get_web_view (WebKitWebFrame *frame);
103 WEBKIT_API const gchar *
104 webkit_web_frame_get_name (WebKitWebFrame *frame);
106 WEBKIT_API const gchar *
107 webkit_web_frame_get_title (WebKitWebFrame *frame);
109 WEBKIT_API const gchar *
110 webkit_web_frame_get_uri (WebKitWebFrame *frame);
112 WEBKIT_API WebKitWebFrame*
113 webkit_web_frame_get_parent (WebKitWebFrame *frame);
116 webkit_web_frame_load_uri (WebKitWebFrame *frame,
120 webkit_web_frame_load_string (WebKitWebFrame *frame,
121 const gchar *content,
122 const gchar *mime_type,
123 const gchar *encoding,
124 const gchar *base_uri);
127 webkit_web_frame_load_alternate_string (WebKitWebFrame *frame,
128 const gchar *content,
129 const gchar *base_url,
130 const gchar *unreachable_url);
133 webkit_web_frame_load_request (WebKitWebFrame *frame,
134 WebKitNetworkRequest *request);
137 webkit_web_frame_stop_loading (WebKitWebFrame *frame);
140 webkit_web_frame_reload (WebKitWebFrame *frame);
142 WEBKIT_API WebKitWebFrame *
143 webkit_web_frame_find_frame (WebKitWebFrame *frame,
146 WEBKIT_API JSGlobalContextRef
147 webkit_web_frame_get_global_context (WebKitWebFrame *frame);
149 WEBKIT_API GtkPrintOperationResult
150 webkit_web_frame_print_full (WebKitWebFrame *frame,
151 GtkPrintOperation *operation,
152 GtkPrintOperationAction action,
156 webkit_web_frame_print (WebKitWebFrame *frame);
158 WEBKIT_API WebKitLoadStatus
159 webkit_web_frame_get_load_status (WebKitWebFrame *frame);
161 WEBKIT_API GtkPolicyType
162 webkit_web_frame_get_horizontal_scrollbar_policy (WebKitWebFrame *frame);
164 WEBKIT_API GtkPolicyType
165 webkit_web_frame_get_vertical_scrollbar_policy (WebKitWebFrame *frame);
167 WEBKIT_API WebKitWebDataSource *
168 webkit_web_frame_get_data_source (WebKitWebFrame *frame);
170 WEBKIT_API WebKitWebDataSource *
171 webkit_web_frame_get_provisional_data_source (WebKitWebFrame *frame);
173 WEBKIT_API WebKitSecurityOrigin*
174 webkit_web_frame_get_security_origin (WebKitWebFrame *frame);
176 WEBKIT_API WebKitNetworkResponse*
177 webkit_web_frame_get_network_response (WebKitWebFrame *frame);
180 webkit_web_frame_replace_selection (WebKitWebFrame *frame,
183 WEBKIT_API WebKitDOMRange*
184 webkit_web_frame_get_range_for_word_around_caret (WebKitWebFrame *frame);