2 * Copyright (C) 2007, 2008 Holger Hans Peter Freyther
3 * Copyright (C) 2008 Jan Michael C. Alonzo
4 * Copyright (C) 2008 Collabora Ltd.
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.
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.
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.
22 #ifndef WEBKIT_PRIVATE_H
23 #define WEBKIT_PRIVATE_H
26 * This file knows the shared secret of WebKitWebView and WebKitWebFrame.
27 * They are using WebCore which musn't be exposed to the outer world.
30 #include <webkit/webkitdefines.h>
31 #include <webkit/webkitwebview.h>
32 #include <webkit/webkitwebframe.h>
33 #include <webkit/webkitwebpolicydecision.h>
34 #include <webkit/webkitwebnavigationaction.h>
35 #include <webkit/webkitwebsettings.h>
36 #include <webkit/webkitwebwindowfeatures.h>
37 #include <webkit/webkitwebbackforwardlist.h>
39 #include "BackForwardList.h"
40 #include "HistoryItem.h"
44 #include "InspectorClientGtk.h"
45 #include "FrameLoaderClient.h"
46 #include "WindowFeatures.h"
51 WebKitWebView* getViewFromFrame(WebKitWebFrame*);
53 WebCore::Frame* core(WebKitWebFrame*);
54 WebKitWebFrame* kit(WebCore::Frame*);
56 WebCore::Page* core(WebKitWebView*);
57 WebKitWebView* kit(WebCore::Page*);
59 WebCore::HistoryItem* core(WebKitWebHistoryItem*);
60 WebKitWebHistoryItem* kit(WebCore::HistoryItem*);
62 WebCore::BackForwardList* core(WebKitWebBackForwardList*);
64 WebKitWebNavigationReason kit(WebCore::NavigationType type);
65 WebCore::NavigationType core(WebKitWebNavigationReason reason);
71 #define WEBKIT_PARAM_READABLE ((GParamFlags)(G_PARAM_READABLE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB))
72 #define WEBKIT_PARAM_READWRITE ((GParamFlags)(G_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB))
74 #define WEBKIT_WEB_VIEW_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), WEBKIT_TYPE_WEB_VIEW, WebKitWebViewPrivate))
75 typedef struct _WebKitWebViewPrivate WebKitWebViewPrivate;
76 struct _WebKitWebViewPrivate {
77 WebCore::Page* corePage;
78 WebKitWebSettings* webSettings;
79 WebKitWebInspector* webInspector;
80 WebKitWebWindowFeatures* webWindowFeatures;
82 WebKitWebFrame* mainFrame;
83 WebCore::String applicationNameForUserAgent;
84 WebCore::String* userAgent;
86 WebKitWebBackForwardList* backForwardList;
88 gint lastPopupXPosition;
89 gint lastPopupYPosition;
91 HashSet<GtkWidget*> children;
93 GtkIMContext* imContext;
95 GtkTargetList* copy_target_list;
96 GtkTargetList* paste_target_list;
100 GtkAdjustment* horizontalAdjustment;
101 GtkAdjustment* verticalAdjustment;
103 gboolean zoomFullContent;
105 char* customEncoding;
110 #define WEBKIT_WEB_FRAME_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), WEBKIT_TYPE_WEB_FRAME, WebKitWebFramePrivate))
111 typedef struct _WebKitWebFramePrivate WebKitWebFramePrivate;
112 struct _WebKitWebFramePrivate {
113 WebCore::Frame* coreFrame;
114 WebKitWebView* webView;
121 PassRefPtr<WebCore::Frame>
122 webkit_web_frame_init_with_web_view(WebKitWebView*, WebCore::HTMLFrameOwnerElement*);
125 webkit_web_frame_core_frame_gone(WebKitWebFrame*);
127 WebKitWebHistoryItem*
128 webkit_web_history_item_new_with_core_item(WebCore::HistoryItem*);
131 webkit_web_inspector_set_inspector_client(WebKitWebInspector*, WebKit::InspectorClient*);
134 webkit_web_inspector_set_web_view(WebKitWebInspector *web_inspector, WebKitWebView *web_view);
137 webkit_web_inspector_set_inspected_uri(WebKitWebInspector* web_inspector, const gchar* inspected_uri);
139 WebKitWebWindowFeatures*
140 webkit_web_window_features_new_from_core_features (const WebCore::WindowFeatures& features);
143 webkit_web_view_notify_ready (WebKitWebView* web_view);
145 WebKitWebPolicyDecision*
146 webkit_web_policy_decision_new (WebKitWebFrame*, WebCore::FramePolicyFunction);
149 webkit_web_policy_decision_cancel (WebKitWebPolicyDecision* decision);
151 // FIXME: Move these to webkitwebframe.h once their API has been discussed.
154 webkit_web_frame_get_children (WebKitWebFrame* frame);
157 webkit_web_frame_get_inner_text (WebKitWebFrame* frame);
160 webkit_web_frame_print (WebKitWebFrame* frame);
163 webkit_web_frame_dump_render_tree (WebKitWebFrame* frame);
166 webkit_web_frame_pause_animation(WebKitWebFrame* frame, const gchar* name, double time, const gchar* element);
169 webkit_web_frame_pause_transition(WebKitWebFrame* frame, const gchar* name, double time, const gchar* element);
171 WEBKIT_API unsigned int
172 webkit_web_frame_number_of_active_animations(WebKitWebFrame* frame);
175 webkit_web_view_get_selected_text (WebKitWebView* web_view);
178 webkit_web_settings_add_extra_plugin_directory (WebKitWebView *web_view, const gchar* directory);