94d3ad7fdc654a8f8ffaa3bafcfa1aca0d11e226
[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)
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     MouseEvent(WebKit::WebMouseEvent event)
37     WheelEvent(WebKit::WebWheelEvent event)
38 #if ENABLE(GESTURE_EVENTS)
39     GestureEvent(WebKit::WebGestureEvent event)
40 #endif
41 #if ENABLE(TOUCH_EVENTS)
42     TouchEvent(WebKit::WebTouchEvent event)
43 #endif
44
45     ScrollBy(uint32_t scrollDirection, uint32_t scrollGranularity)
46
47     GoBack(uint64_t backForwardItemID, WebKit::SandboxExtension::Handle sandboxExtensionHandle)
48     GoForward(uint64_t backForwardItemID, WebKit::SandboxExtension::Handle sandboxExtensionHandle)
49     GoToBackForwardItem(uint64_t backForwardItemID, WebKit::SandboxExtension::Handle sandboxExtensionHandle)
50     LoadHTMLString(WTF::String htmlString, WTF::String baseURL)
51     LoadAlternateHTMLString(WTF::String htmlString, WTF::String baseURL, WTF::String unreachableURL); 
52     LoadPlainTextString(WTF::String string)
53     LoadURL(WTF::String url, WebKit::SandboxExtension::Handle sandboxExtensionHandle)
54     LoadURLRequest(WebCore::ResourceRequest request, WebKit::SandboxExtension::Handle sandboxExtensionHandle)
55     LinkClicked(WTF::String url, WebKit::WebMouseEvent event)
56     Reload(bool reloadFromOrigin)
57     StopLoading()
58
59     StopLoadingFrame(uint64_t frameID)
60     
61     RestoreSession(WebKit::SessionState state)
62     RestoreSessionAndNavigateToCurrentItem(WebKit::SessionState state, WebKit::SandboxExtension::Handle sandboxExtensionHandle)
63
64     DidRemoveBackForwardItem(uint64_t backForwardItemID)
65
66     DidReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, uint32_t policyAction, uint64_t downloadID)
67
68     # Callbacks.
69     GetContentsAsString(uint64_t callbackID)
70     GetMainResourceDataOfFrame(uint64_t frameID, uint64_t callbackID)
71     GetResourceDataFromFrame(uint64_t frameID, WTF::String resourceURL, uint64_t callbackID)
72     GetRenderTreeExternalRepresentation(uint64_t callbackID)
73     GetSelectionOrContentsAsString(uint64_t callbackID)
74     GetSourceForFrame(uint64_t frameID, uint64_t callbackID)
75     GetWebArchiveOfFrame(uint64_t frameID, uint64_t callbackID)
76     RunJavaScriptInMainFrame(WTF::String script, uint64_t callbackID)
77     ForceRepaint(uint64_t callbackID)
78
79 #if PLATFORM(MAC)
80     # Dictionary support.
81     PerformDictionaryLookupAtLocation(WebCore::FloatPoint point)
82 #endif
83
84     PreferencesDidChange(WebKit::WebPreferencesStore store)
85
86     SetUserAgent(WTF::String userAgent)
87     SetCustomTextEncodingName(WTF::String encodingName)
88
89 #if ENABLE(TILED_BACKING_STORE)
90     SetActualVisibleContentRect(WebCore::IntRect rect)
91     SetResizesToContentsUsingLayoutSize(WebCore::IntSize size)
92 #endif
93
94     Close()
95     TryClose()
96
97     ValidateCommand(WTF::String name, uint64_t callbackID)
98     ExecuteEditCommand(WTF::String name)
99
100     DidRemoveEditCommand(uint64_t commandID)
101     ReapplyEditCommand(uint64_t commandID)
102     UnapplyEditCommand(uint64_t commandID)
103
104     SetPageAndTextZoomFactors(double pageZoomFactor, double textZoomFactor)
105     SetPageZoomFactor(double zoomFactor)
106     SetTextZoomFactor(double zoomFactor)
107
108     ScaleWebView(double scale, WebCore::IntPoint origin)
109
110     SetUseFixedLayout(bool fixed)
111     SetFixedLayoutSize(WebCore::IntSize size)
112
113     # Find.
114     FindString(WTF::String string, uint32_t findOptions, unsigned maxMatchCount)
115     HideFindUI()
116     CountStringMatches(WTF::String string, uint32_t findOptions, unsigned maxMatchCount)
117
118     # Drag and drop.
119 #if PLATFORM(WIN)
120     PerformDragControllerAction(uint64_t action, WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition, uint64_t draggingSourceOperationMask, HashMap<UINT,Vector<String>> dataMap, uint32_t flags)
121 #endif
122 #if !PLATFORM(WIN)
123     PerformDragControllerAction(uint64_t action, WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition, uint64_t draggingSourceOperationMask, WTF::String dragStorageName, uint32_t flags, WebKit::SandboxExtension::Handle sandboxExtensionHandle)
124 #endif
125     DragEnded(WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition, uint64_t operation)
126
127     # Popup menu.
128     DidChangeSelectedIndexForActivePopupMenu(int32_t newIndex);
129     SetTextForActivePopupMenu(int32_t index);
130     
131     # Context menu.
132     DidSelectItemFromActiveContextMenu(WebKit::WebContextMenuItemData menuItem);
133
134     # Open panel.
135     DidChooseFilesForOpenPanel(Vector<WTF::String> fileURLs)
136     DidCancelForOpenPanel()
137 #if ENABLE(WEB_PROCESS_SANDBOX)
138     ExtendSandboxForFileFromOpenPanel(WebKit::SandboxExtension::Handle sandboxExtensionHandle)
139 #endif
140
141     # Spelling and grammar.
142     AdvanceToNextMisspelling(bool startBeforeSelection)
143     ChangeSpellingToWord(WTF::String word)
144     UnmarkAllMisspellings()
145     UnmarkAllBadGrammar()
146 #if PLATFORM(MAC)
147     UppercaseWord();
148     LowercaseWord();
149     CapitalizeWord();
150
151     SetSmartInsertDeleteEnabled(bool isSmartInsertDeleteEnabled);
152 #endif
153
154     # Geolocation
155     DidReceiveGeolocationPermissionDecision(uint64_t geolocationID, bool allowed)
156
157     SetWindowResizerSize(WebCore::IntSize intersectsView)
158
159     # Printing.
160     BeginPrinting(uint64_t frameID, WebKit::PrintInfo printInfo)
161     EndPrinting();
162     ComputePagesForPrinting(uint64_t frameID, WebKit::PrintInfo printInfo, uint64_t callbackID)
163 #if PLATFORM(MAC) || PLATFORM(WIN)
164     DrawRectToPDF(uint64_t frameID, WebCore::IntRect rect, uint64_t callbackID)
165     DrawPagesToPDF(uint64_t frameID, uint32_t first, uint32_t count, uint64_t callbackID)
166 #endif
167
168     SetMemoryCacheMessagesEnabled(bool memoryCacheMessagesEnabled)
169
170     // FIXME: This a dummy message, to avoid breaking the build for platforms that don't require
171     // any synchronous messages, and should be removed when <rdar://problem/8775115> is fixed.
172     Dummy() -> (bool dummyReturn)
173
174     SetCanRunBeforeUnloadConfirmPanel(bool canRunBeforeUnloadConfirmPanel)
175     SetCanRunModal(bool canRunModal)
176
177 #if PLATFORM(MAC)
178     # Complex text input support for plug-ins.
179     SendComplexTextInputToPlugin(uint64_t pluginComplexTextInputIdentifier, String textInput)
180
181     SetWindowIsVisible(bool windowIsVisible)
182     WindowAndViewFramesChanged(WebCore::IntRect windowFrameInScreenCoordinates, WebCore::IntRect viewFrameInWindowCoordinates, WebCore::IntPoint accessibilityViewCoordinates)
183     RegisterUIProcessAccessibilityTokens(CoreIPC::DataReference elemenToken, CoreIPC::DataReference windowToken)
184     WriteSelectionToPasteboard(WTF::String pasteboardName, WTF::Vector<WTF::String> pasteboardTypes) -> (bool result)
185     ReadSelectionFromPasteboard(WTF::String pasteboardName) -> (bool result)
186
187     # Text input.
188     SetComposition(WTF::String text, WTF::Vector<WebCore::CompositionUnderline> underlines, uint64_t selectionStart, uint64_t selectionEnd, uint64_t replacementRangeStart, uint64_t replacementRangeEnd) -> (WebKit::TextInputState newState)
189     ConfirmComposition() -> (WebKit::TextInputState newState)
190     InsertText(WTF::String text, uint64_t replacementRangeStart, uint64_t replacementRangeEnd) -> (bool handled, WebKit::TextInputState newState)
191     GetMarkedRange() -> (uint64_t location, uint64_t length)
192     GetSelectedRange() -> (uint64_t location, uint64_t length)
193     GetAttributedSubstringFromRange(uint64_t location, uint64_t length) -> (WebKit::AttributedString result)
194     CharacterIndexForPoint(WebCore::IntPoint point) -> (uint64_t result)
195     FirstRectForCharacterRange(uint64_t location, uint64_t length) -> (WebCore::IntRect resultRect)
196     ExecuteKeypressCommands(Vector<WebCore::KeypressCommand> savedCommands) -> (bool handled, WebKit::TextInputState newState)
197
198 #endif
199 #if PLATFORM(WIN)
200     // FIXME: Unify with Mac counterparts.
201     ConfirmComposition(WTF::String compositionString)
202     SetComposition(WTF::String compositionString, WTF::Vector<WebCore::CompositionUnderline> underlines, uint64_t cursorPosition)
203     FirstRectForCharacterInSelectedRange(uint64_t characterPosition) -> (WebCore::IntRect resultRect)
204     GetSelectedText() -> (WTF::String text)
205
206     GestureWillBegin(WebCore::IntPoint point) -> (bool canBeginPanning)
207     GestureDidScroll(WebCore::IntSize size)
208     GestureDidEnd()
209 #endif
210 #if PLATFORM(QT)
211     FindZoomableAreaForPoint(WebCore::IntPoint point)
212 #endif
213
214 #if PLATFORM(MAC) && !defined(BUILDING_ON_SNOW_LEOPARD)
215     HandleCorrectionPanelResult(String result)
216 #endif
217 }