Add WKPageLoadData and WKPageLoadDataWithUserData SPI to support loading arbitrary...
[WebKit-https.git] / Source / WebKit2 / WebProcess / WebPage / WebPage.messages.in
1 # Copyright (C) 2010, 2011 Apple Inc. All rights reserved.
2 #
3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions
5 # are met:
6 # 1.  Redistributions of source code must retain the above copyright
7 #     notice, this list of conditions and the following disclaimer.
8 # 2.  Redistributions in binary form must reproduce the above copyright
9 #     notice, this list of conditions and the following disclaimer in the
10 #     documentation and/or other materials provided with the distribution.
11 #
12 # THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
13 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
15 # DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR
16 # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
17 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
18 # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
19 # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
20 # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
21 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22
23 messages -> WebPage LegacyReceiver {
24     SetActive(bool active)
25     SetFocused(bool focused)
26     SetInitialFocus(bool forward, bool isKeyboardEventValid, WebKit::WebKeyboardEvent event)
27     SetIsInWindow(bool isInWindow)
28
29     SetDrawsBackground(bool drawsBackground)
30     SetDrawsTransparentBackground(bool drawsTransparentBackground)
31
32     SetUnderlayColor(WebCore::Color color)
33
34     ViewWillStartLiveResize()
35     ViewWillEndLiveResize()
36
37     KeyEvent(WebKit::WebKeyboardEvent event)
38     KeyEventSyncForTesting(WebKit::WebKeyboardEvent event) -> (bool handled)
39     MouseEvent(WebKit::WebMouseEvent event)
40     MouseEventSyncForTesting(WebKit::WebMouseEvent event) -> (bool handled)
41     WheelEventSyncForTesting(WebKit::WebWheelEvent event) -> (bool handled)
42 #if ENABLE(TOUCH_EVENTS)
43     TouchEvent(WebKit::WebTouchEvent event)
44     TouchEventSyncForTesting(WebKit::WebTouchEvent event) -> (bool handled)
45 #endif
46 #if ENABLE(TOUCH_EVENTS) && PLATFORM(QT)
47     HighlightPotentialActivation(WebCore::IntPoint point, WebCore::IntSize area)
48 #endif
49
50 #if ENABLE(INPUT_TYPE_COLOR)
51     DidEndColorChooser()
52     DidChooseColor(WebCore::Color color)
53 #endif
54
55 #if ENABLE(CONTEXT_MENUS)
56     ContextMenuHidden()
57 #endif
58
59     ScrollBy(uint32_t scrollDirection, uint32_t scrollGranularity)
60     CenterSelectionInVisibleArea()
61
62     GoBack(uint64_t backForwardItemID)
63     GoForward(uint64_t backForwardItemID)
64     GoToBackForwardItem(uint64_t backForwardItemID)
65     TryRestoreScrollPosition()
66
67     LoadURL(WTF::String url, WebKit::SandboxExtension::Handle sandboxExtensionHandle, WebKit::WebContextUserMessageEncoder userData) Variadic
68     LoadURLRequest(WebCore::ResourceRequest request, WebKit::SandboxExtension::Handle sandboxExtensionHandle, WebKit::WebContextUserMessageEncoder userData) Variadic
69     LoadData(CoreIPC::DataReference data, WTF::String MIMEType, WTF::String encoding, WTF::String baseURL, WebKit::WebContextUserMessageEncoder userData) Variadic
70     LoadHTMLString(WTF::String htmlString, WTF::String baseURL, WebKit::WebContextUserMessageEncoder userData) Variadic
71     LoadAlternateHTMLString(WTF::String htmlString, WTF::String baseURL, WTF::String unreachableURL, WebKit::WebContextUserMessageEncoder userData) Variadic
72     LoadPlainTextString(WTF::String string, WebKit::WebContextUserMessageEncoder userData) Variadic
73     LoadWebArchiveData(CoreIPC::DataReference webArchiveData, WebKit::WebContextUserMessageEncoder userData) Variadic
74
75     LinkClicked(WTF::String url, WebKit::WebMouseEvent event)
76
77     Reload(bool reloadFromOrigin, WebKit::SandboxExtension::Handle sandboxExtensionHandle)
78     StopLoading()
79
80 #if PLATFORM(QT)
81     ApplicationSchemeReply(WebKit::QtNetworkReplyData reply)
82     RegisterApplicationScheme(WTF::String scheme)
83 #endif
84
85     StopLoadingFrame(uint64_t frameID)
86     
87     RestoreSession(WebKit::SessionState state)
88     RestoreSessionAndNavigateToCurrentItem(WebKit::SessionState state)
89
90     DidRemoveBackForwardItem(uint64_t backForwardItemID)
91     SetWillGoToBackForwardItemCallbackEnabled(bool willGoToBackForwardItemEnabled)
92
93     DidReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, uint32_t policyAction, uint64_t downloadID)
94
95     ClearSelection()
96
97     # Callbacks.
98     GetContentsAsString(uint64_t callbackID)
99 #if ENABLE(MHTML)
100     GetContentsAsMHTMLData(uint64_t callbackID, bool useBinaryEncoding)
101 #endif
102     GetMainResourceDataOfFrame(uint64_t frameID, uint64_t callbackID)
103     GetResourceDataFromFrame(uint64_t frameID, WTF::String resourceURL, uint64_t callbackID)
104     GetRenderTreeExternalRepresentation(uint64_t callbackID)
105     GetSelectionOrContentsAsString(uint64_t callbackID)
106     GetSelectionAsWebArchiveData(uint64_t callbackID)
107     GetSourceForFrame(uint64_t frameID, uint64_t callbackID)
108     GetWebArchiveOfFrame(uint64_t frameID, uint64_t callbackID)
109     RunJavaScriptInMainFrame(WTF::String script, uint64_t callbackID)
110     ForceRepaint(uint64_t callbackID)
111
112 #if PLATFORM(MAC)
113     # Dictionary support.
114     PerformDictionaryLookupAtLocation(WebCore::FloatPoint point)
115 #endif
116
117     PreferencesDidChange(WebKit::WebPreferencesStore store)
118
119     SetUserAgent(WTF::String userAgent)
120     SetCustomTextEncodingName(WTF::String encodingName)
121
122     SuspendActiveDOMObjectsAndAnimations()
123     ResumeActiveDOMObjectsAndAnimations()
124
125     Close()
126     TryClose()
127
128     ValidateCommand(WTF::String name, uint64_t callbackID)
129     ExecuteEditCommand(WTF::String name)
130
131     DidRemoveEditCommand(uint64_t commandID)
132     ReapplyEditCommand(uint64_t commandID)
133     UnapplyEditCommand(uint64_t commandID)
134
135     SetPageAndTextZoomFactors(double pageZoomFactor, double textZoomFactor)
136     SetPageZoomFactor(double zoomFactor)
137     SetTextZoomFactor(double zoomFactor)
138     WindowScreenDidChange(uint64_t displayID)
139
140     ScalePage(double scale, WebCore::IntPoint origin)
141
142     SetUseFixedLayout(bool fixed)
143     SetFixedLayoutSize(WebCore::IntSize size)
144     ListenForLayoutMilestones(uint32_t milestones)
145     SetSuppressScrollbarAnimations(bool suppressAnimations)
146
147     SetRubberBandsAtBottom(bool rubberBandsAtBottom)
148     SetRubberBandsAtTop(bool rubberBandsAtTop)
149
150     SetPaginationMode(uint32_t mode)
151     SetPaginationBehavesLikeColumns(bool behavesLikeColumns)
152     SetPageLength(double pageLength)
153     SetGapBetweenPages(double gap)
154
155     PostInjectedBundleMessage(WTF::String messageName, WebKit::WebContextUserMessageEncoder messageBody) Variadic
156
157     # Find.
158     FindString(WTF::String string, uint32_t findOptions, unsigned maxMatchCount)
159     FindStringMatches(WTF::String string, uint32_t findOptions, unsigned maxMatchCount)
160     GetImageForFindMatch(uint32_t matchIndex)
161     SelectFindMatch(uint32_t matchIndex)
162     HideFindUI()
163     CountStringMatches(WTF::String string, uint32_t findOptions, unsigned maxMatchCount)
164
165     # Drag and drop.
166 #if (PLATFORM(QT) || PLATFORM(GTK)) && ENABLE(DRAG_SUPPORT)
167     PerformDragControllerAction(uint64_t action, WebCore::DragData dragData)
168 #endif
169 #if !PLATFORM(QT) && !PLATFORM(GTK) && ENABLE(DRAG_SUPPORT)
170     PerformDragControllerAction(uint64_t action, WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition, uint64_t draggingSourceOperationMask, WTF::String dragStorageName, uint32_t flags, WebKit::SandboxExtension::Handle sandboxExtensionHandle, WebKit::SandboxExtension::HandleArray sandboxExtensionsForUpload)
171 #endif
172 #if ENABLE(DRAG_SUPPORT)
173     DragEnded(WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition, uint64_t operation)
174 #endif
175
176     # Popup menu.
177     DidChangeSelectedIndexForActivePopupMenu(int32_t newIndex)
178     SetTextForActivePopupMenu(int32_t index)
179 #if PLATFORM(GTK)
180     FailedToShowPopupMenu()
181 #endif
182 #if PLATFORM(QT)
183     HidePopupMenu()
184     SelectedIndex(int32_t newIndex)
185 #endif
186     
187 #if ENABLE(CONTEXT_MENUS)
188     # Context menu.
189     DidSelectItemFromActiveContextMenu(WebKit::WebContextMenuItemData menuItem)
190 #endif
191
192     # Open panel.
193     DidChooseFilesForOpenPanel(Vector<WTF::String> fileURLs)
194     DidCancelForOpenPanel()
195 #if ENABLE(WEB_PROCESS_SANDBOX)
196     ExtendSandboxForFileFromOpenPanel(WebKit::SandboxExtension::Handle sandboxExtensionHandle)
197 #endif
198
199     # Spelling and grammar.
200     AdvanceToNextMisspelling(bool startBeforeSelection)
201     ChangeSpellingToWord(WTF::String word)
202     DidFinishCheckingText(uint64_t requestID, WTF::Vector<WebCore::TextCheckingResult> result)
203     DidCancelCheckingText(uint64_t requestID)
204 #if USE(APPKIT)
205     UppercaseWord()
206     LowercaseWord()
207     CapitalizeWord()
208 #endif
209 #if PLATFORM(MAC)
210     SetSmartInsertDeleteEnabled(bool isSmartInsertDeleteEnabled)
211 #endif
212
213 #if ENABLE(GEOLOCATION)
214     # Geolocation
215     DidReceiveGeolocationPermissionDecision(uint64_t geolocationID, bool allowed)
216 #endif
217
218     # Notification
219     DidReceiveNotificationPermissionDecision(uint64_t notificationID, bool allowed)
220
221     SetWindowResizerSize(WebCore::IntSize intersectsView)
222
223     # Printing.
224     BeginPrinting(uint64_t frameID, WebKit::PrintInfo printInfo)
225     EndPrinting()
226     ComputePagesForPrinting(uint64_t frameID, WebKit::PrintInfo printInfo, uint64_t callbackID)
227 #if PLATFORM(MAC)
228     DrawRectToImage(uint64_t frameID, WebKit::PrintInfo printInfo, WebCore::IntRect rect, WebCore::IntSize imageSize, uint64_t callbackID)
229     DrawPagesToPDF(uint64_t frameID, WebKit::PrintInfo printInfo, uint32_t first, uint32_t count, uint64_t callbackID)
230 #endif
231 #if PLATFORM(GTK)
232     DrawPagesForPrinting(uint64_t frameID, WebKit::PrintInfo printInfo, uint64_t callbackID)
233 #endif
234
235     # Media
236     SetMediaVolume(float volume)
237     SetMayStartMediaWhenInWindow(bool mayStartMedia)
238
239     SetMemoryCacheMessagesEnabled(bool memoryCacheMessagesEnabled)
240
241     // FIXME: This a dummy message, to avoid breaking the build for platforms that don't require
242     // any synchronous messages, and should be removed when <rdar://problem/8775115> is fixed.
243     Dummy() -> (bool dummyReturn)
244
245     SetCanRunBeforeUnloadConfirmPanel(bool canRunBeforeUnloadConfirmPanel)
246     SetCanRunModal(bool canRunModal)
247
248 #if PLATFORM(EFL)
249     SetThemePath(WTF::String themePath)
250 #endif
251
252 #if USE(TILED_BACKING_STORE)
253     CommitPageTransitionViewport()
254 #endif
255
256 #if PLATFORM(QT) || PLATFORM(GTK)
257     SetComposition(WTF::String text, WTF::Vector<WebCore::CompositionUnderline> underlines, uint64_t selectionStart, uint64_t selectionEnd, uint64_t replacementRangeStart, uint64_t replacementRangeEnd)
258     ConfirmComposition(WTF::String text, int64_t selectionStart, int64_t selectionLength)
259     CancelComposition()
260 #endif
261
262 #if PLATFORM(MAC)
263     # Complex text input support for plug-ins.
264     SendComplexTextInputToPlugin(uint64_t pluginComplexTextInputIdentifier, String textInput)
265
266     SetWindowIsVisible(bool windowIsVisible)
267     WindowAndViewFramesChanged(WebCore::FloatRect windowFrameInScreenCoordinates, WebCore::FloatRect windowFrameInUnflippedScreenCoordinates, WebCore::FloatRect viewFrameInWindowCoordinates, WebCore::FloatPoint accessibilityViewCoordinates)
268     ViewExposedRectChanged(WebCore::FloatRect exposedRect)
269     SetMainFrameIsScrollable(bool isScrollable)
270     RegisterUIProcessAccessibilityTokens(CoreIPC::DataReference elemenToken, CoreIPC::DataReference windowToken)
271     GetStringSelectionForPasteboard() -> (WTF::String stringValue)
272     GetDataSelectionForPasteboard(WTF::String pasteboardType) -> (WebKit::SharedMemory::Handle handle, uint64_t size)
273     ReadSelectionFromPasteboard(WTF::String pasteboardName) -> (bool result)
274
275     # Text input.
276     SetComposition(WTF::String text, WTF::Vector<WebCore::CompositionUnderline> underlines, uint64_t selectionStart, uint64_t selectionEnd, uint64_t replacementRangeStart, uint64_t replacementRangeEnd) -> (WebKit::EditorState newState)
277     ConfirmComposition() -> (WebKit::EditorState newState)
278     CancelComposition() -> (WebKit::EditorState newState)
279     InsertText(WTF::String text, uint64_t replacementRangeStart, uint64_t replacementRangeEnd) -> (bool handled, WebKit::EditorState newState)
280     GetMarkedRange() -> (uint64_t location, uint64_t length)
281     GetSelectedRange() -> (uint64_t location, uint64_t length)
282     GetAttributedSubstringFromRange(uint64_t location, uint64_t length) -> (WebKit::AttributedString result)
283     CharacterIndexForPoint(WebCore::IntPoint point) -> (uint64_t result)
284     FirstRectForCharacterRange(uint64_t location, uint64_t length) -> (WebCore::IntRect resultRect)
285     ExecuteKeypressCommands(Vector<WebCore::KeypressCommand> savedCommands) -> (bool handled, WebKit::EditorState newState)
286     ShouldDelayWindowOrderingEvent(WebKit::WebMouseEvent event) -> (bool result)
287     AcceptsFirstMouse(int eventNumber, WebKit::WebMouseEvent event) -> (bool result)
288     InsertDictatedText(WTF::String text, uint64_t replacementRangeStart, uint64_t replacementRangeEnd, WTF::Vector<WebCore::DictationAlternative> dictationAlternatives) -> (bool handled, WebKit::EditorState newState)
289 #endif
290
291     SetMinimumLayoutWidth(double minimumLayoutWidth)
292
293 #if PLATFORM(EFL)
294     ConfirmComposition(WTF::String compositionString)
295     SetComposition(WTF::String compositionString, WTF::Vector<WebCore::CompositionUnderline> underlines, uint64_t cursorPosition)
296     CancelComposition()
297 #endif
298 #if PLATFORM(QT)
299     FindZoomableAreaForPoint(WebCore::IntPoint point, WebCore::IntSize area)
300 #endif
301
302 #if PLATFORM(MAC)
303     HandleAlternativeTextUIResult(String result)
304 #endif
305
306 #if ENABLE(PAGE_VISIBILITY_API) || ENABLE(HIDDEN_PAGE_DOM_TIMER_THROTTLING)
307     SetVisibilityState(uint32_t visibilityState, bool isInitialState)
308 #endif
309
310 #if PLATFORM(GTK) && USE(TEXTURE_MAPPER_GL)
311     SetAcceleratedCompositingWindowId(int64_t id)
312 #endif
313
314     SetMainFrameInViewSourceMode(bool inViewSourceMode)
315     SetOverridePrivateBrowsingEnabled(bool overridePrivateBrowsingEnabled)
316 }