initial import
[vuplus_webkit] / Source / WebKit / gtk / webkit / webkitwebframe.h
1 /*
2  * Copyright (C) 2007 Holger Hans Peter Freyther
3  * Copyright (C) 2007 Alp Toker <alp@atoker.com>
4  *
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.
9  *
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.
14  *
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.
19  */
20
21 #ifndef webkitwebframe_h
22 #define webkitwebframe_h
23
24 #include <glib-object.h>
25 #include <gtk/gtk.h>
26
27 #include <JavaScriptCore/JSBase.h>
28
29 #include <webkit/webkitdefines.h>
30 #include <webkit/webkitdomdefines.h>
31 #include <webkit/webkitnetworkrequest.h>
32 #include <webkit/webkitwebdatasource.h>
33
34 G_BEGIN_DECLS
35
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))
42
43 typedef struct _WebKitWebFramePrivate WebKitWebFramePrivate;
44
45 struct _WebKitWebFrame {
46     GObject parent_instance;
47
48     /*< private >*/
49     WebKitWebFramePrivate *priv;
50 };
51
52 struct _WebKitWebFrameClass {
53     GObjectClass parent_class;
54
55     /*< public >*/
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);
62 };
63
64 /**
65  * WebKitLoadStatus
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.
83  */
84 typedef enum {
85     WEBKIT_LOAD_PROVISIONAL,
86     WEBKIT_LOAD_COMMITTED,
87     WEBKIT_LOAD_FINISHED,
88     WEBKIT_LOAD_FIRST_VISUALLY_NON_EMPTY_LAYOUT,
89     WEBKIT_LOAD_FAILED
90 } WebKitLoadStatus;
91
92 WEBKIT_API GType
93 webkit_web_frame_get_type           (void);
94
95 #ifndef WEBKIT_DISABLE_DEPRECATED
96 WEBKIT_API WebKitWebFrame *
97 webkit_web_frame_new                (WebKitWebView        *web_view);
98 #endif
99
100 WEBKIT_API WebKitWebView *
101 webkit_web_frame_get_web_view       (WebKitWebFrame       *frame);
102
103 WEBKIT_API const gchar *
104 webkit_web_frame_get_name           (WebKitWebFrame       *frame);
105
106 WEBKIT_API const gchar *
107 webkit_web_frame_get_title          (WebKitWebFrame       *frame);
108
109 WEBKIT_API const gchar *
110 webkit_web_frame_get_uri            (WebKitWebFrame       *frame);
111
112 WEBKIT_API WebKitWebFrame*
113 webkit_web_frame_get_parent         (WebKitWebFrame       *frame);
114
115 WEBKIT_API void
116 webkit_web_frame_load_uri           (WebKitWebFrame       *frame,
117                                      const gchar          *uri);
118
119 WEBKIT_API void
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);
125
126 WEBKIT_API void
127 webkit_web_frame_load_alternate_string (WebKitWebFrame    *frame,
128                                         const gchar       *content,
129                                         const gchar       *base_url,
130                                         const gchar       *unreachable_url);
131
132 WEBKIT_API void
133 webkit_web_frame_load_request       (WebKitWebFrame       *frame,
134                                      WebKitNetworkRequest *request);
135
136 WEBKIT_API void
137 webkit_web_frame_stop_loading       (WebKitWebFrame       *frame);
138
139 WEBKIT_API void
140 webkit_web_frame_reload             (WebKitWebFrame       *frame);
141
142 WEBKIT_API WebKitWebFrame *
143 webkit_web_frame_find_frame         (WebKitWebFrame       *frame,
144                                      const gchar          *name);
145
146 WEBKIT_API JSGlobalContextRef
147 webkit_web_frame_get_global_context (WebKitWebFrame       *frame);
148
149 WEBKIT_API GtkPrintOperationResult
150 webkit_web_frame_print_full         (WebKitWebFrame       *frame,
151                                      GtkPrintOperation    *operation,
152                                      GtkPrintOperationAction action,
153                                      GError              **error);
154
155 WEBKIT_API void
156 webkit_web_frame_print              (WebKitWebFrame       *frame);
157
158 WEBKIT_API WebKitLoadStatus
159 webkit_web_frame_get_load_status    (WebKitWebFrame       *frame);
160
161 WEBKIT_API GtkPolicyType
162 webkit_web_frame_get_horizontal_scrollbar_policy (WebKitWebFrame        *frame);
163
164 WEBKIT_API GtkPolicyType
165 webkit_web_frame_get_vertical_scrollbar_policy   (WebKitWebFrame        *frame);
166
167 WEBKIT_API WebKitWebDataSource *
168 webkit_web_frame_get_data_source             (WebKitWebFrame       *frame);
169
170 WEBKIT_API WebKitWebDataSource *
171 webkit_web_frame_get_provisional_data_source (WebKitWebFrame       *frame);
172
173 WEBKIT_API WebKitSecurityOrigin*
174 webkit_web_frame_get_security_origin         (WebKitWebFrame       *frame);
175
176 WEBKIT_API WebKitNetworkResponse*
177 webkit_web_frame_get_network_response        (WebKitWebFrame       *frame);
178
179 WEBKIT_API void
180 webkit_web_frame_replace_selection           (WebKitWebFrame        *frame,
181                                               const char            *text);
182
183 WEBKIT_API WebKitDOMRange*
184 webkit_web_frame_get_range_for_word_around_caret (WebKitWebFrame    *frame);
185
186 G_END_DECLS
187
188 #endif