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 ContextMenuHidden() 46 47 ScrollBy(uint32_t scrollDirection, uint32_t scrollGranularity) 48 49 GoBack(uint64_t backForwardItemID, WebKit::SandboxExtension::Handle sandboxExtensionHandle) 50 GoForward(uint64_t backForwardItemID, WebKit::SandboxExtension::Handle sandboxExtensionHandle) 51 GoToBackForwardItem(uint64_t backForwardItemID, WebKit::SandboxExtension::Handle sandboxExtensionHandle) 52 LoadHTMLString(WTF::String htmlString, WTF::String baseURL) 53 LoadAlternateHTMLString(WTF::String htmlString, WTF::String baseURL, WTF::String unreachableURL); 54 LoadPlainTextString(WTF::String string) 55 LoadURL(WTF::String url, WebKit::SandboxExtension::Handle sandboxExtensionHandle) 56 LoadURLRequest(WebCore::ResourceRequest request, WebKit::SandboxExtension::Handle sandboxExtensionHandle) 57 LinkClicked(WTF::String url, WebKit::WebMouseEvent event) 58 Reload(bool reloadFromOrigin) 59 StopLoading() 60 61 StopLoadingFrame(uint64_t frameID) 62 63 RestoreSession(WebKit::SessionState state) 64 RestoreSessionAndNavigateToCurrentItem(WebKit::SessionState state, WebKit::SandboxExtension::Handle sandboxExtensionHandle) 65 66 DidRemoveBackForwardItem(uint64_t backForwardItemID) 67 68 DidReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, uint32_t policyAction, uint64_t downloadID) 69 70 # Callbacks. 71 GetContentsAsString(uint64_t callbackID) 72 GetMainResourceDataOfFrame(uint64_t frameID, uint64_t callbackID) 73 GetResourceDataFromFrame(uint64_t frameID, WTF::String resourceURL, uint64_t callbackID) 74 GetRenderTreeExternalRepresentation(uint64_t callbackID) 75 GetSelectionOrContentsAsString(uint64_t callbackID) 76 GetSourceForFrame(uint64_t frameID, uint64_t callbackID) 77 GetWebArchiveOfFrame(uint64_t frameID, uint64_t callbackID) 78 RunJavaScriptInMainFrame(WTF::String script, uint64_t callbackID) 79 ForceRepaint(uint64_t callbackID) 80 81 #if PLATFORM(MAC) 82 # Dictionary support. 83 PerformDictionaryLookupAtLocation(WebCore::FloatPoint point) 84 #endif 85 86 PreferencesDidChange(WebKit::WebPreferencesStore store) 87 88 SetUserAgent(WTF::String userAgent) 89 SetCustomTextEncodingName(WTF::String encodingName) 90 91 #if ENABLE(TILED_BACKING_STORE) 92 SetActualVisibleContentRect(WebCore::IntRect rect) 93 SetResizesToContentsUsingLayoutSize(WebCore::IntSize size) 94 #endif 95 96 Close() 97 TryClose() 98 99 ValidateCommand(WTF::String name, uint64_t callbackID) 100 ExecuteEditCommand(WTF::String name) 101 102 DidRemoveEditCommand(uint64_t commandID) 103 ReapplyEditCommand(uint64_t commandID) 104 UnapplyEditCommand(uint64_t commandID) 105 106 SetPageAndTextZoomFactors(double pageZoomFactor, double textZoomFactor) 107 SetPageZoomFactor(double zoomFactor) 108 SetTextZoomFactor(double zoomFactor) 109 110 ScaleWebView(double scale, WebCore::IntPoint origin) 111 112 SetUseFixedLayout(bool fixed) 113 SetFixedLayoutSize(WebCore::IntSize size) 114 115 # Find. 116 FindString(WTF::String string, uint32_t findOptions, unsigned maxMatchCount) 117 HideFindUI() 118 CountStringMatches(WTF::String string, uint32_t findOptions, unsigned maxMatchCount) 119 120 # Drag and drop. 121 #if PLATFORM(WIN) 122 PerformDragControllerAction(uint64_t action, WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition, uint64_t draggingSourceOperationMask, HashMap<UINT,Vector<String>> dataMap, uint32_t flags) 123 #endif 124 #if !PLATFORM(WIN) 125 PerformDragControllerAction(uint64_t action, WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition, uint64_t draggingSourceOperationMask, WTF::String dragStorageName, uint32_t flags, WebKit::SandboxExtension::Handle sandboxExtensionHandle) 126 #endif 127 DragEnded(WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition, uint64_t operation) 128 129 # Popup menu. 130 DidChangeSelectedIndexForActivePopupMenu(int32_t newIndex); 131 SetTextForActivePopupMenu(int32_t index); 132 133 # Context menu. 134 DidSelectItemFromActiveContextMenu(WebKit::WebContextMenuItemData menuItem); 135 136 # Open panel. 137 DidChooseFilesForOpenPanel(Vector<WTF::String> fileURLs) 138 DidCancelForOpenPanel() 139 #if ENABLE(WEB_PROCESS_SANDBOX) 140 ExtendSandboxForFileFromOpenPanel(WebKit::SandboxExtension::Handle sandboxExtensionHandle) 141 #endif 142 143 # Spelling and grammar. 144 AdvanceToNextMisspelling(bool startBeforeSelection) 145 ChangeSpellingToWord(WTF::String word) 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::EditorState newState) 189 ConfirmComposition() -> (WebKit::EditorState newState) 190 InsertText(WTF::String text, uint64_t replacementRangeStart, uint64_t replacementRangeEnd) -> (bool handled, WebKit::EditorState 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::EditorState newState) 197 ShouldDelayWindowOrderingEvent(WebKit::WebMouseEvent event) -> (bool result) 198 AcceptsFirstMouse(int eventNumber, WebKit::WebMouseEvent event) -> (bool result) 199 #endif 200 #if PLATFORM(WIN) 201 // FIXME: Unify with Mac counterparts. 202 ConfirmComposition(WTF::String compositionString) 203 SetComposition(WTF::String compositionString, WTF::Vector<WebCore::CompositionUnderline> underlines, uint64_t cursorPosition) 204 FirstRectForCharacterInSelectedRange(uint64_t characterPosition) -> (WebCore::IntRect resultRect) 205 GetSelectedText() -> (WTF::String text) 206 207 GestureWillBegin(WebCore::IntPoint point) -> (bool canBeginPanning) 208 GestureDidScroll(WebCore::IntSize size) 209 GestureDidEnd() 210 #endif 211 #if PLATFORM(QT) 212 FindZoomableAreaForPoint(WebCore::IntPoint point) 213 #endif 214 215 #if PLATFORM(MAC) && !defined(BUILDING_ON_SNOW_LEOPARD) 216 HandleCorrectionPanelResult(String result) 217 #endif 218 } 219