bbf6a686cecf15a7ebe362c14a5d2a93e4836f76
[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 {
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     ViewWillStartLiveResize()
33     ViewWillEndLiveResize()
34
35     KeyEvent(WebKit::WebKeyboardEvent event)
36     KeyEventSyncForTesting(WebKit::WebKeyboardEvent event) -> (bool handled)
37     MouseEvent(WebKit::WebMouseEvent event)
38     MouseEventSyncForTesting(WebKit::WebMouseEvent event) -> (bool handled)
39     WheelEventSyncForTesting(WebKit::WebWheelEvent event) -> (bool handled)
40 #if ENABLE(TOUCH_EVENTS)
41     TouchEvent(WebKit::WebTouchEvent event)
42     TouchEventSyncForTesting(WebKit::WebTouchEvent event) -> (bool handled)
43 #endif
44 #if ENABLE(TOUCH_EVENTS) && PLATFORM(QT)
45     HighlightPotentialActivation(WebCore::IntPoint point, WebCore::IntSize area)
46 #endif
47
48 #if ENABLE(INPUT_TYPE_COLOR)
49     DidEndColorChooser()
50     DidChooseColor(WebCore::Color color)
51 #endif
52
53 #if ENABLE(CONTEXT_MENUS)
54     ContextMenuHidden()
55 #endif
56
57     ScrollBy(uint32_t scrollDirection, uint32_t scrollGranularity)
58     CenterSelectionInVisibleArea()
59
60     GoBack(uint64_t backForwardItemID)
61     GoForward(uint64_t backForwardItemID)
62     GoToBackForwardItem(uint64_t backForwardItemID)
63     TryRestoreScrollPosition()
64     LoadHTMLString(WTF::String htmlString, WTF::String baseURL)
65     LoadAlternateHTMLString(WTF::String htmlString, WTF::String baseURL, WTF::String unreachableURL)
66     LoadPlainTextString(WTF::String string)
67     LoadWebArchiveData(CoreIPC::DataReference webArchiveData)
68     LoadURL(WTF::String url, WebKit::SandboxExtension::Handle sandboxExtensionHandle)
69     LoadURLRequest(WebCore::ResourceRequest request, WebKit::SandboxExtension::Handle sandboxExtensionHandle)
70     LinkClicked(WTF::String url, WebKit::WebMouseEvent event)
71     Reload(bool reloadFromOrigin, WebKit::SandboxExtension::Handle sandboxExtensionHandle)
72     StopLoading()
73
74 #if PLATFORM(QT)
75     ApplicationSchemeReply(WebKit::QtNetworkReplyData reply)
76     RegisterApplicationScheme(WTF::String scheme)
77     SetUserScripts(WTF::Vector<WTF::String> script)
78 #endif
79
80     StopLoadingFrame(uint64_t frameID)
81     
82     RestoreSession(WebKit::SessionState state)
83     RestoreSessionAndNavigateToCurrentItem(WebKit::SessionState state)
84
85     DidRemoveBackForwardItem(uint64_t backForwardItemID)
86     SetWillGoToBackForwardItemCallbackEnabled(bool willGoToBackForwardItemEnabled)
87
88     DidReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, uint32_t policyAction, uint64_t downloadID)
89
90     ClearSelection()
91
92     # Callbacks.
93     GetContentsAsString(uint64_t callbackID)
94 #if ENABLE(MHTML)
95     GetContentsAsMHTMLData(uint64_t callbackID, bool useBinaryEncoding)
96 #endif
97     GetMainResourceDataOfFrame(uint64_t frameID, uint64_t callbackID)
98     GetResourceDataFromFrame(uint64_t frameID, WTF::String resourceURL, uint64_t callbackID)
99     GetRenderTreeExternalRepresentation(uint64_t callbackID)
100     GetSelectionOrContentsAsString(uint64_t callbackID)
101     GetSourceForFrame(uint64_t frameID, uint64_t callbackID)
102     GetWebArchiveOfFrame(uint64_t frameID, uint64_t callbackID)
103     RunJavaScriptInMainFrame(WTF::String script, uint64_t callbackID)
104     ForceRepaint(uint64_t callbackID)
105
106 #if PLATFORM(MAC)
107     # Dictionary support.
108     PerformDictionaryLookupAtLocation(WebCore::FloatPoint point)
109 #endif
110
111     PreferencesDidChange(WebKit::WebPreferencesStore store)
112
113     SetUserAgent(WTF::String userAgent)
114     SetCustomTextEncodingName(WTF::String encodingName)
115
116     SuspendActiveDOMObjectsAndAnimations()
117     ResumeActiveDOMObjectsAndAnimations()
118
119 #if USE(TILED_BACKING_STORE)
120     SetViewportSize(WebCore::IntSize size)
121 #endif
122
123     Close()
124     TryClose()
125
126     ValidateCommand(WTF::String name, uint64_t callbackID)
127     ExecuteEditCommand(WTF::String name)
128
129     DidRemoveEditCommand(uint64_t commandID)
130     ReapplyEditCommand(uint64_t commandID)
131     UnapplyEditCommand(uint64_t commandID)
132
133     SetPageAndTextZoomFactors(double pageZoomFactor, double textZoomFactor)
134     SetPageZoomFactor(double zoomFactor)
135     SetTextZoomFactor(double zoomFactor)
136     WindowScreenDidChange(uint64_t displayID)
137
138     ScalePage(double scale, WebCore::IntPoint origin)
139
140     SetUseFixedLayout(bool fixed)
141     SetFixedLayoutSize(WebCore::IntSize size)
142     ListenForLayoutMilestones(uint32_t milestones)
143     SetSuppressScrollbarAnimations(bool suppressAnimations)
144
145     SetPaginationMode(uint32_t mode)
146     SetPaginationBehavesLikeColumns(bool behavesLikeColumns)
147     SetPageLength(double pageLength)
148     SetGapBetweenPages(double gap)
149
150     PostInjectedBundleMessage(WTF::String messageName, WebKit::WebContextUserMessageEncoder messageBody) Variadic
151
152     # Find.
153     FindString(WTF::String string, uint32_t findOptions, unsigned maxMatchCount)
154     HideFindUI()
155     CountStringMatches(WTF::String string, uint32_t findOptions, unsigned maxMatchCount)
156
157     # Drag and drop.
158 #if PLATFORM(WIN) && ENABLE(DRAG_SUPPORT)
159     PerformDragControllerAction(uint64_t action, WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition, uint64_t draggingSourceOperationMask, HashMap<UINT,Vector<String>> dataMap, uint32_t flags)
160 #endif
161 #if (PLATFORM(QT) || PLATFORM(GTK)) && ENABLE(DRAG_SUPPORT)
162     PerformDragControllerAction(uint64_t action, WebCore::DragData dragData)
163 #endif
164 #if !PLATFORM(WIN) && !PLATFORM(QT) && !PLATFORM(GTK) && ENABLE(DRAG_SUPPORT)
165     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)
166 #endif
167 #if ENABLE(DRAG_SUPPORT)
168     DragEnded(WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition, uint64_t operation)
169 #endif
170
171     # Popup menu.
172     DidChangeSelectedIndexForActivePopupMenu(int32_t newIndex)
173     SetTextForActivePopupMenu(int32_t index)
174 #if PLATFORM(GTK)
175     FailedToShowPopupMenu()
176 #endif
177 #if PLATFORM(QT)
178     HidePopupMenu()
179     SelectedIndex(int32_t newIndex)
180 #endif
181     
182 #if ENABLE(CONTEXT_MENUS)
183     # Context menu.
184     DidSelectItemFromActiveContextMenu(WebKit::WebContextMenuItemData menuItem)
185 #endif
186
187     # Open panel.
188     DidChooseFilesForOpenPanel(Vector<WTF::String> fileURLs)
189     DidCancelForOpenPanel()
190 #if ENABLE(WEB_PROCESS_SANDBOX)
191     ExtendSandboxForFileFromOpenPanel(WebKit::SandboxExtension::Handle sandboxExtensionHandle)
192 #endif
193
194     # Spelling and grammar.
195     AdvanceToNextMisspelling(bool startBeforeSelection)
196     ChangeSpellingToWord(WTF::String word)
197 #if USE(APPKIT)
198     UppercaseWord()
199     LowercaseWord()
200     CapitalizeWord()
201
202     SetSmartInsertDeleteEnabled(bool isSmartInsertDeleteEnabled)
203 #endif
204
205 #if ENABLE(GEOLOCATION)
206     # Geolocation
207     DidReceiveGeolocationPermissionDecision(uint64_t geolocationID, bool allowed)
208 #endif
209
210     # Notification
211     DidReceiveNotificationPermissionDecision(uint64_t notificationID, bool allowed)
212
213     SetWindowResizerSize(WebCore::IntSize intersectsView)
214
215     # Printing.
216     BeginPrinting(uint64_t frameID, WebKit::PrintInfo printInfo)
217     EndPrinting()
218     ComputePagesForPrinting(uint64_t frameID, WebKit::PrintInfo printInfo, uint64_t callbackID)
219 #if PLATFORM(MAC) || PLATFORM(WIN)
220     DrawRectToImage(uint64_t frameID, WebKit::PrintInfo printInfo, WebCore::IntRect rect, uint64_t callbackID)
221     DrawPagesToPDF(uint64_t frameID, WebKit::PrintInfo printInfo, uint32_t first, uint32_t count, uint64_t callbackID)
222 #endif
223 #if PLATFORM(GTK)
224     DrawPagesForPrinting(uint64_t frameID, WebKit::PrintInfo printInfo, uint64_t callbackID)
225 #endif
226
227     # Media
228     SetMediaVolume(float volume)
229
230     SetMemoryCacheMessagesEnabled(bool memoryCacheMessagesEnabled)
231
232     // FIXME: This a dummy message, to avoid breaking the build for platforms that don't require
233     // any synchronous messages, and should be removed when <rdar://problem/8775115> is fixed.
234     Dummy() -> (bool dummyReturn)
235
236     SetCanRunBeforeUnloadConfirmPanel(bool canRunBeforeUnloadConfirmPanel)
237     SetCanRunModal(bool canRunModal)
238
239     # Web Intents
240 #if ENABLE(WEB_INTENTS)
241     DeliverIntentToFrame(uint64_t frameID, WebKit::IntentData intentData)
242 #endif
243
244 #if PLATFORM(EFL)
245     SetThemePath(WTF::String themePath)
246 #endif
247
248 #if USE(TILED_BACKING_STORE)
249     CommitPageTransitionViewport()
250 #endif
251
252 #if PLATFORM(QT)
253     SetComposition(WTF::String text, WTF::Vector<WebCore::CompositionUnderline> underlines, uint64_t selectionStart, uint64_t selectionEnd, uint64_t replacementRangeStart, uint64_t replacementRangeEnd)
254     ConfirmComposition(WTF::String text, int64_t selectionStart, int64_t selectionLength)
255     CancelComposition()
256 #endif
257
258 #if PLATFORM(MAC)
259     # Complex text input support for plug-ins.
260     SendComplexTextInputToPlugin(uint64_t pluginComplexTextInputIdentifier, String textInput)
261
262     SetWindowIsVisible(bool windowIsVisible)
263     WindowAndViewFramesChanged(WebCore::IntRect windowFrameInScreenCoordinates, WebCore::IntRect viewFrameInWindowCoordinates, WebCore::IntPoint accessibilityViewCoordinates)
264     RegisterUIProcessAccessibilityTokens(CoreIPC::DataReference elemenToken, CoreIPC::DataReference windowToken)
265     GetStringSelectionForPasteboard() -> (WTF::String stringValue)
266     GetDataSelectionForPasteboard(WTF::String pasteboardType) -> (WebKit::SharedMemory::Handle handle, uint64_t size)
267     ReadSelectionFromPasteboard(WTF::String pasteboardName) -> (bool result)
268
269     # Text input.
270     SetComposition(WTF::String text, WTF::Vector<WebCore::CompositionUnderline> underlines, uint64_t selectionStart, uint64_t selectionEnd, uint64_t replacementRangeStart, uint64_t replacementRangeEnd) -> (WebKit::EditorState newState)
271     ConfirmComposition() -> (WebKit::EditorState newState)
272     CancelComposition() -> (WebKit::EditorState newState)
273     InsertText(WTF::String text, uint64_t replacementRangeStart, uint64_t replacementRangeEnd) -> (bool handled, WebKit::EditorState newState)
274     GetMarkedRange() -> (uint64_t location, uint64_t length)
275     GetSelectedRange() -> (uint64_t location, uint64_t length)
276     GetAttributedSubstringFromRange(uint64_t location, uint64_t length) -> (WebKit::AttributedString result)
277     CharacterIndexForPoint(WebCore::IntPoint point) -> (uint64_t result)
278     FirstRectForCharacterRange(uint64_t location, uint64_t length) -> (WebCore::IntRect resultRect)
279     ExecuteKeypressCommands(Vector<WebCore::KeypressCommand> savedCommands) -> (bool handled, WebKit::EditorState newState)
280     ShouldDelayWindowOrderingEvent(WebKit::WebMouseEvent event) -> (bool result)
281     AcceptsFirstMouse(int eventNumber, WebKit::WebMouseEvent event) -> (bool result)
282     InsertDictatedText(WTF::String text, uint64_t replacementRangeStart, uint64_t replacementRangeEnd, WTF::Vector<WebCore::DictationAlternative> dictationAlternatives) -> (bool handled, WebKit::EditorState newState)
283 #endif
284 #if PLATFORM(WIN)
285     // FIXME: Unify with Mac counterparts.
286     ConfirmComposition(WTF::String compositionString)
287     SetComposition(WTF::String compositionString, WTF::Vector<WebCore::CompositionUnderline> underlines, uint64_t cursorPosition)
288     FirstRectForCharacterInSelectedRange(uint64_t characterPosition) -> (WebCore::IntRect resultRect)
289     GetSelectedText() -> (WTF::String text)
290
291     GestureWillBegin(WebCore::IntPoint point) -> (bool canBeginPanning)
292     GestureDidScroll(WebCore::IntSize size)
293     GestureDidEnd()
294 #endif
295 #if PLATFORM(EFL)
296     ConfirmComposition(WTF::String compositionString)
297     SetComposition(WTF::String compositionString, WTF::Vector<WebCore::CompositionUnderline> underlines, uint64_t cursorPosition)
298     CancelComposition()
299 #endif
300 #if PLATFORM(QT)
301     FindZoomableAreaForPoint(WebCore::IntPoint point, WebCore::IntSize area)
302 #endif
303
304 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
305     HandleAlternativeTextUIResult(String result)
306 #endif
307
308 #if ENABLE(PAGE_VISIBILITY_API) || ENABLE(HIDDEN_PAGE_DOM_TIMER_THROTTLING)
309     SetVisibilityState(int visibilityState, bool isInitialState)
310 #endif
311
312 #if PLATFORM(GTK) && USE(TEXTURE_MAPPER_GL)
313     SetAcceleratedCompositingWindowId(int64_t id)
314 #endif
315 }