/* -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 8 -*- */ /* vim: set sw=4 ts=8 et tw=80 ft=cpp : */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ include protocol PBlob; include protocol PColorPicker; include protocol PContent; include protocol PContentBridge; include protocol PDocAccessible; include protocol PDocumentRenderer; include protocol PDatePicker; include protocol PFilePicker; include protocol PIndexedDBPermissionRequest; include protocol PRenderFrame; include protocol PTimePicker; include protocol PPluginWidget; include DOMTypes; include JavaScriptTypes; include URIParams; include BrowserConfiguration; using class IPC::Principal from "mozilla/dom/PermissionMessageUtils.h"; using class mozilla::gfx::Matrix from "mozilla/gfx/Matrix.h"; using struct gfxSize from "gfxPoint.h"; using CSSRect from "Units.h"; using CSSSize from "Units.h"; using mozilla::LayoutDeviceIntRect from "Units.h"; using mozilla::LayoutDeviceIntPoint from "Units.h"; using mozilla::ScreenIntPoint from "Units.h"; using ScreenIntSize from "Units.h"; using struct mozilla::layers::FrameMetrics from "FrameMetrics.h"; using struct mozilla::layers::ScrollableLayerGuid from "FrameMetrics.h"; using struct mozilla::layers::ZoomConstraints from "FrameMetrics.h"; using mozilla::layers::MaybeZoomConstraints from "FrameMetrics.h"; using FrameMetrics::ViewID from "FrameMetrics.h"; using struct mozilla::void_t from "ipc/IPCMessageUtils.h"; using mozilla::WindowsHandle from "ipc/IPCMessageUtils.h"; using nscolor from "nsColor.h"; using class mozilla::WidgetCompositionEvent from "ipc/nsGUIEventIPC.h"; using struct mozilla::widget::IMENotification from "nsIWidget.h"; using struct nsIMEUpdatePreference from "nsIWidget.h"; using mozilla::gfx::IntSize from "mozilla/gfx/Point.h"; using mozilla::gfx::IntPoint from "mozilla/gfx/Point.h"; using mozilla::gfx::IntRect from "mozilla/gfx/Rect.h"; using class mozilla::ContentCache from "ipc/nsGUIEventIPC.h"; using class mozilla::WidgetKeyboardEvent from "ipc/nsGUIEventIPC.h"; using class mozilla::WidgetMouseEvent from "ipc/nsGUIEventIPC.h"; using class mozilla::WidgetWheelEvent from "ipc/nsGUIEventIPC.h"; using class mozilla::WidgetDragEvent from "ipc/nsGUIEventIPC.h"; using struct nsRect from "nsRect.h"; using class mozilla::WidgetSelectionEvent from "ipc/nsGUIEventIPC.h"; using class mozilla::WidgetTouchEvent from "ipc/nsGUIEventIPC.h"; using struct mozilla::dom::RemoteDOMEvent from "mozilla/dom/TabMessageUtils.h"; using mozilla::dom::ScreenOrientationInternal from "mozilla/dom/ScreenOrientation.h"; using struct mozilla::layers::TextureFactoryIdentifier from "mozilla/layers/CompositorTypes.h"; using mozilla::CSSPoint from "Units.h"; using mozilla::CSSToScreenScale from "Units.h"; using mozilla::CommandInt from "mozilla/EventForwards.h"; using mozilla::Modifiers from "mozilla/EventForwards.h"; using mozilla::layers::GeckoContentController::APZStateChange from "mozilla/layers/GeckoContentController.h"; using mozilla::WritingMode from "mozilla/WritingModes.h"; using mozilla::layers::AsyncDragMetrics from "mozilla/layers/AsyncDragMetrics.h"; using mozilla::layers::TouchBehaviorFlags from "mozilla/layers/APZUtils.h"; using nsIWidget::TouchPointerState from "nsIWidget.h"; using struct LookAndFeelInt from "mozilla/widget/WidgetMessageUtils.h"; using class mozilla::dom::ipc::StructuredCloneData from "ipc/IPCMessageUtils.h"; using mozilla::EventMessage from "mozilla/EventForwards.h"; using nsEventStatus from "mozilla/EventForwards.h"; using nsSizeMode from "nsIWidgetListener.h"; namespace mozilla { namespace dom { struct NativeKeyBinding { CommandInt[] singleLineCommands; CommandInt[] multiLineCommands; CommandInt[] richTextCommands; }; union MaybeNativeKeyBinding { NativeKeyBinding; void_t; }; struct ShowInfo { nsString name; bool fullscreenAllowed; bool isPrivate; bool fakeShowInfo; float dpi; double defaultScale; }; prio(normal upto urgent) sync protocol PBrowser { manager PContent or PContentBridge; manages PColorPicker; manages PDocAccessible; manages PDocumentRenderer; manages PFilePicker; manages PDatePicker; manages PTimePicker; manages PIndexedDBPermissionRequest; manages PRenderFrame; manages PPluginWidget; both: AsyncMessage(nsString aMessage, ClonedMessageData aData, CpowEntry[] aCpows, Principal aPrincipal); /** * Create a layout frame (encapsulating a remote layer tree) for * the page that is currently loaded in the . */ PRenderFrame(); parent: /** * Tell the parent process a new accessible document has been created. * aParentDoc is the accessible document it was created in if any, and * aParentAcc is the id of the accessible in that document the new document * is a child of. */ PDocAccessible(nullable PDocAccessible aParentDoc, uint64_t aParentAcc); /* * Creates a new remoted nsIWidget connection for windowed plugins * in e10s mode. This is always initiated from the child in response * to windowed plugin creation. */ sync PPluginWidget(); /** * Return native data of root widget */ sync GetWidgetNativeData() returns (WindowsHandle value); /** * Sends an NS_NATIVE_CHILD_OF_SHAREABLE_WINDOW to be adopted by the * widget's shareable window on the chrome side. Only used on Windows. */ async SetNativeChildOfShareableWindow(uintptr_t childWindow); /** * When content moves focus from a native plugin window that's a child * of the native browser window we need to move native focus to the * browser. Otherwise the plugin window will never relinquish focus. */ sync DispatchFocusToTopLevelWindow(); parent: /** * When child sends this message, parent should move focus to * the next or previous focusable element or document. */ MoveFocus(bool forward, bool forDocumentNavigation); Event(RemoteDOMEvent aEvent); sync SyncMessage(nsString aMessage, ClonedMessageData aData, CpowEntry[] aCpows, Principal aPrincipal) returns (StructuredCloneData[] retval); prio(high) sync RpcMessage(nsString aMessage, ClonedMessageData aData, CpowEntry[] aCpows, Principal aPrincipal) returns (StructuredCloneData[] retval); /** * Notifies chrome that there is a focus change involving an editable * object (input, textarea, document, contentEditable. etc.) * * contentCache Cache of content * notification Whole data of the notification * preference Native widget preference for IME updates */ prio(urgent) sync NotifyIMEFocus(ContentCache contentCache, IMENotification notification) returns (nsIMEUpdatePreference preference); /** * Notifies chrome that there has been a change in text content * One call can encompass both a delete and an insert operation * Only called when NotifyIMEFocus returns PR_TRUE for mWantUpdates * * contentCache Cache of content * notification Whole data of the notification */ prio(urgent) async NotifyIMETextChange(ContentCache contentCache, IMENotification notification); /** * Notifies chrome that there is a IME compostion rect updated * * contentCache Cache of content */ prio(urgent) async NotifyIMECompositionUpdate(ContentCache contentCache, IMENotification notification); /** * Notifies chrome that there has been a change in selection * Only called when NotifyIMEFocus returns PR_TRUE for mWantUpdates * * contentCache Cache of content * notification Whole data of the notification */ prio(urgent) async NotifyIMESelection(ContentCache contentCache, IMENotification notification); /** * Notifies chrome of updating its content cache. * This is useful if content is modified but we don't need to notify IME. * * contentCache Cache of content */ prio(urgent) async UpdateContentCache(ContentCache contentCache); /** * Notifies IME of mouse button event on a character in focused editor. * * Returns true if the mouse button event is consumd by IME. */ prio(urgent) sync NotifyIMEMouseButtonEvent(IMENotification notification) returns (bool consumedByIME); /** * Notifies chrome to position change * * contentCache Cache of content */ prio(urgent) async NotifyIMEPositionChange(ContentCache contentCache, IMENotification notification); /** * Requests chrome to commit or cancel composition of IME. * * cancel Set true if composition should be cancelled. * * isCommitted Returns true if the request causes composition * being committed synchronously. * committedString Returns committed string. The may be non-empty * string even if cancel is true because IME may * try to restore selected string which was * replaced with the composition. */ prio(urgent) sync RequestIMEToCommitComposition(bool cancel) returns (bool isCommitted, nsString committedString); /** * OnEventNeedingAckHandled() is called after a child process dispatches a * composition event or a selection event which is sent from the parent * process. * * message The message value of the handled event. */ prio(urgent) async OnEventNeedingAckHandled(EventMessage message); /** * Tells chrome to start plugin IME. If this results in a string getting * committed, the result is in aCommitted (otherwise aCommitted is empty). * * aKeyboardEvent The event with which plugin IME is to be started * panelX and panelY Location in screen coordinates of the IME input panel * (should be just under the plugin) * aCommitted The string committed during IME -- otherwise empty */ prio(urgent) sync StartPluginIME(WidgetKeyboardEvent aKeyboardEvent, int32_t panelX, int32_t panelY) returns (nsString aCommitted); /** * Tells chrome (and specifically the appropriate widget) whether or not * a plugin (inside the widget) has the keyboard focus. Should be sent * when the keyboard focus changes too or from a plugin. * * aFocused Whether or not a plugin is focused */ prio(urgent) async SetPluginFocused(bool aFocused); /** * Request that the parent process move focus to the browser's frame. If * canRaise is true, the window can be raised if it is inactive. */ RequestFocus(bool canRaise); /** * Indicate, based on the current state, that some commands are enabled and * some are disabled. */ EnableDisableCommands(nsString action, nsCString[] enabledCommands, nsCString[] disabledCommands); prio(urgent) sync GetInputContext() returns (int32_t IMEEnabled, int32_t IMEOpen); prio(urgent) async SetInputContext(int32_t IMEEnabled, int32_t IMEOpen, nsString type, nsString inputmode, nsString actionHint, int32_t cause, int32_t focusChange); sync IsParentWindowMainWidgetVisible() returns (bool visible); /** * Gets the DPI of the screen corresponding to this browser. */ sync GetDPI() returns (float value); /** * Gets the default scaling factor of the screen corresponding to this browser. */ sync GetDefaultScale() returns (double value); /** * Gets maximum of touch points at current device. */ sync GetMaxTouchPoints() returns (uint32_t value); /** * Set the native cursor. * @param value * The widget cursor to set. * @param force * Invalidate any locally cached cursor settings and force an * update. */ SetCursor(uint32_t value, bool force); /** * Set the native cursor using a custom image. * @param cursorData * Serialized image data. * @param width * Width of the image. * @param height * Height of the image. * @param stride * Stride used in the image data. * @param format * Image format, see gfx::SurfaceFormat for possible values. * @param hotspotX * Horizontal hotspot of the image, as specified by the css cursor property. * @param hotspotY * Vertical hotspot of the image, as specified by the css cursor property. * @param force * Invalidate any locally cached cursor settings and force an * update. */ SetCustomCursor(nsCString cursorData, uint32_t width, uint32_t height, uint32_t stride, uint8_t format, uint32_t hotspotX, uint32_t hotspotY, bool force); /** * Used to set the current text of the status tooltip. * Nowadays this is mainly used for link locations on hover. */ SetStatus(uint32_t type, nsString status); /** * Show/hide a tooltip when the mouse hovers over an element in the content * document. */ ShowTooltip(uint32_t x, uint32_t y, nsString tooltip); HideTooltip(); /** * Create an asynchronous color picker on the parent side, * but don't open it yet. */ PColorPicker(nsString title, nsString initialColor); PFilePicker(nsString aTitle, int16_t aMode); PDatePicker(nsString aTitle); PTimePicker(nsString aTitle); /** * Initiates an asynchronous request for one of the special indexedDB * permissions for the provided principal. * * @param principal * The principal of the request. * * NOTE: The principal is untrusted in the parent process. Only * principals that can live in the content process should * provided. */ PIndexedDBPermissionRequest(Principal principal); /** * window.open from inside