[GTK] Fix some simple gtkdoc warnings for WebKit1
[WebKit-https.git] / Source / WebKit / gtk / webkit / webkitwebview.h
1 /*
2  * Copyright (C) 2007 Holger Hans Peter Freyther
3  * Copyright (C) 2007, 2008 Alp Toker <alp@atoker.com>
4  * Copyright (C) 2008 Collabora Ltd.
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library 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  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public License
17  * along with this library; see the file COPYING.LIB.  If not, write to
18  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  * Boston, MA 02110-1301, USA.
20  */
21
22 #ifndef webkitwebview_h
23 #define webkitwebview_h
24
25 #include <gtk/gtk.h>
26 #include <libsoup/soup.h>
27 #include <JavaScriptCore/JSBase.h>
28 #include <webkit/webkitdefines.h>
29 #include <webkit/webkitfilechooserrequest.h>
30 #include <webkit/webkitwebbackforwardlist.h>
31 #include <webkit/webkitwebframe.h>
32 #include <webkit/webkitwebhistoryitem.h>
33 #include <webkit/webkitwebsettings.h>
34 #include <webkitdom/webkitdom.h>
35
36 G_BEGIN_DECLS
37
38 #define WEBKIT_TYPE_WEB_VIEW            (webkit_web_view_get_type())
39 #define WEBKIT_WEB_VIEW(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_TYPE_WEB_VIEW, WebKitWebView))
40 #define WEBKIT_WEB_VIEW_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass),  WEBKIT_TYPE_WEB_VIEW, WebKitWebViewClass))
41 #define WEBKIT_IS_WEB_VIEW(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_TYPE_WEB_VIEW))
42 #define WEBKIT_IS_WEB_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),  WEBKIT_TYPE_WEB_VIEW))
43 #define WEBKIT_WEB_VIEW_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj),  WEBKIT_TYPE_WEB_VIEW, WebKitWebViewClass))
44
45 typedef struct _WebKitWebViewPrivate WebKitWebViewPrivate;
46
47 /**
48  * WebKitNavigationResponse:
49  * @WEBKIT_NAVIGATION_RESPONSE_ACCEPT: Instruct WebKit to allow the navigation.
50  * @WEBKIT_NAVIGATION_RESPONSE_IGNORE: Instruct WebKit to ignore the navigation.
51  * @WEBKIT_NAVIGATION_RESPONSE_DOWNLOAD: Instruct WebKit to start a download of the destination instead.
52  *
53  * Enum values used to denote the various responses to a navigation policy decision.
54  **/
55 typedef enum {
56     WEBKIT_NAVIGATION_RESPONSE_ACCEPT,
57     WEBKIT_NAVIGATION_RESPONSE_IGNORE,
58     WEBKIT_NAVIGATION_RESPONSE_DOWNLOAD
59 } WebKitNavigationResponse;
60
61 /**
62  * WebKitWebViewTargetInfo:
63  * @WEBKIT_WEB_VIEW_TARGET_INFO_HTML: Rich markup data
64  * @WEBKIT_WEB_VIEW_TARGET_INFO_TEXT: Text data
65  * @WEBKIT_WEB_VIEW_TARGET_INFO_IMAGE: Image data
66  * @WEBKIT_WEB_VIEW_TARGET_INFO_URI_LIST: URI list data
67  * @WEBKIT_WEB_VIEW_TARGET_INFO_NETSCAPE_URL: A single URL in the Netscape protocol
68  *
69  * Enum values used to denote the info value of various selection types. These can be used
70  * to interpret the data WebKitGTK+ publishes via GtkClipboard and drag-and-drop.
71  **/
72 typedef enum
73 {
74     WEBKIT_WEB_VIEW_TARGET_INFO_HTML,
75     WEBKIT_WEB_VIEW_TARGET_INFO_TEXT,
76     WEBKIT_WEB_VIEW_TARGET_INFO_IMAGE,
77     WEBKIT_WEB_VIEW_TARGET_INFO_URI_LIST,
78     WEBKIT_WEB_VIEW_TARGET_INFO_NETSCAPE_URL
79 } WebKitWebViewTargetInfo;
80
81 /**
82  * WebKitWebViewViewMode:
83  * @WEBKIT_WEB_VIEW_VIEW_MODE_WINDOWED: Windowed view mode
84  * @WEBKIT_WEB_VIEW_VIEW_MODE_FLOATING: Floating view mode
85  * @WEBKIT_WEB_VIEW_VIEW_MODE_FULLSCREEN: Fullscreen view mode
86  * @WEBKIT_WEB_VIEW_VIEW_MODE_MAXIMIZED: Maximized view mode
87  * @WEBKIT_WEB_VIEW_VIEW_MODE_MINIMIZED: Minimized view mode
88  *
89  * Enum values used to denote the various types of view modes. See the
90  * #WebKitWebView:view-mode property.
91  **/
92 typedef enum
93 {
94     WEBKIT_WEB_VIEW_VIEW_MODE_WINDOWED,
95     WEBKIT_WEB_VIEW_VIEW_MODE_FLOATING,
96     WEBKIT_WEB_VIEW_VIEW_MODE_FULLSCREEN,
97     WEBKIT_WEB_VIEW_VIEW_MODE_MAXIMIZED,
98     WEBKIT_WEB_VIEW_VIEW_MODE_MINIMIZED
99 } WebKitWebViewViewMode;
100
101 /**
102  * WebKitSelectionAffinity:
103  * @WEBKIT_SELECTION_AFFINITY_UPSTREAM: Downstream selection affinity
104  * @WEBKIT_SELECTION_AFFINITY_DOWNSTREAM: Upstream selection affinity
105  *
106  * Enum values used to denote selection affinity.
107  **/
108 typedef enum
109 {
110     WEBKIT_SELECTION_AFFINITY_UPSTREAM,
111     WEBKIT_SELECTION_AFFINITY_DOWNSTREAM,
112 } WebKitSelectionAffinity;
113
114 /**
115  * WebKitInsertAction:
116  * @WEBKIT_INSERT_ACTION_TYPED: The insert action was from typing.
117  * @WEBKIT_INSERT_ACTION_PASTED: The insert action was from pasting.
118  * @WEBKIT_INSERT_ACTION_DROPPED: The insert action was from dragging and dropping.
119  *
120  * Enum values used to denote source of an insert action.
121  **/
122 typedef enum
123 {
124     WEBKIT_INSERT_ACTION_TYPED,
125     WEBKIT_INSERT_ACTION_PASTED,
126     WEBKIT_INSERT_ACTION_DROPPED,
127 } WebKitInsertAction;
128
129 struct _WebKitWebView {
130     GtkContainer parent_instance;
131
132     /*< private >*/
133     WebKitWebViewPrivate *priv;
134 };
135
136 struct _WebKitWebViewClass {
137     GtkContainerClass parent_class;
138
139     /*< public >*/
140     /*
141      * default handler/virtual methods
142      */
143     WebKitWebView            * (* create_web_view)        (WebKitWebView        *web_view,
144                                                            WebKitWebFrame       *web_frame);
145
146     gboolean                   (* web_view_ready)          (WebKitWebView* web_view);
147
148     gboolean                   (* close_web_view)         (WebKitWebView* web_view);
149
150     WebKitNavigationResponse   (* navigation_requested)   (WebKitWebView        *web_view,
151                                                            WebKitWebFrame       *frame,
152                                                            WebKitNetworkRequest *request);
153     void                       (* window_object_cleared)  (WebKitWebView        *web_view,
154                                                            WebKitWebFrame       *frame,
155                                                            JSGlobalContextRef    context,
156                                                            JSObjectRef           window_object);
157     gchar                    * (* choose_file)            (WebKitWebView        *web_view,
158                                                            WebKitWebFrame       *frame,
159                                                            const gchar          *old_file);
160     gboolean                   (* script_alert)           (WebKitWebView        *web_view,
161                                                            WebKitWebFrame       *frame,
162                                                            const gchar          *alert_message);
163     gboolean                   (* script_confirm)         (WebKitWebView        *web_view,
164                                                            WebKitWebFrame       *frame,
165                                                            const gchar          *confirm_message,
166                                                            gboolean             *did_confirm);
167     gboolean                   (* script_prompt)          (WebKitWebView        *web_view,
168                                                            WebKitWebFrame       *frame,
169                                                            const gchar          *message,
170                                                            const gchar          *default_value,
171                                                            gchar*               *value);
172     gboolean                   (* console_message)        (WebKitWebView        *web_view,
173                                                            const gchar          *message,
174                                                            guint                 line_number,
175                                                            const gchar*          source_id);
176     void                       (* select_all)             (WebKitWebView        *web_view);
177     void                       (* cut_clipboard)          (WebKitWebView        *web_view);
178     void                       (* copy_clipboard)         (WebKitWebView        *web_view);
179     void                       (* paste_clipboard)        (WebKitWebView        *web_view);
180     gboolean                   (* move_cursor)            (WebKitWebView        *web_view,
181                                                            GtkMovementStep       step,
182                                                            gint                  count);
183
184     /*
185      * internal
186      */
187     void                       (* set_scroll_adjustments) (WebKitWebView        *web_view,
188                                                            GtkAdjustment        *hadjustment,
189                                                            GtkAdjustment        *vadjustment);
190
191     void                       (* undo)                   (WebKitWebView        *web_view);
192     void                       (* redo)                   (WebKitWebView        *web_view);
193     gboolean                   (* should_allow_editing_action) (WebKitWebView   *web_view);
194     gboolean                   (* entering_fullscreen) (WebKitWebView   *web_view);
195     gboolean                   (* leaving_fullscreen) (WebKitWebView   *web_view);
196     gboolean                   (* run_file_chooser)       (WebKitWebView            *web_view,
197                                                            WebKitFileChooserRequest *request);
198 };
199
200 WEBKIT_API GType
201 webkit_web_view_get_type (void);
202
203 WEBKIT_API GtkWidget *
204 webkit_web_view_new (void);
205
206 WEBKIT_API const gchar *
207 webkit_web_view_get_title                       (WebKitWebView        *web_view);
208
209
210 WEBKIT_API const gchar *
211 webkit_web_view_get_uri                         (WebKitWebView        *web_view);
212
213 WEBKIT_API void
214 webkit_web_view_set_maintains_back_forward_list (WebKitWebView        *web_view,
215                                                  gboolean              flag);
216
217 WEBKIT_API WebKitWebBackForwardList *
218 webkit_web_view_get_back_forward_list           (WebKitWebView        *web_view);
219
220 WEBKIT_API gboolean
221 webkit_web_view_go_to_back_forward_item         (WebKitWebView        *web_view,
222                                                  WebKitWebHistoryItem *item);
223
224 WEBKIT_API gboolean
225 webkit_web_view_can_go_back                     (WebKitWebView        *web_view);
226
227 WEBKIT_API gboolean
228 webkit_web_view_can_go_back_or_forward          (WebKitWebView        *web_view,
229                                                  gint                  steps);
230 WEBKIT_API gboolean
231 webkit_web_view_can_go_forward                  (WebKitWebView        *web_view);
232
233 WEBKIT_API void
234 webkit_web_view_go_back                         (WebKitWebView        *web_view);
235
236 WEBKIT_API void
237 webkit_web_view_go_back_or_forward              (WebKitWebView        *web_view,
238                                                  gint                  steps);
239 WEBKIT_API void
240 webkit_web_view_go_forward                      (WebKitWebView        *web_view);
241
242 WEBKIT_API void
243 webkit_web_view_stop_loading                    (WebKitWebView        *web_view);
244
245 #if !defined(WEBKIT_DISABLE_DEPRECATED)
246 WEBKIT_API void
247 webkit_web_view_open                            (WebKitWebView        *web_view,
248                                                  const gchar          *uri);
249
250 #endif
251
252 WEBKIT_API void
253 webkit_web_view_reload                          (WebKitWebView        *web_view);
254
255 WEBKIT_API void
256 webkit_web_view_reload_bypass_cache             (WebKitWebView        *web_view);
257
258 WEBKIT_API void
259 webkit_web_view_load_uri                        (WebKitWebView        *web_view,
260                                                  const gchar          *uri);
261 WEBKIT_API void
262 webkit_web_view_load_string                     (WebKitWebView        *web_view,
263                                                  const gchar          *content,
264                                                  const gchar          *mime_type,
265                                                  const gchar          *encoding,
266                                                  const gchar          *base_uri);
267
268 #if !defined(WEBKIT_DISABLE_DEPRECATED)
269 WEBKIT_API void
270 webkit_web_view_load_html_string                (WebKitWebView        *web_view,
271                                                  const gchar          *content,
272                                                  const gchar          *base_uri);
273 #endif
274
275 WEBKIT_API void
276 webkit_web_view_load_request                    (WebKitWebView        *web_view,
277                                                  WebKitNetworkRequest *request);
278
279 WEBKIT_API gboolean
280 webkit_web_view_search_text                     (WebKitWebView        *web_view,
281                                                  const gchar          *text,
282                                                  gboolean              case_sensitive,
283                                                  gboolean              forward,
284                                                  gboolean              wrap);
285
286 WEBKIT_API guint
287 webkit_web_view_mark_text_matches               (WebKitWebView        *web_view,
288                                                  const gchar          *string,
289                                                  gboolean              case_sensitive,
290                                                  guint                 limit);
291
292 WEBKIT_API void
293 webkit_web_view_set_highlight_text_matches      (WebKitWebView        *web_view,
294                                                  gboolean              highlight);
295
296 WEBKIT_API void
297 webkit_web_view_unmark_text_matches             (WebKitWebView        *web_view);
298
299 WEBKIT_API WebKitWebFrame *
300 webkit_web_view_get_main_frame                  (WebKitWebView        *web_view);
301
302 WEBKIT_API WebKitWebFrame *
303 webkit_web_view_get_focused_frame               (WebKitWebView        *web_view);
304
305 WEBKIT_API void
306 webkit_web_view_execute_script                  (WebKitWebView        *web_view,
307                                                  const gchar          *script);
308
309 WEBKIT_API gboolean
310 webkit_web_view_can_cut_clipboard               (WebKitWebView        *web_view);
311
312 WEBKIT_API gboolean
313 webkit_web_view_can_copy_clipboard              (WebKitWebView        *web_view);
314
315 WEBKIT_API gboolean
316 webkit_web_view_can_paste_clipboard             (WebKitWebView        *web_view);
317
318 WEBKIT_API void
319 webkit_web_view_cut_clipboard                   (WebKitWebView        *web_view);
320
321 WEBKIT_API void
322 webkit_web_view_copy_clipboard                  (WebKitWebView        *web_view);
323
324 WEBKIT_API void
325 webkit_web_view_paste_clipboard                 (WebKitWebView        *web_view);
326
327 WEBKIT_API void
328 webkit_web_view_delete_selection                (WebKitWebView        *web_view);
329
330 WEBKIT_API gboolean
331 webkit_web_view_has_selection                   (WebKitWebView        *web_view);
332
333 WEBKIT_API void
334 webkit_web_view_select_all                      (WebKitWebView        *web_view);
335
336 WEBKIT_API gboolean
337 webkit_web_view_get_editable                    (WebKitWebView        *web_view);
338
339 WEBKIT_API void
340 webkit_web_view_set_editable                    (WebKitWebView        *web_view,
341                                                  gboolean              flag);
342
343 WEBKIT_API GtkTargetList *
344 webkit_web_view_get_copy_target_list            (WebKitWebView        *web_view);
345
346 WEBKIT_API GtkTargetList *
347 webkit_web_view_get_paste_target_list           (WebKitWebView        *web_view);
348
349 WEBKIT_API void
350 webkit_web_view_set_settings                    (WebKitWebView        *web_view,
351                                                  WebKitWebSettings    *settings);
352
353 WEBKIT_API WebKitWebSettings *
354 webkit_web_view_get_settings                    (WebKitWebView        *web_view);
355
356 WEBKIT_API WebKitWebInspector *
357 webkit_web_view_get_inspector                   (WebKitWebView        *web_view);
358
359 WEBKIT_API WebKitWebWindowFeatures*
360 webkit_web_view_get_window_features             (WebKitWebView        *web_view);
361
362 WEBKIT_API gboolean
363 webkit_web_view_can_show_mime_type              (WebKitWebView        *web_view,
364                                                  const gchar          *mime_type);
365
366 WEBKIT_API gboolean
367 webkit_web_view_get_transparent                 (WebKitWebView        *web_view);
368
369 WEBKIT_API void
370 webkit_web_view_set_transparent                 (WebKitWebView        *web_view,
371                                                  gboolean              flag);
372
373 WEBKIT_API gfloat
374 webkit_web_view_get_zoom_level                  (WebKitWebView        *web_view);
375
376 WEBKIT_API void
377 webkit_web_view_set_zoom_level                  (WebKitWebView        *web_view,
378                                                  gfloat                zoom_level);
379
380 WEBKIT_API void
381 webkit_web_view_zoom_in                         (WebKitWebView        *web_view);
382
383 WEBKIT_API void
384 webkit_web_view_zoom_out                        (WebKitWebView        *web_view);
385
386 WEBKIT_API gboolean
387 webkit_web_view_get_full_content_zoom           (WebKitWebView        *web_view);
388
389 WEBKIT_API void
390 webkit_web_view_set_full_content_zoom           (WebKitWebView        *web_view,
391                                                  gboolean              full_content_zoom);
392
393 WEBKIT_API const gchar*
394 webkit_web_view_get_encoding                    (WebKitWebView        *web_view);
395
396 WEBKIT_API void
397 webkit_web_view_set_custom_encoding             (WebKitWebView        *web_view,
398                                                  const gchar          *encoding);
399
400 WEBKIT_API const char*
401 webkit_web_view_get_custom_encoding             (WebKitWebView        *web_view);
402
403 WEBKIT_API void
404 webkit_web_view_set_view_mode                   (WebKitWebView        *web_view,
405                                                  WebKitWebViewViewMode mode);
406
407 WEBKIT_API WebKitWebViewViewMode
408 webkit_web_view_get_view_mode                   (WebKitWebView        *web_view);
409
410 WEBKIT_API void
411 webkit_web_view_move_cursor                     (WebKitWebView        *web_view,
412                                                  GtkMovementStep        step,
413                                                  gint                   count);
414
415 WEBKIT_API WebKitLoadStatus
416 webkit_web_view_get_load_status                 (WebKitWebView        *web_view);
417
418 WEBKIT_API gdouble
419 webkit_web_view_get_progress                    (WebKitWebView        *web_view);
420
421 WEBKIT_API void
422 webkit_web_view_undo                            (WebKitWebView        *web_view);
423
424 WEBKIT_API gboolean
425 webkit_web_view_can_undo                        (WebKitWebView        *web_view);
426
427 WEBKIT_API void
428 webkit_web_view_redo                            (WebKitWebView        *web_view);
429
430 WEBKIT_API gboolean
431 webkit_web_view_can_redo                        (WebKitWebView        *web_view);
432
433 #if !defined(WEBKIT_DISABLE_DEPRECATED)
434 WEBKIT_API void
435 webkit_web_view_set_view_source_mode            (WebKitWebView        *web_view,
436                                                  gboolean             view_source_mode);
437
438 WEBKIT_API gboolean
439 webkit_web_view_get_view_source_mode            (WebKitWebView        *web_view);
440 #endif
441
442 WEBKIT_API WebKitHitTestResult*
443 webkit_web_view_get_hit_test_result             (WebKitWebView        *web_view,
444                                                  GdkEventButton       *event);
445
446 WEBKIT_API const gchar *
447 webkit_web_view_get_icon_uri                    (WebKitWebView        *web_view);
448
449 #if !defined(WEBKIT_DISABLE_DEPRECATED)
450 WEBKIT_API GdkPixbuf *
451 webkit_web_view_get_icon_pixbuf                 (WebKitWebView        *web_view);
452 #endif
453
454 WEBKIT_API GdkPixbuf *
455 webkit_web_view_try_get_favicon_pixbuf          (WebKitWebView        *web_view,
456                                                  guint                 width,
457                                                  guint                 height);
458
459 WEBKIT_API WebKitDOMDocument *
460 webkit_web_view_get_dom_document                (WebKitWebView        *web_view);
461
462 WEBKIT_API WebKitViewportAttributes*
463 webkit_web_view_get_viewport_attributes         (WebKitWebView        *web_view);
464
465 WEBKIT_API cairo_surface_t*
466 webkit_web_view_get_snapshot                    (WebKitWebView        *web_view);
467
468 G_END_DECLS
469
470 #endif