Remove unused support for long presses from WebKit
[WebKit-https.git] / Source / WebKit2 / WebProcess / InjectedBundle / API / c / WKBundlePageUIClient.h
1 /*
2  * Copyright (C) 2013 Apple Inc. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
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.
12  *
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.
24  */
25
26 #ifndef WKBundlePageUIClient_h
27 #define WKBundlePageUIClient_h
28
29 #include <WebKit/WKBase.h>
30 #include <WebKit/WKEvent.h>
31
32 enum {
33     WKBundlePageUIElementVisibilityUnknown,
34     WKBundlePageUIElementVisible,
35     WKBundlePageUIElementHidden
36 };
37 typedef uint32_t WKBundlePageUIElementVisibility;
38
39
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);
58
59 typedef struct WKBundlePageUIClientBase {
60     int                                                                 version;
61     const void *                                                        clientInfo;
62 } WKBundlePageUIClientBase;
63
64 typedef struct WKBundlePageUIClientV0 {
65     WKBundlePageUIClientBase                                            base;
66
67     // Version 0.
68     WKBundlePageWillAddMessageToConsoleCallback                         willAddMessageToConsole;
69     WKBundlePageWillSetStatusbarTextCallback                            willSetStatusbarText;
70     WKBundlePageWillRunJavaScriptAlertCallback                          willRunJavaScriptAlert;
71     WKBundlePageWillRunJavaScriptConfirmCallback                        willRunJavaScriptConfirm;
72     WKBundlePageWillRunJavaScriptPromptCallback                         willRunJavaScriptPrompt;
73     WKBundlePageMouseDidMoveOverElementCallback                         mouseDidMoveOverElement;
74     WKBundlePageDidScrollCallback                                       pageDidScroll;
75     void*                                                               unused1;
76     WKBundlePageGenerateFileForUploadCallback                           shouldGenerateFileForUpload;
77     WKBundlePageGenerateFileForUploadCallback                           generateFileForUpload;
78     void*                                                               unused2;
79     WKBundlePageStatusBarIsVisibleCallback                              statusBarIsVisible;
80     WKBundlePageMenuBarIsVisibleCallback                                menuBarIsVisible;
81     WKBundlePageToolbarsAreVisibleCallback                              toolbarsAreVisible;
82 } WKBundlePageUIClientV0;
83
84 typedef struct WKBundlePageUIClientV1 {
85     WKBundlePageUIClientBase                                            base;
86
87     // Version 0.
88     WKBundlePageWillAddMessageToConsoleCallback                         willAddMessageToConsole;
89     WKBundlePageWillSetStatusbarTextCallback                            willSetStatusbarText;
90     WKBundlePageWillRunJavaScriptAlertCallback                          willRunJavaScriptAlert;
91     WKBundlePageWillRunJavaScriptConfirmCallback                        willRunJavaScriptConfirm;
92     WKBundlePageWillRunJavaScriptPromptCallback                         willRunJavaScriptPrompt;
93     WKBundlePageMouseDidMoveOverElementCallback                         mouseDidMoveOverElement;
94     WKBundlePageDidScrollCallback                                       pageDidScroll;
95     void*                                                               unused1;
96     WKBundlePageGenerateFileForUploadCallback                           shouldGenerateFileForUpload;
97     WKBundlePageGenerateFileForUploadCallback                           generateFileForUpload;
98     void*                                                               unused2;
99     WKBundlePageStatusBarIsVisibleCallback                              statusBarIsVisible;
100     WKBundlePageMenuBarIsVisibleCallback                                menuBarIsVisible;
101     WKBundlePageToolbarsAreVisibleCallback                              toolbarsAreVisible;
102
103     // Version 1.
104     WKBundlePageReachedAppCacheOriginQuotaCallback                      didReachApplicationCacheOriginQuota;
105 } WKBundlePageUIClientV1;
106
107 typedef struct WKBundlePageUIClientV2 {
108     WKBundlePageUIClientBase                                            base;
109
110     // Version 0.
111     WKBundlePageWillAddMessageToConsoleCallback                         willAddMessageToConsole;
112     WKBundlePageWillSetStatusbarTextCallback                            willSetStatusbarText;
113     WKBundlePageWillRunJavaScriptAlertCallback                          willRunJavaScriptAlert;
114     WKBundlePageWillRunJavaScriptConfirmCallback                        willRunJavaScriptConfirm;
115     WKBundlePageWillRunJavaScriptPromptCallback                         willRunJavaScriptPrompt;
116     WKBundlePageMouseDidMoveOverElementCallback                         mouseDidMoveOverElement;
117     WKBundlePageDidScrollCallback                                       pageDidScroll;
118     void*                                                               unused1;
119     WKBundlePageGenerateFileForUploadCallback                           shouldGenerateFileForUpload;
120     WKBundlePageGenerateFileForUploadCallback                           generateFileForUpload;
121     void*                                                               unused2;
122     WKBundlePageStatusBarIsVisibleCallback                              statusBarIsVisible;
123     WKBundlePageMenuBarIsVisibleCallback                                menuBarIsVisible;
124     WKBundlePageToolbarsAreVisibleCallback                              toolbarsAreVisible;
125
126     // Version 1.
127     WKBundlePageReachedAppCacheOriginQuotaCallback                      didReachApplicationCacheOriginQuota;
128
129     // Version 2.
130     WKBundlePageExceededDatabaseQuotaCallback                           didExceedDatabaseQuota;
131     WKBundlePagePlugInCreateStartLabelTitleCallback                     createPlugInStartLabelTitle;
132     WKBundlePagePlugInCreateStartLabelSubtitleCallback                  createPlugInStartLabelSubtitle;
133     WKBundlePagePlugInCreateExtraStyleSheetCallback                     createPlugInExtraStyleSheet;
134     WKBundlePagePlugInCreateExtraScriptCallback                         createPlugInExtraScript;
135 } WKBundlePageUIClientV2;
136
137 typedef struct WKBundlePageUIClientV3 {
138     WKBundlePageUIClientBase                                            base;
139
140     // Version 0.
141     WKBundlePageWillAddMessageToConsoleCallback                         willAddMessageToConsole;
142     WKBundlePageWillSetStatusbarTextCallback                            willSetStatusbarText;
143     WKBundlePageWillRunJavaScriptAlertCallback                          willRunJavaScriptAlert;
144     WKBundlePageWillRunJavaScriptConfirmCallback                        willRunJavaScriptConfirm;
145     WKBundlePageWillRunJavaScriptPromptCallback                         willRunJavaScriptPrompt;
146     WKBundlePageMouseDidMoveOverElementCallback                         mouseDidMoveOverElement;
147     WKBundlePageDidScrollCallback                                       pageDidScroll;
148     void*                                                               unused1;
149     WKBundlePageGenerateFileForUploadCallback                           shouldGenerateFileForUpload;
150     WKBundlePageGenerateFileForUploadCallback                           generateFileForUpload;
151     void*                                                               unused2;
152     WKBundlePageStatusBarIsVisibleCallback                              statusBarIsVisible;
153     WKBundlePageMenuBarIsVisibleCallback                                menuBarIsVisible;
154     WKBundlePageToolbarsAreVisibleCallback                              toolbarsAreVisible;
155
156     // Version 1.
157     WKBundlePageReachedAppCacheOriginQuotaCallback                      didReachApplicationCacheOriginQuota;
158
159     // Version 2.
160     WKBundlePageExceededDatabaseQuotaCallback                           didExceedDatabaseQuota;
161     WKBundlePagePlugInCreateStartLabelTitleCallback                     createPlugInStartLabelTitle;
162     WKBundlePagePlugInCreateStartLabelSubtitleCallback                  createPlugInStartLabelSubtitle;
163     WKBundlePagePlugInCreateExtraStyleSheetCallback                     createPlugInExtraStyleSheet;
164     WKBundlePagePlugInCreateExtraScriptCallback                         createPlugInExtraScript;
165
166     // Version 3.
167     void*                                                               unused3;
168     void*                                                               unused4;
169     void*                                                               unused5;
170
171     WKBundlePageDidClickAutoFillButtonCallback                          didClickAutoFillButton;
172 } WKBundlePageUIClientV3;
173
174 #endif // WKBundlePageUIClient_h