• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 WEBKIT_WEB_FRAME_H
22 #define WEBKIT_WEB_FRAME_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/webkitnetworkrequest.h>
31 
32 G_BEGIN_DECLS
33 
34 #define WEBKIT_TYPE_WEB_FRAME            (webkit_web_frame_get_type())
35 #define WEBKIT_WEB_FRAME(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_TYPE_WEB_FRAME, WebKitWebFrame))
36 #define WEBKIT_WEB_FRAME_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass),  WEBKIT_TYPE_WEB_FRAME, WebKitWebFrameClass))
37 #define WEBKIT_IS_WEB_FRAME(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_TYPE_WEB_FRAME))
38 #define WEBKIT_IS_WEB_FRAME_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),  WEBKIT_TYPE_WEB_FRAME))
39 #define WEBKIT_WEB_FRAME_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj),  WEBKIT_TYPE_WEB_FRAME, WebKitWebFrameClass))
40 
41 typedef struct _WebKitWebFramePrivate WebKitWebFramePrivate;
42 
43 struct _WebKitWebFrame {
44     GObject parent_instance;
45 
46     /*< private >*/
47     WebKitWebFramePrivate *priv;
48 };
49 
50 struct _WebKitWebFrameClass {
51     GObjectClass parent_class;
52 
53     /*< public >*/
54     void (*_webkit_reserved1) (void);
55     void (*_webkit_reserved2) (void);
56     void (*_webkit_reserved3) (void);
57     void (*_webkit_reserved4) (void);
58     void (*_webkit_reserved5) (void);
59     void (*_webkit_reserved6) (void);
60 };
61 
62 /**
63  * WebKitLoadStatus
64  * @WEBKIT_LOAD_PROVISIONAL: No data has been received yet, empty
65  * structures have been allocated to perform the load; the load may
66  * still fail for transport issues such as not being able to resolve a
67  * name, or connect to a port.
68  * @WEBKIT_LOAD_COMMITTED: The first data chunk has arrived, meaning
69  * that the necessary transport requirements are stabilished, and the
70  * load is being performed.
71  * @WEBKIT_LOAD_FIRST_VISUALLY_NON_EMPTY_LAYOUT: The first layout with
72  * actual visible content happened; one or more layouts may have
73  * happened before that caused nothing to be visible on the screen,
74  * because the data available at the time was not significant enough.
75  * @WEBKIT_LOAD_FINISHED: This state means either that everything that
76  * was required to display the page has been loaded, or that an error
77  * has happened.
78  */
79 typedef enum {
80     WEBKIT_LOAD_PROVISIONAL,
81     WEBKIT_LOAD_COMMITTED,
82     WEBKIT_LOAD_FINISHED,
83     WEBKIT_LOAD_FIRST_VISUALLY_NON_EMPTY_LAYOUT
84 } WebKitLoadStatus;
85 
86 WEBKIT_API GType
87 webkit_web_frame_get_type           (void);
88 
89 #ifndef WEBKIT_DISABLE_DEPRECATED
90 WEBKIT_API WebKitWebFrame *
91 webkit_web_frame_new                (WebKitWebView        *web_view);
92 #endif
93 
94 WEBKIT_API WebKitWebView *
95 webkit_web_frame_get_web_view       (WebKitWebFrame       *frame);
96 
97 WEBKIT_API G_CONST_RETURN gchar *
98 webkit_web_frame_get_name           (WebKitWebFrame       *frame);
99 
100 WEBKIT_API G_CONST_RETURN gchar *
101 webkit_web_frame_get_title          (WebKitWebFrame       *frame);
102 
103 WEBKIT_API G_CONST_RETURN gchar *
104 webkit_web_frame_get_uri            (WebKitWebFrame       *frame);
105 
106 WEBKIT_API WebKitWebFrame*
107 webkit_web_frame_get_parent         (WebKitWebFrame       *frame);
108 
109 WEBKIT_API void
110 webkit_web_frame_load_uri           (WebKitWebFrame       *frame,
111                                      const gchar          *uri);
112 
113 WEBKIT_API void
114 webkit_web_frame_load_string        (WebKitWebFrame       *frame,
115                                      const gchar          *content,
116                                      const gchar          *mime_type,
117                                      const gchar          *encoding,
118                                      const gchar          *base_uri);
119 
120 WEBKIT_API void
121 webkit_web_frame_load_alternate_string (WebKitWebFrame    *frame,
122                                         const gchar       *content,
123                                         const gchar       *base_url,
124                                         const gchar       *unreachable_url);
125 
126 WEBKIT_API void
127 webkit_web_frame_load_request       (WebKitWebFrame       *frame,
128                                      WebKitNetworkRequest *request);
129 
130 WEBKIT_API void
131 webkit_web_frame_stop_loading       (WebKitWebFrame       *frame);
132 
133 WEBKIT_API void
134 webkit_web_frame_reload             (WebKitWebFrame       *frame);
135 
136 WEBKIT_API WebKitWebFrame *
137 webkit_web_frame_find_frame         (WebKitWebFrame       *frame,
138                                      const gchar          *name);
139 
140 WEBKIT_API JSGlobalContextRef
141 webkit_web_frame_get_global_context (WebKitWebFrame       *frame);
142 
143 WEBKIT_API GtkPrintOperationResult
144 webkit_web_frame_print_full         (WebKitWebFrame       *frame,
145                                      GtkPrintOperation    *operation,
146                                      GtkPrintOperationAction action,
147                                      GError              **error);
148 
149 WEBKIT_API void
150 webkit_web_frame_print              (WebKitWebFrame       *frame);
151 
152 WEBKIT_API WebKitLoadStatus
153 webkit_web_frame_get_load_status    (WebKitWebFrame       *frame);
154 
155 G_END_DECLS
156 
157 #endif
158