2 * Copyright (C) 2011 Samsung Electronics
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23 * THE POSSIBILITY OF SUCH DAMAGE.
30 #include <WebKit2/WKBase.h>
31 #include <WebKit2/WKGeometry.h>
37 // html5 external video callback
38 typedef void (*WKPageHTML5VideoCallback)(WKPageRef page, WKStringRef url, WKStringRef cookie, const void* clientInfo);
39 // #if ENABLE(TIZEN_APPLICATION_CACHE)
40 typedef bool (*WKPageDecidePolicyForApplicationCachePermissionRequestCallback)(WKPageRef page, WKSecurityOriginRef origin, WKFrameRef frame, const void *clientInfo);
42 // #if ENABLE(TIZEN_MEDIA_STREAM)
43 typedef void (*WKPageDecidePolicyForUserMediaPermissionRequestCallback)(WKPageRef page, WKUserMediaPermissionRequestRef permissionRequest, const void *clientInfo);
45 // callback for jsbridge.
46 typedef void (*WKPageJSBridgePluginCallback)(WKPageRef page, WKStringRef request, WKStringRef message, const void* clientInfo);
47 // #if ENABLE(TIZEN_CERTIFICATE_HANDLING)
48 typedef bool (*WKPageDecidePolicyForCertificateErrorCallback)(WKPageRef page, WKStringRef url, WKStringRef certificate, int error, const void *clientInfo);
50 //#if ENABLE(TIZEN_INDEXED_DATABASE)
51 typedef bool (*WKPageExceededIndexedDatabaseQuotaCallback)(WKPageRef page, WKSecurityOriginRef origin, long long currentUsage, WKFrameRef frame, const void* clientInfo);
53 //#if ENABLE(TIZEN_FILE_SYSTEM)
54 typedef bool (*WKPageExceededLocalFileSystemQuotaCallback)(WKPageRef page, WKSecurityOriginRef origin, long long currentUsage, WKFrameRef frame, const void* clientInfo);
57 struct WKPageTizenClient {
59 const void * clientInfo;
62 // html5 video external player
63 WKPageHTML5VideoCallback processHTML5Video;
64 // #if ENABLE(TIZEN_APPLICATION_CACHE)
65 WKPageDecidePolicyForApplicationCachePermissionRequestCallback decidePolicyForApplicationCachePermissionRequest;
67 // userMedia permission
68 // #if ENABLE(TIZEN_MEDIA_STREAM)
69 WKPageDecidePolicyForUserMediaPermissionRequestCallback decidePolicyForUserMediaPermissionRequest;
71 // jsbridge support the special call which can be reached from JS to Browser App.
72 WKPageJSBridgePluginCallback processJSBridgePlugin;
73 // #if ENABLE(TIZEN_CERTIFICATE_HANDLING)
74 WKPageDecidePolicyForCertificateErrorCallback decidePolicyForCertificateError;
76 //#if ENABLE(TIZEN_INDEXED_DATABASE)
77 WKPageExceededIndexedDatabaseQuotaCallback exceededIndexedDatabaseQuota;
79 //#if ENABLE(TIZEN_FILE_SYSTEM)
80 WKPageExceededLocalFileSystemQuotaCallback exceededLocalFileSystemQuota;
83 typedef struct WKPageTizenClient WKPageTizenClient;
85 enum { kWKPageTizenClientCurrentVersion = 0 };
87 WK_EXPORT void WKPageSetPageTizenClient(WKPageRef page, const WKPageTizenClient* client);
89 /* Tizen Experimental feature */
90 WK_EXPORT WKImageRef WKPageCreateSnapshot(WKPageRef page, WKRect viewArea, float scaleFactor);
91 WK_EXPORT void WKPageGetSnapshotPdfFile(WKPageRef page, WKSize surfaceSize, WKSize contentsSize, WKStringRef fileName);
93 /* WK2 Recording Surface features */
94 WK_EXPORT void WKPageRecordingSurfaceSetEnable(WKPageRef page, bool enable);
96 /* WK2 ContextMenu Additional API */
97 WK_EXPORT WKStringRef WKPageContextMenuCopyAbsoluteLinkURLString(WKPageRef page);
98 WK_EXPORT WKStringRef WKPageContextMenuCopyAbsoluteImageURLString(WKPageRef page);
100 WK_EXPORT bool WKPageScrollBy(WKPageRef page, WKSize scrollOffset);
102 /* WK2 WebStorage APIs and callback */
103 // #if ENABLE(TIZEN_WEBKIT2_NUMBER_TYPE_SUPPORT)
104 typedef void (*WKPageGetWebStorageQuotaFunction)(WKUInt32Ref quota, WKErrorRef, void*);
105 WK_EXPORT void WKPageGetWebStorageQuota(WKPageRef page, void* context, WKPageGetWebStorageQuotaFunction function);
107 WK_EXPORT void WKPageSetWebStorageQuota(WKPageRef page, uint32_t quota);
109 /* WK2 Meta Tag APIs and callback */
110 // #if ENABLE(TIZEN_SUPPORT_WEBAPP_META_TAG)
111 typedef void (*WKPageGetWebAppCapableFunction)(WKBooleanRef capable, WKErrorRef, void*);
112 WK_EXPORT void WKPageGetWebAppCapable(WKPageRef page, void* context, WKPageGetWebAppCapableFunction function);
113 typedef void (*WKPageGetWebAppIconURLFunction)(WKStringRef iconURL, WKErrorRef, void*);
114 WK_EXPORT void WKPageGetWebAppIconURL(WKPageRef page, void* context, WKPageGetWebAppIconURLFunction function);
115 typedef void (*WKPageGetWebAppIconURLsFunction)(WKDictionaryRef iconURLs, WKErrorRef, void*);
116 WK_EXPORT void WKPageGetWebAppIconURLs(WKPageRef page, void* context, WKPageGetWebAppIconURLsFunction function);
119 WK_EXPORT void WKPageExecuteCommandWithArgument(WKPageRef page, WKStringRef command, WKStringRef argument);
121 // #if ENABLE(TIZEN_APPLICATION_CACHE)
122 WK_EXPORT void WKPageReplyApplicationCachePermission(WKPageRef page, bool allow);
125 //#if ENABLE(TIZEN_INDEXED_DATABASE)
126 WK_EXPORT void WKPageReplyExceededIndexedDatabaseQuota(WKPageRef page, bool allow);
129 // #if ENABLE(TIZEN_SQL_DATABASE)
130 WK_EXPORT void WKPageReplyExceededDatabaseQuota(WKPageRef page, bool allow);
133 //#if ENABLE(TIZEN_FILE_SYSTEM)
134 WK_EXPORT void WKPageReplyExceededLocalFileSystemQuota(WKPageRef page, bool allow);
141 #endif /* WKPageTizen_h */