[CoordinatedGraphics][EFL] Remove view_source functions.
[WebKit-https.git] / Source / WebKit2 / UIProcess / API / C / CoordinatedGraphics / WKView.h
1 /*
2  * Copyright (C) 2012 Samsung Electronics
3  * Copyright (C) 2013 Intel Corporation. All rights reserved.
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 program 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 program; 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 WKView_h
22 #define WKView_h
23
24 #include <WebKit2/WKBase.h>
25 #include <WebKit2/WKGeometry.h>
26
27 #ifndef __cplusplus
28 #include <stdbool.h>
29 #endif
30
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34
35 typedef void (*WKViewCallback)(WKViewRef view, const void* clientInfo);
36 typedef void (*WKViewViewNeedsDisplayCallback)(WKViewRef view, WKRect area, const void* clientInfo);
37 typedef void (*WKViewPageDidChangeContentsSizeCallback)(WKViewRef view, WKSize size, const void* clientInfo);
38 typedef void (*WKViewWebProcessCrashedCallback)(WKViewRef view, WKURLRef url, const void* clientInfo);
39 typedef void (*WKViewPageDidChangeContentsPositionCallback)(WKViewRef view, WKPoint position, const void* clientInfo);
40 typedef void (*WKViewPageDidRenderFrameCallback)(WKViewRef view, WKSize contentsSize, WKRect coveredRect, const void* clientInfo);
41 typedef void (*WKViewPageDidChangeViewportAttributesCallback)(WKViewRef view, WKViewportAttributesRef, const void* clientInfo);
42 typedef void (*WKViewPageDidChangeTooltipCallback)(WKViewRef view, WKStringRef newTooltip, const void* clientInfo);
43 typedef void (*WKViewDidFindZoomableAreaCallback)(WKViewRef view, WKPoint point, WKRect area, const void* clientInfo);
44 typedef void (*WKViewDoneWithTouchEventCallback)(WKViewRef view, WKTouchEventRef touchEvent, bool wasEventHandled, const void* clientInfo);
45
46 typedef struct WKViewClientBase {
47     int                                              version;
48     const void*                                      clientInfo;
49 } WKViewClientBase;
50
51 typedef struct WKViewClientV0 {
52     WKViewClientBase                                 base;
53     // Version 0
54     WKViewViewNeedsDisplayCallback                   viewNeedsDisplay;
55     WKViewPageDidChangeContentsSizeCallback          didChangeContentsSize;
56     WKViewWebProcessCrashedCallback                  webProcessCrashed;
57     WKViewCallback                                   webProcessDidRelaunch;
58     WKViewPageDidChangeContentsPositionCallback      didChangeContentsPosition;
59     WKViewPageDidRenderFrameCallback                 didRenderFrame;
60     WKViewCallback                                   didCompletePageTransition;
61     WKViewPageDidChangeViewportAttributesCallback    didChangeViewportAttributes;
62     WKViewPageDidChangeTooltipCallback               didChangeTooltip;
63     WKViewDidFindZoomableAreaCallback                didFindZoomableArea;
64     WKViewDoneWithTouchEventCallback                 doneWithTouchEvent;
65 } WKViewClientV0;
66
67 WK_EXPORT WKViewRef WKViewCreate(WKContextRef context, WKPageGroupRef pageGroup);
68
69 WK_EXPORT void WKViewInitialize(WKViewRef);
70
71 WK_EXPORT WKSize WKViewGetSize(WKViewRef);
72 WK_EXPORT void WKViewSetSize(WKViewRef, WKSize size);
73
74 WK_EXPORT void WKViewSetViewClient(WKViewRef, const WKViewClientBase*);
75
76 WK_EXPORT bool WKViewIsActive(WKViewRef);
77 WK_EXPORT void WKViewSetIsActive(WKViewRef, bool);
78
79 WK_EXPORT bool WKViewIsFocused(WKViewRef);
80 WK_EXPORT void WKViewSetIsFocused(WKViewRef, bool);
81
82 WK_EXPORT bool WKViewIsVisible(WKViewRef);
83 WK_EXPORT void WKViewSetIsVisible(WKViewRef, bool);
84
85 WK_EXPORT float WKViewGetContentScaleFactor(WKViewRef);
86 WK_EXPORT void WKViewSetContentScaleFactor(WKViewRef, float);
87
88 WK_EXPORT WKPoint WKViewGetContentPosition(WKViewRef);
89 WK_EXPORT void WKViewSetContentPosition(WKViewRef, WKPoint);
90
91 WK_EXPORT void WKViewSetUserViewportTranslation(WKViewRef, double tx, double ty);
92 WK_EXPORT WKPoint WKViewUserViewportToContents(WKViewRef, WKPoint);
93 WK_EXPORT WKPoint WKViewUserViewportToScene(WKViewRef, WKPoint);
94 WK_EXPORT WKPoint WKViewContentsToUserViewport(WKViewRef, WKPoint);
95
96 WK_EXPORT void WKViewPaintToCurrentGLContext(WKViewRef);
97
98 WK_EXPORT WKPageRef WKViewGetPage(WKViewRef);
99
100 WK_EXPORT void WKViewSetDrawsBackground(WKViewRef, bool);
101 WK_EXPORT bool WKViewGetDrawsBackground(WKViewRef);
102
103 WK_EXPORT void WKViewSetDrawsTransparentBackground(WKViewRef, bool);
104 WK_EXPORT bool WKViewGetDrawsTransparentBackground(WKViewRef);
105
106 WK_EXPORT void WKViewSuspendActiveDOMObjectsAndAnimations(WKViewRef);
107 WK_EXPORT void WKViewResumeActiveDOMObjectsAndAnimations(WKViewRef);
108
109 WK_EXPORT bool WKViewExitFullScreen(WKViewRef);
110
111 WK_EXPORT void WKViewSetOpacity(WKViewRef view, double opacity);
112 WK_EXPORT double WKViewOpacity(WKViewRef view);
113
114 WK_EXPORT void WKViewFindZoomableAreaForRect(WKViewRef, WKRect);
115
116 #ifdef __cplusplus
117 }
118 #endif
119
120 #endif /* WKView_h */