Reviewed and landed by Sam Weinig.
[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     GoBack(uint64_t backForwardItemID, WebKit::SandboxExtension::Handle sandboxExtensionHandle)
46     GoForward(uint64_t backForwardItemID, WebKit::SandboxExtension::Handle sandboxExtensionHandle)
47     GoToBackForwardItem(uint64_t backForwardItemID, WebKit::SandboxExtension::Handle sandboxExtensionHandle)
48     LoadHTMLString(WTF::String htmlString, WTF::String baseURL)
49     LoadAlternateHTMLString(WTF::String htmlString, WTF::String baseURL, WTF::String unreachableURL); 
50     LoadPlainTextString(WTF::String string)
51     LoadURL(WTF::String url, WebKit::SandboxExtension::Handle sandboxExtensionHandle)
52     LoadURLRequest(WebCore::ResourceRequest request, WebKit::SandboxExtension::Handle sandboxExtensionHandle)
53     Reload(bool reloadFromOrigin)
54     StopLoading()
55
56     StopLoadingFrame(uint64_t frameID)
57     
58     RestoreSessionAndNavigateToCurrentItem(WebKit::SessionState state, WebKit::SandboxExtension::Handle sandboxExtensionHandle)
59
60     DidRemoveBackForwardItem(uint64_t backForwardItemID)
61
62     DidReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, uint32_t policyAction, uint64_t downloadID)
63
64     # Callbacks.
65     GetContentsAsString(uint64_t callbackID)
66     GetMainResourceDataOfFrame(uint64_t frameID, uint64_t callbackID)
67     GetResourceDataFromFrame(uint64_t frameID, WTF::String resourceURL, uint64_t callbackID)
68     GetRenderTreeExternalRepresentation(uint64_t callbackID)
69     GetSelectionOrContentsAsString(uint64_t callbackID)
70     GetSourceForFrame(uint64_t frameID, uint64_t callbackID)
71     GetWebArchiveOfFrame(uint64_t frameID, uint64_t callbackID)
72     RunJavaScriptInMainFrame(WTF::String script, uint64_t callbackID)
73
74     # FIXME: This should be a drawing area message.
75     ForceRepaint(uint64_t callbackID)
76
77     PreferencesDidChange(WebKit::WebPreferencesStore store)
78
79     SetUserAgent(WTF::String userAgent)
80     SetCustomTextEncodingName(WTF::String encodingName)
81
82 #if ENABLE(TILED_BACKING_STORE)
83     SetActualVisibleContentRect(WebCore::IntRect rect)
84     SetResizesToContentsUsingLayoutSize(WebCore::IntSize size)
85 #endif
86
87     Close()
88     TryClose()
89
90     ValidateMenuItem(WTF::String name)
91     ExecuteEditCommand(WTF::String name)
92
93     DidRemoveEditCommand(uint64_t commandID)
94     ReapplyEditCommand(uint64_t commandID)
95     UnapplyEditCommand(uint64_t commandID)
96
97     SetPageAndTextZoomFactors(double pageZoomFactor, double textZoomFactor)
98     SetPageZoomFactor(double zoomFactor)
99     SetTextZoomFactor(double zoomFactor)
100
101     ScaleWebView(double scale, WebCore::IntPoint origin)
102
103     SetUseFixedLayout(bool fixed)
104     SetFixedLayoutSize(WebCore::IntSize size)
105
106     # Find.
107     FindString(WTF::String string, uint32_t findOptions, unsigned maxMatchCount)
108     HideFindUI()
109     CountStringMatches(WTF::String string, uint32_t findOptions, unsigned maxMatchCount)
110
111     # Drag and drop.
112 #if PLATFORM(WIN)
113     PerformDragControllerAction(uint64_t action, WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition, uint64_t draggingSourceOperationMask, HashMap<UINT,Vector<String>> dataMap, uint32_t flags)
114 #endif
115 #if !PLATFORM(WIN)
116     PerformDragControllerAction(uint64_t action, WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition, uint64_t draggingSourceOperationMask, WTF::String dragStorageName, uint32_t flags)
117 #endif
118     DragEnded(WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition, uint64_t operation)
119
120     # Popup menu.
121     DidChangeSelectedIndexForActivePopupMenu(int32_t newIndex);
122     SetTextForActivePopupMenu(int32_t index);
123     
124     # Context menu.
125     DidSelectItemFromActiveContextMenu(WebKit::WebContextMenuItemData menuItem);
126
127     # Open panel.
128     DidChooseFilesForOpenPanel(Vector<WTF::String> fileURLs)
129     DidCancelForOpenPanel()
130 #if ENABLE(WEB_PROCESS_SANDBOX)
131     ExtendSandboxForFileFromOpenPanel(WebKit::SandboxExtension::Handle sandboxExtensionHandle)
132 #endif
133
134     # Spelling and grammar.
135     AdvanceToNextMisspelling(bool startBeforeSelection)
136     ChangeSpellingToWord(WTF::String word)
137     UnmarkAllMisspellings()
138     UnmarkAllBadGrammar()
139 #if PLATFORM(MAC)
140     UppercaseWord();
141     LowercaseWord();
142     CapitalizeWord();
143
144     SetSmartInsertDeleteEnabled(bool isSmartInsertDeleteEnabled);
145 #endif
146
147     # Geolocation
148     DidReceiveGeolocationPermissionDecision(uint64_t geolocationID, bool allowed)
149
150     SetWindowResizerSize(WebCore::IntSize intersectsView)
151
152     # Printing.
153     BeginPrinting(uint64_t frameID, WebKit::PrintInfo printInfo)
154     EndPrinting();
155     ComputePagesForPrinting(uint64_t frameID, WebKit::PrintInfo printInfo, uint64_t callbackID)
156 #if PLATFORM(MAC)
157     DrawRectToPDF(uint64_t frameID, WebCore::IntRect rect, uint64_t callbackID)
158     DrawPagesToPDF(uint64_t frameID, uint32_t first, uint32_t count, uint64_t callbackID)
159 #endif
160
161     // FIXME: This a dummy message, to avoid breaking the build for platforms that don't require
162     // any synchronous messages, and should be removed when <rdar://problem/8775115> is fixed.
163     Dummy() -> (bool dummyReturn)
164
165 #if PLATFORM(MAC)
166     # Complex text input support for plug-ins.
167     SendComplexTextInputToPlugin(uint64_t pluginComplexTextInputIdentifier, String textInput)
168
169     SetWindowIsVisible(bool windowIsVisible)
170     WindowAndViewFramesChanged(WebCore::IntRect windowFrameInScreenCoordinates, WebCore::IntRect viewFrameInWindowCoordinates, WebCore::IntPoint accessibilityViewCoordinates)
171     GetMarkedRange() -> (uint64_t location, uint64_t length)
172     CharacterIndexForPoint(WebCore::IntPoint point) -> (uint64_t result)
173     FirstRectForCharacterRange(uint64_t location, uint64_t length) -> (WebCore::IntRect resultRect)
174     RegisterUIProcessAccessibilityTokens(CoreIPC::DataReference elemenToken, CoreIPC::DataReference windowToken)
175 #endif
176 #if PLATFORM(WIN)
177     ConfirmComposition(WTF::String compositionString)
178     SetComposition(WTF::String compositionString, WTF::Vector<WebCore::CompositionUnderline> underlines, uint64_t cursorPosition)
179     FirstRectForCharacterInSelectedRange(uint64_t characterPosition) -> (WebCore::IntRect resultRect)
180     GetSelectedText() -> (WTF::String text)
181 #endif
182 #if PLATFORM(QT)
183     FindZoomableAreaForPoint(WebCore::IntPoint point)
184 #endif
185 }