2 * Copyright (C) 2013 Apple Inc. All rights reserved.
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.
26 #ifndef WKBundlePageUIClient_h
27 #define WKBundlePageUIClient_h
29 #include <WebKit/WKBase.h>
30 #include <WebKit/WKEvent.h>
33 WKBundlePageUIElementVisibilityUnknown,
34 WKBundlePageUIElementVisible,
35 WKBundlePageUIElementHidden
37 typedef uint32_t WKBundlePageUIElementVisibility;
40 typedef void (*WKBundlePageWillAddMessageToConsoleCallback)(WKBundlePageRef page, WKStringRef message, uint32_t lineNumber, const void *clientInfo);
41 typedef void (*WKBundlePageWillSetStatusbarTextCallback)(WKBundlePageRef page, WKStringRef statusbarText, const void *clientInfo);
42 typedef void (*WKBundlePageWillRunJavaScriptAlertCallback)(WKBundlePageRef page, WKStringRef alertText, WKBundleFrameRef frame, const void *clientInfo);
43 typedef void (*WKBundlePageWillRunJavaScriptConfirmCallback)(WKBundlePageRef page, WKStringRef message, WKBundleFrameRef frame, const void *clientInfo);
44 typedef void (*WKBundlePageWillRunJavaScriptPromptCallback)(WKBundlePageRef page, WKStringRef message, WKStringRef defaultValue, WKBundleFrameRef frame, const void *clientInfo);
45 typedef void (*WKBundlePageMouseDidMoveOverElementCallback)(WKBundlePageRef page, WKBundleHitTestResultRef hitTestResult, WKEventModifiers modifiers, WKTypeRef* userData, const void *clientInfo);
46 typedef void (*WKBundlePageDidScrollCallback)(WKBundlePageRef page, const void *clientInfo);
47 typedef WKStringRef (*WKBundlePageGenerateFileForUploadCallback)(WKBundlePageRef page, WKStringRef originalFilePath, const void* clientInfo);
48 typedef WKBundlePageUIElementVisibility (*WKBundlePageStatusBarIsVisibleCallback)(WKBundlePageRef page, const void *clientInfo);
49 typedef WKBundlePageUIElementVisibility (*WKBundlePageMenuBarIsVisibleCallback)(WKBundlePageRef page, const void *clientInfo);
50 typedef WKBundlePageUIElementVisibility (*WKBundlePageToolbarsAreVisibleCallback)(WKBundlePageRef page, const void *clientInfo);
51 typedef void (*WKBundlePageReachedAppCacheOriginQuotaCallback)(WKBundlePageRef page, WKSecurityOriginRef origin, int64_t totalBytesNeeded, const void *clientInfo);
52 typedef uint64_t (*WKBundlePageExceededDatabaseQuotaCallback)(WKBundlePageRef page, WKSecurityOriginRef origin, WKStringRef databaseName, WKStringRef databaseDisplayName, uint64_t currentQuotaBytes, uint64_t currentOriginUsageBytes, uint64_t currentDatabaseUsageBytes, uint64_t expectedUsageBytes, const void *clientInfo);
53 typedef WKStringRef (*WKBundlePagePlugInCreateStartLabelTitleCallback)(WKStringRef mimeType, const void *clientInfo);
54 typedef WKStringRef (*WKBundlePagePlugInCreateStartLabelSubtitleCallback)(WKStringRef mimeType, const void *clientInfo);
55 typedef WKStringRef (*WKBundlePagePlugInCreateExtraStyleSheetCallback)(const void *clientInfo);
56 typedef WKStringRef (*WKBundlePagePlugInCreateExtraScriptCallback)(const void *clientInfo);
57 typedef void (*WKBundlePageDidClickAutoFillButtonCallback)(WKBundlePageRef page, WKBundleNodeHandleRef inputElement, WKTypeRef* userData, const void *clientInfo);
59 typedef struct WKBundlePageUIClientBase {
61 const void * clientInfo;
62 } WKBundlePageUIClientBase;
64 typedef struct WKBundlePageUIClientV0 {
65 WKBundlePageUIClientBase base;
68 WKBundlePageWillAddMessageToConsoleCallback willAddMessageToConsole;
69 WKBundlePageWillSetStatusbarTextCallback willSetStatusbarText;
70 WKBundlePageWillRunJavaScriptAlertCallback willRunJavaScriptAlert;
71 WKBundlePageWillRunJavaScriptConfirmCallback willRunJavaScriptConfirm;
72 WKBundlePageWillRunJavaScriptPromptCallback willRunJavaScriptPrompt;
73 WKBundlePageMouseDidMoveOverElementCallback mouseDidMoveOverElement;
74 WKBundlePageDidScrollCallback pageDidScroll;
76 WKBundlePageGenerateFileForUploadCallback shouldGenerateFileForUpload;
77 WKBundlePageGenerateFileForUploadCallback generateFileForUpload;
79 WKBundlePageStatusBarIsVisibleCallback statusBarIsVisible;
80 WKBundlePageMenuBarIsVisibleCallback menuBarIsVisible;
81 WKBundlePageToolbarsAreVisibleCallback toolbarsAreVisible;
82 } WKBundlePageUIClientV0;
84 typedef struct WKBundlePageUIClientV1 {
85 WKBundlePageUIClientBase base;
88 WKBundlePageWillAddMessageToConsoleCallback willAddMessageToConsole;
89 WKBundlePageWillSetStatusbarTextCallback willSetStatusbarText;
90 WKBundlePageWillRunJavaScriptAlertCallback willRunJavaScriptAlert;
91 WKBundlePageWillRunJavaScriptConfirmCallback willRunJavaScriptConfirm;
92 WKBundlePageWillRunJavaScriptPromptCallback willRunJavaScriptPrompt;
93 WKBundlePageMouseDidMoveOverElementCallback mouseDidMoveOverElement;
94 WKBundlePageDidScrollCallback pageDidScroll;
96 WKBundlePageGenerateFileForUploadCallback shouldGenerateFileForUpload;
97 WKBundlePageGenerateFileForUploadCallback generateFileForUpload;
99 WKBundlePageStatusBarIsVisibleCallback statusBarIsVisible;
100 WKBundlePageMenuBarIsVisibleCallback menuBarIsVisible;
101 WKBundlePageToolbarsAreVisibleCallback toolbarsAreVisible;
104 WKBundlePageReachedAppCacheOriginQuotaCallback didReachApplicationCacheOriginQuota;
105 } WKBundlePageUIClientV1;
107 typedef struct WKBundlePageUIClientV2 {
108 WKBundlePageUIClientBase base;
111 WKBundlePageWillAddMessageToConsoleCallback willAddMessageToConsole;
112 WKBundlePageWillSetStatusbarTextCallback willSetStatusbarText;
113 WKBundlePageWillRunJavaScriptAlertCallback willRunJavaScriptAlert;
114 WKBundlePageWillRunJavaScriptConfirmCallback willRunJavaScriptConfirm;
115 WKBundlePageWillRunJavaScriptPromptCallback willRunJavaScriptPrompt;
116 WKBundlePageMouseDidMoveOverElementCallback mouseDidMoveOverElement;
117 WKBundlePageDidScrollCallback pageDidScroll;
119 WKBundlePageGenerateFileForUploadCallback shouldGenerateFileForUpload;
120 WKBundlePageGenerateFileForUploadCallback generateFileForUpload;
122 WKBundlePageStatusBarIsVisibleCallback statusBarIsVisible;
123 WKBundlePageMenuBarIsVisibleCallback menuBarIsVisible;
124 WKBundlePageToolbarsAreVisibleCallback toolbarsAreVisible;
127 WKBundlePageReachedAppCacheOriginQuotaCallback didReachApplicationCacheOriginQuota;
130 WKBundlePageExceededDatabaseQuotaCallback didExceedDatabaseQuota;
131 WKBundlePagePlugInCreateStartLabelTitleCallback createPlugInStartLabelTitle;
132 WKBundlePagePlugInCreateStartLabelSubtitleCallback createPlugInStartLabelSubtitle;
133 WKBundlePagePlugInCreateExtraStyleSheetCallback createPlugInExtraStyleSheet;
134 WKBundlePagePlugInCreateExtraScriptCallback createPlugInExtraScript;
135 } WKBundlePageUIClientV2;
137 typedef struct WKBundlePageUIClientV3 {
138 WKBundlePageUIClientBase base;
141 WKBundlePageWillAddMessageToConsoleCallback willAddMessageToConsole;
142 WKBundlePageWillSetStatusbarTextCallback willSetStatusbarText;
143 WKBundlePageWillRunJavaScriptAlertCallback willRunJavaScriptAlert;
144 WKBundlePageWillRunJavaScriptConfirmCallback willRunJavaScriptConfirm;
145 WKBundlePageWillRunJavaScriptPromptCallback willRunJavaScriptPrompt;
146 WKBundlePageMouseDidMoveOverElementCallback mouseDidMoveOverElement;
147 WKBundlePageDidScrollCallback pageDidScroll;
149 WKBundlePageGenerateFileForUploadCallback shouldGenerateFileForUpload;
150 WKBundlePageGenerateFileForUploadCallback generateFileForUpload;
152 WKBundlePageStatusBarIsVisibleCallback statusBarIsVisible;
153 WKBundlePageMenuBarIsVisibleCallback menuBarIsVisible;
154 WKBundlePageToolbarsAreVisibleCallback toolbarsAreVisible;
157 WKBundlePageReachedAppCacheOriginQuotaCallback didReachApplicationCacheOriginQuota;
160 WKBundlePageExceededDatabaseQuotaCallback didExceedDatabaseQuota;
161 WKBundlePagePlugInCreateStartLabelTitleCallback createPlugInStartLabelTitle;
162 WKBundlePagePlugInCreateStartLabelSubtitleCallback createPlugInStartLabelSubtitle;
163 WKBundlePagePlugInCreateExtraStyleSheetCallback createPlugInExtraStyleSheet;
164 WKBundlePagePlugInCreateExtraScriptCallback createPlugInExtraScript;
171 WKBundlePageDidClickAutoFillButtonCallback didClickAutoFillButton;
172 } WKBundlePageUIClientV3;
174 #endif // WKBundlePageUIClient_h