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 23messages -> WebPage LegacyReceiver { 24 SetInitialFocus(bool forward, bool isKeyboardEventValid, WebKit::WebKeyboardEvent event) 25 SetViewState(unsigned viewState, bool wantsDidUpdateViewState) 26 SetLayerHostingMode(unsigned layerHostingMode) 27 28 SetSessionID(WebCore::SessionID sessionID) 29 30 SetDrawsBackground(bool drawsBackground) 31 SetDrawsTransparentBackground(bool drawsTransparentBackground) 32 33 SetTopContentInset(float contentInset) 34 35 SetUnderlayColor(WebCore::Color color) 36 37 ViewWillStartLiveResize() 38 ViewWillEndLiveResize() 39 40 KeyEvent(WebKit::WebKeyboardEvent event) 41 KeyEventSyncForTesting(WebKit::WebKeyboardEvent event) -> (bool handled) 42 MouseEvent(WebKit::WebMouseEvent event) 43 MouseEventSyncForTesting(WebKit::WebMouseEvent event) -> (bool handled) 44 WheelEventSyncForTesting(WebKit::WebWheelEvent event) -> (bool handled) 45#if PLATFORM(IOS) 46 SetViewportConfigurationMinimumLayoutSize(WebCore::FloatSize size) 47 SetViewportConfigurationMinimumLayoutSizeForMinimalUI(WebCore::FloatSize size) 48 SetMaximumUnobscuredSize(WebCore::FloatSize size) 49 SetDeviceOrientation(int32_t deviceOrientation) 50 DynamicViewportSizeUpdate(WebCore::FloatSize minimumLayoutSize, WebCore::FloatSize minimumLayoutSizeForMinimalUI, WebCore::FloatSize maximumUnobscuredSize, WebCore::FloatRect targetExposedContentRect, WebCore::FloatRect targetUnobscuredRect, WebCore::FloatRect targetUnobscuredRectInScrollViewCoordinates, double scale, int32_t deviceOrientation) 51 SynchronizeDynamicViewportUpdate() -> (double newTargetScale, WebCore::FloatPoint newScrollPosition, uint64_t nextValidLayerTreeTransactionID) 52 53 HandleTap(WebCore::IntPoint point) 54 PotentialTapAtPosition(uint64_t requestID, WebCore::FloatPoint point) 55 CommitPotentialTap() 56 CancelPotentialTap() 57 TapHighlightAtPosition(uint64_t requestID, WebCore::FloatPoint point) 58 InspectorNodeSearchMovedToPosition(WebCore::FloatPoint point) 59 InspectorNodeSearchEndedAtPosition(WebCore::FloatPoint point) 60 BlurAssistedNode() 61 SelectWithGesture(WebCore::IntPoint point, uint32_t granularity, uint32_t gestureType, uint32_t gestureState, uint64_t callbackID) 62 UpdateSelectionWithTouches(WebCore::IntPoint point, uint32_t touches, bool baseIsStart, uint64_t callbackID) 63 UpdateBlockSelectionWithTouch(WebCore::IntPoint point, uint32_t touch, uint32_t handlePosition) 64 SelectWithTwoTouches(WebCore::IntPoint from, WebCore::IntPoint to, uint32_t gestureType, uint32_t gestureState, uint64_t callbackID) 65 ExtendSelection(uint32_t granularity) 66 SelectWordBackward() 67 MoveSelectionByOffset(int32_t offset, uint64_t callbackID) 68 RequestDictationContext(uint64_t callbackID) 69 ReplaceDictatedText(String oldText, String newText) 70 ReplaceSelectedText(String oldText, String newText) 71 RequestAutocorrectionData(String textForAutocorrection, uint64_t callbackID) 72 ApplyAutocorrection(String correction, String originalText, uint64_t callbackID) 73 SyncApplyAutocorrection(String correction, String originalText) -> (bool autocorrectionApplied) 74 RequestAutocorrectionContext(uint64_t callbackID) 75 GetAutocorrectionContext() -> (String beforeContext, String markedText, String selectedText, String afterContext, uint64_t location, uint64_t length) 76 GetPositionInformation(WebCore::IntPoint point) -> (WebKit::InteractionInformationAtPosition information) 77 RequestPositionInformation(WebCore::IntPoint point) 78 StartInteractionWithElementAtPosition(WebCore::IntPoint point) 79 StopInteraction() 80 PerformActionOnElement(uint32_t action) 81 FocusNextAssistedNode(bool isForward) 82 SetAssistedNodeValue(String value) 83 SetAssistedNodeValueAsNumber(double value) 84 SetAssistedNodeSelectedIndex(uint32_t index, bool allowMultipleSelection) 85 ApplicationWillResignActive() 86 ApplicationWillEnterForeground() 87 ApplicationDidBecomeActive() 88 ContentSizeCategoryDidChange(String contentSizeCategory) 89 ExecuteEditCommandWithCallback(String name, uint64_t callbackID) 90#endif 91 92#if ENABLE(REMOTE_INSPECTOR) 93 SetAllowsRemoteInspection(bool allow) 94#endif 95 96#if ENABLE(IOS_TOUCH_EVENTS) 97 TouchEventSync(WebKit::WebTouchEvent event) -> (bool handled) 98#endif 99#if !ENABLE(IOS_TOUCH_EVENTS) && ENABLE(TOUCH_EVENTS) 100 TouchEvent(WebKit::WebTouchEvent event) 101 TouchEventSyncForTesting(WebKit::WebTouchEvent event) -> (bool handled) 102#endif 103 104#if ENABLE(INPUT_TYPE_COLOR) 105 DidEndColorPicker() 106 DidChooseColor(WebCore::Color color) 107#endif 108 109#if ENABLE(CONTEXT_MENUS) 110 ContextMenuHidden() 111#endif 112 113 ScrollBy(uint32_t scrollDirection, uint32_t scrollGranularity) 114 CenterSelectionInVisibleArea() 115 116 GoBack(uint64_t navigationID, uint64_t backForwardItemID) 117 GoForward(uint64_t navigationID, uint64_t backForwardItemID) 118 GoToBackForwardItem(uint64_t navigationID, uint64_t backForwardItemID) 119 TryRestoreScrollPosition() 120 121 LoadURLInFrame(String url, uint64_t frameID) 122 LoadRequest(uint64_t navigationID, WebCore::ResourceRequest request, WebKit::SandboxExtension::Handle sandboxExtensionHandle, WebKit::WebContextUserMessageEncoder userData) Variadic 123 LoadData(IPC::DataReference data, String MIMEType, String encoding, String baseURL, WebKit::WebContextUserMessageEncoder userData) Variadic 124 LoadHTMLString(uint64_t navigationID, String htmlString, String baseURL, WebKit::WebContextUserMessageEncoder userData) Variadic 125 LoadAlternateHTMLString(String htmlString, String baseURL, String unreachableURL, WebKit::WebContextUserMessageEncoder userData) Variadic 126 LoadPlainTextString(String string, WebKit::WebContextUserMessageEncoder userData) Variadic 127 LoadWebArchiveData(IPC::DataReference webArchiveData, WebKit::WebContextUserMessageEncoder userData) Variadic 128 129 Reload(uint64_t navigationID, bool reloadFromOrigin, WebKit::SandboxExtension::Handle sandboxExtensionHandle) 130 StopLoading() 131 132 StopLoadingFrame(uint64_t frameID) 133 134 RestoreSession(Vector<WebKit::BackForwardListItemState> itemStates) 135 136 DidRemoveBackForwardItem(uint64_t backForwardItemID) 137 138 DidReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, uint32_t policyAction, uint64_t navigationID, uint64_t downloadID) 139 140 ClearSelection() 141 142 # Callbacks. 143 GetContentsAsString(uint64_t callbackID) 144#if ENABLE(MHTML) 145 GetContentsAsMHTMLData(uint64_t callbackID, bool useBinaryEncoding) 146#endif 147 GetMainResourceDataOfFrame(uint64_t frameID, uint64_t callbackID) 148 GetResourceDataFromFrame(uint64_t frameID, String resourceURL, uint64_t callbackID) 149 GetRenderTreeExternalRepresentation(uint64_t callbackID) 150 GetSelectionOrContentsAsString(uint64_t callbackID) 151 GetSelectionAsWebArchiveData(uint64_t callbackID) 152 GetSourceForFrame(uint64_t frameID, uint64_t callbackID) 153 GetWebArchiveOfFrame(uint64_t frameID, uint64_t callbackID) 154 RunJavaScriptInMainFrame(String script, uint64_t callbackID) 155 ForceRepaint(uint64_t callbackID) 156 157#if PLATFORM(COCOA) 158 # Dictionary support. 159 PerformDictionaryLookupAtLocation(WebCore::FloatPoint point) 160#endif 161 162 PreferencesDidChange(WebKit::WebPreferencesStore store) 163 164 SetUserAgent(String userAgent) 165 SetCustomTextEncodingName(String encodingName) 166 167 SuspendActiveDOMObjectsAndAnimations() 168 ResumeActiveDOMObjectsAndAnimations() 169 170 Close() 171 TryClose() 172 173 ValidateCommand(String name, uint64_t callbackID) 174 ExecuteEditCommand(String name) 175 176 DidRemoveEditCommand(uint64_t commandID) 177 ReapplyEditCommand(uint64_t commandID) 178 UnapplyEditCommand(uint64_t commandID) 179 180 SetPageAndTextZoomFactors(double pageZoomFactor, double textZoomFactor) 181 SetPageZoomFactor(double zoomFactor) 182 SetTextZoomFactor(double zoomFactor) 183 WindowScreenDidChange(uint64_t displayID) 184 185 ScalePage(double scale, WebCore::IntPoint origin) 186 ScalePageInViewCoordinates(double scale, WebCore::IntPoint centerInViewCoordinates) 187 188 SetUseFixedLayout(bool fixed) 189 SetFixedLayoutSize(WebCore::IntSize size) 190 ListenForLayoutMilestones(uint32_t milestones) 191 SetSuppressScrollbarAnimations(bool suppressAnimations) 192 193 SetEnableVerticalRubberBanding(bool enableVerticalRubberBanding) 194 SetEnableHorizontalRubberBanding(bool enableHorizontalRubberBanding) 195 196 SetBackgroundExtendsBeyondPage(bool backgroundExtendsBeyondPage) 197 198 SetPaginationMode(uint32_t mode) 199 SetPaginationBehavesLikeColumns(bool behavesLikeColumns) 200 SetPageLength(double pageLength) 201 SetGapBetweenPages(double gap) 202 203 PostInjectedBundleMessage(String messageName, WebKit::WebContextUserMessageEncoder messageBody) Variadic 204 205 # Find. 206 FindString(String string, uint32_t findOptions, unsigned maxMatchCount) 207 FindStringMatches(String string, uint32_t findOptions, unsigned maxMatchCount) 208 GetImageForFindMatch(uint32_t matchIndex) 209 SelectFindMatch(uint32_t matchIndex) 210 HideFindUI() 211 CountStringMatches(String string, uint32_t findOptions, unsigned maxMatchCount) 212 213 AddMIMETypeWithCustomContentProvider(String mimeType) 214 215 # Drag and drop. 216#if PLATFORM(GTK) && ENABLE(DRAG_SUPPORT) 217 PerformDragControllerAction(uint64_t action, WebCore::DragData dragData) 218#endif 219#if !PLATFORM(GTK) && ENABLE(DRAG_SUPPORT) 220 PerformDragControllerAction(uint64_t action, WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition, uint64_t draggingSourceOperationMask, String dragStorageName, uint32_t flags, WebKit::SandboxExtension::Handle sandboxExtensionHandle, WebKit::SandboxExtension::HandleArray sandboxExtensionsForUpload) 221#endif 222#if ENABLE(DRAG_SUPPORT) 223 DragEnded(WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition, uint64_t operation) 224#endif 225 226 # Popup menu. 227 DidChangeSelectedIndexForActivePopupMenu(int32_t newIndex) 228 SetTextForActivePopupMenu(int32_t index) 229#if PLATFORM(GTK) 230 FailedToShowPopupMenu() 231#endif 232 233#if ENABLE(CONTEXT_MENUS) 234 # Context menu. 235 DidSelectItemFromActiveContextMenu(WebKit::WebContextMenuItemData menuItem) 236#endif 237 238 # Open panel. 239#if PLATFORM(IOS) 240 DidChooseFilesForOpenPanelWithDisplayStringAndIcon(Vector<String> fileURLs, String displayString, IPC::DataReference iconData) 241#endif 242 DidChooseFilesForOpenPanel(Vector<String> fileURLs) 243 DidCancelForOpenPanel() 244#if ENABLE(SANDBOX_EXTENSIONS) 245 ExtendSandboxForFileFromOpenPanel(WebKit::SandboxExtension::Handle sandboxExtensionHandle) 246#endif 247 248 # Spelling and grammar. 249 AdvanceToNextMisspelling(bool startBeforeSelection) 250 ChangeSpellingToWord(String word) 251 DidFinishCheckingText(uint64_t requestID, Vector<WebCore::TextCheckingResult> result) 252 DidCancelCheckingText(uint64_t requestID) 253#if USE(APPKIT) 254 UppercaseWord() 255 LowercaseWord() 256 CapitalizeWord() 257#endif 258#if PLATFORM(COCOA) 259 SetSmartInsertDeleteEnabled(bool isSmartInsertDeleteEnabled) 260#endif 261 262#if ENABLE(GEOLOCATION) 263 # Geolocation 264 DidReceiveGeolocationPermissionDecision(uint64_t geolocationID, bool allowed) 265#endif 266 267 # Notification 268 DidReceiveNotificationPermissionDecision(uint64_t notificationID, bool allowed) 269 270 SetWindowResizerSize(WebCore::IntSize intersectsView) 271 272 # Printing. 273 BeginPrinting(uint64_t frameID, WebKit::PrintInfo printInfo) 274 EndPrinting() 275 ComputePagesForPrinting(uint64_t frameID, WebKit::PrintInfo printInfo, uint64_t callbackID) 276#if PLATFORM(COCOA) 277 DrawRectToImage(uint64_t frameID, WebKit::PrintInfo printInfo, WebCore::IntRect rect, WebCore::IntSize imageSize, uint64_t callbackID) 278 DrawPagesToPDF(uint64_t frameID, WebKit::PrintInfo printInfo, uint32_t first, uint32_t count, uint64_t callbackID) 279#if PLATFORM(IOS) 280 ComputePagesForPrintingAndStartDrawingToPDF(uint64_t frameID, WebKit::PrintInfo printInfo, uint32_t firstPage) -> (Vector<WebCore::IntRect> pageRects, double totalScaleFactor) Delayed 281#endif 282#endif 283#if PLATFORM(GTK) 284 DrawPagesForPrinting(uint64_t frameID, WebKit::PrintInfo printInfo, uint64_t callbackID) 285#endif 286 287 # Media 288 SetMediaVolume(float volume) 289 SetMayStartMediaWhenInWindow(bool mayStartMedia) 290 291 // FIXME: This a dummy message, to avoid breaking the build for platforms that don't require 292 // any synchronous messages, and should be removed when <rdar://problem/8775115> is fixed. 293 Dummy() -> (bool dummyReturn) 294 295 SetCanRunBeforeUnloadConfirmPanel(bool canRunBeforeUnloadConfirmPanel) 296 SetCanRunModal(bool canRunModal) 297 298#if PLATFORM(EFL) 299 SetThemePath(String themePath) 300#endif 301 302#if USE(TILED_BACKING_STORE) 303 CommitPageTransitionViewport() 304#endif 305 306#if PLATFORM(GTK) 307 SetComposition(String text, Vector<WebCore::CompositionUnderline> underlines, uint64_t selectionStart, uint64_t selectionEnd, uint64_t replacementRangeStart, uint64_t replacementRangeEnd) 308 ConfirmComposition(String text, int64_t selectionStart, int64_t selectionLength) 309 CancelComposition() 310#endif 311 312#if PLATFORM(COCOA) 313 # Complex text input support for plug-ins. 314 SendComplexTextInputToPlugin(uint64_t pluginComplexTextInputIdentifier, String textInput) 315 316 WindowAndViewFramesChanged(WebCore::FloatRect windowFrameInScreenCoordinates, WebCore::FloatRect windowFrameInUnflippedScreenCoordinates, WebCore::FloatRect viewFrameInWindowCoordinates, WebCore::FloatPoint accessibilityViewCoordinates) 317 SetMainFrameIsScrollable(bool isScrollable) 318 RegisterUIProcessAccessibilityTokens(IPC::DataReference elemenToken, IPC::DataReference windowToken) 319 GetStringSelectionForPasteboard() -> (String stringValue) 320 GetDataSelectionForPasteboard(String pasteboardType) -> (WebKit::SharedMemory::Handle handle, uint64_t size) 321 ReadSelectionFromPasteboard(String pasteboardName) -> (bool result) 322 323#if ENABLE(SERVICE_CONTROLS) 324 ReplaceSelectionWithPasteboardData(Vector<String> types, IPC::DataReference data) 325#endif 326 327 ShouldDelayWindowOrderingEvent(WebKit::WebMouseEvent event) -> (bool result) 328 AcceptsFirstMouse(int eventNumber, WebKit::WebMouseEvent event) -> (bool result) 329 330 InsertTextAsync(String text, WebKit::EditingRange replacementRange, bool registerUndoGroup) 331 GetMarkedRangeAsync(uint64_t callbackID) 332 GetSelectedRangeAsync(uint64_t callbackID) 333 CharacterIndexForPointAsync(WebCore::IntPoint point, uint64_t callbackID); 334 FirstRectForCharacterRangeAsync(WebKit::EditingRange range, uint64_t callbackID); 335 SetCompositionAsync(String text, Vector<WebCore::CompositionUnderline> underlines, WebKit::EditingRange selectionRange, WebKit::EditingRange replacementRange) 336 ConfirmCompositionAsync() 337#endif 338#if PLATFORM(MAC) 339 InsertDictatedTextAsync(String text, WebKit::EditingRange replacementRange, Vector<WebCore::DictationAlternative> dictationAlternatives, bool registerUndoGroup) 340 AttributedSubstringForCharacterRangeAsync(WebKit::EditingRange range, uint64_t callbackID); 341#endif 342#if PLATFORM(MAC) && !USE(ASYNC_NSTEXTINPUTCLIENT) 343 InsertText(String text, WebKit::EditingRange replacementRange) -> (bool handled, WebKit::EditorState newState) 344 SetComposition(String text, Vector<WebCore::CompositionUnderline> underlines, WebKit::EditingRange selectionRange, WebKit::EditingRange replacementRange) -> (WebKit::EditorState newState) 345 ConfirmComposition() -> (WebKit::EditorState newState) 346 InsertDictatedText(String text, WebKit::EditingRange replacementRange, Vector<WebCore::DictationAlternative> dictationAlternatives) -> (bool handled, WebKit::EditorState newState) 347 GetAttributedSubstringFromRange(WebKit::EditingRange range) -> (WebKit::AttributedString result) 348 GetMarkedRange() -> (WebKit::EditingRange range) 349 GetSelectedRange() -> (WebKit::EditingRange range) 350 CharacterIndexForPoint(WebCore::IntPoint point) -> (uint64_t result) 351 FirstRectForCharacterRange(WebKit::EditingRange range) -> (WebCore::IntRect resultRect) 352 ExecuteKeypressCommands(Vector<WebCore::KeypressCommand> savedCommands) -> (bool handled, WebKit::EditorState newState) 353 CancelComposition() -> (WebKit::EditorState newState) 354#endif 355 356 SetMinimumLayoutSize(WebCore::IntSize minimumLayoutSize) 357 SetAutoSizingShouldExpandToViewHeight(bool shouldExpand) 358 359#if PLATFORM(EFL) 360 ConfirmComposition(String compositionString) 361 SetComposition(String compositionString, Vector<WebCore::CompositionUnderline> underlines, uint64_t cursorPosition) 362 CancelComposition() 363#endif 364#if USE(COORDINATED_GRAPHICS) 365 FindZoomableAreaForPoint(WebCore::IntPoint point, WebCore::IntSize area) 366#endif 367 368#if PLATFORM(COCOA) 369 HandleAlternativeTextUIResult(String result) 370#endif 371 372#if PLATFORM(IOS) 373 WillStartUserTriggeredZooming(); 374#endif 375 376#if PLATFORM(GTK) && USE(TEXTURE_MAPPER_GL) 377 SetAcceleratedCompositingWindowId(int64_t id) 378#endif 379 380 SetScrollPinningBehavior(uint32_t pinning) 381 382 GetBytecodeProfile(uint64_t callbackID) 383 384 TakeSnapshot(WebCore::IntRect snapshotRect, WebCore::IntSize bitmapSize, uint32_t options, uint64_t callbackID) 385} 386