2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/MPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
|
|
|
*
|
|
|
|
* The Original Code is Mozilla Communicator client code.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is
|
|
|
|
* Netscape Communications Corporation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 1998
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
|
|
|
* Johnny Stenback <jst@netscape.com> (original author)
|
|
|
|
* Brian Ryner <bryner@brianryner.com>
|
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
|
|
|
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
|
|
|
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
|
|
|
interface nsIDocShell;
|
|
|
|
interface nsIURI;
|
2009-10-05 04:52:19 -07:00
|
|
|
interface nsIFrame;
|
2010-02-20 09:05:20 -08:00
|
|
|
interface nsIChromeFrameMessageManager;
|
2009-11-06 12:43:39 -08:00
|
|
|
interface nsIVariant;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2011-01-13 09:45:14 -08:00
|
|
|
typedef unsigned long long nsContentViewId;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* These interfaces do *not* scroll or scale the content document;
|
|
|
|
* instead they set a "goal" scroll/scale wrt the current content
|
|
|
|
* view. When the content document is painted, the scroll*
|
|
|
|
* attributes are used to set a compensating transform. If the
|
|
|
|
* metrics of the content document's current pixels don't match the
|
|
|
|
* view config, the transform matrix may need to translate
|
|
|
|
* content pixels and/or perform a "fuzzy-scale" that doesn't
|
|
|
|
* re-rasterize fonts or intelligently resample images.
|
|
|
|
*
|
|
|
|
* The attrs are allowed to transform content pixels in
|
|
|
|
* such a way that the <browser>'s visible rect encloses pixels that
|
|
|
|
* the content document does not (yet) define.
|
|
|
|
*
|
|
|
|
* The view scroll values are in units of chrome-document CSS
|
|
|
|
* pixels.
|
|
|
|
*
|
|
|
|
* These APIs are designed to be used with nsIDOMWindowUtils
|
|
|
|
* setDisplayPort() and setResolution().
|
|
|
|
*/
|
|
|
|
[scriptable, uuid(fbd25468-d2cf-487b-bc58-a0e105398b47)]
|
|
|
|
interface nsIContentView : nsISupports
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Scroll view to or by the given chrome-document CSS pixels.
|
|
|
|
* Fails if the view is no longer valid.
|
|
|
|
*/
|
|
|
|
void scrollTo(in float xPx, in float yPx);
|
|
|
|
void scrollBy(in float dxPx, in float dyPx);
|
|
|
|
|
|
|
|
void setScale(in float xScale, in float yScale);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Scroll offset in chrome-document CSS pixels.
|
|
|
|
*
|
|
|
|
* When this view is active (i.e. it is being painted because it's in the
|
|
|
|
* visible region of the screen), this value is at first lined up with the
|
|
|
|
* content's scroll offset.
|
|
|
|
*
|
|
|
|
* Note that when this view becomes inactive, the new content view will have
|
|
|
|
* scroll values that are reset to the default!
|
|
|
|
*/
|
|
|
|
readonly attribute float scrollX;
|
|
|
|
readonly attribute float scrollY;
|
|
|
|
|
2011-01-13 09:45:14 -08:00
|
|
|
/**
|
|
|
|
* Dimensions of the viewport in chrome-document CSS pixels.
|
|
|
|
*/
|
|
|
|
readonly attribute float viewportWidth;
|
|
|
|
readonly attribute float viewportHeight;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Dimensions of scrolled content in chrome-document CSS pixels.
|
|
|
|
*/
|
|
|
|
readonly attribute float contentWidth;
|
|
|
|
readonly attribute float contentHeight;
|
|
|
|
|
2011-01-13 09:45:14 -08:00
|
|
|
/**
|
|
|
|
* ID that can be used in conjunction with nsIDOMWindowUtils to change
|
|
|
|
* the actual document, instead of just how it is transformed.
|
|
|
|
*/
|
|
|
|
readonly attribute nsContentViewId id;
|
|
|
|
};
|
|
|
|
|
|
|
|
[scriptable, uuid(ba5af90d-ece5-40b2-9a1d-a0154128db1c)]
|
|
|
|
interface nsIContentViewManager : nsISupports
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Retrieve view scrolling/scaling interfaces in a given area,
|
|
|
|
* used to support asynchronous re-paints of content pixels.
|
|
|
|
* These interfaces are only meaningful for <browser>.
|
|
|
|
*
|
|
|
|
* Pixels are in chrome device pixels and are relative to the browser
|
|
|
|
* element.
|
|
|
|
*
|
|
|
|
* @param aX x coordinate that will be in target rectangle
|
|
|
|
* @param aY y coordinate that will be in target rectangle
|
|
|
|
* @param aTopSize How much to expand up the rectangle
|
|
|
|
* @param aRightSize How much to expand right the rectangle
|
|
|
|
* @param aBottomSize How much to expand down the rectangle
|
|
|
|
* @param aLeftSize How much to expand left the rectangle
|
|
|
|
*/
|
|
|
|
void getContentViewsIn(in float aXPx, in float aYPx,
|
|
|
|
in float aTopSize, in float aRightSize,
|
|
|
|
in float aBottomSize, in float aLeftSize,
|
|
|
|
[optional] out unsigned long aLength,
|
|
|
|
[retval, array, size_is(aLength)] out nsIContentView aResult);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The root content view.
|
|
|
|
*/
|
|
|
|
readonly attribute nsIContentView rootContentView;
|
|
|
|
};
|
|
|
|
|
2011-06-17 17:08:32 -07:00
|
|
|
[scriptable, uuid(12905a29-4246-475a-81d4-fc389197df02)]
|
2007-03-22 10:30:00 -07:00
|
|
|
interface nsIFrameLoader : nsISupports
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Get the docshell from the frame loader.
|
|
|
|
*/
|
|
|
|
readonly attribute nsIDocShell docShell;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Start loading the frame. This method figures out what to load
|
|
|
|
* from the owner content in the frame loader.
|
|
|
|
*/
|
|
|
|
void loadFrame();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Loads the specified URI in this frame. Behaves identically to loadFrame,
|
|
|
|
* except that this method allows specifying the URI to load.
|
|
|
|
*/
|
|
|
|
void loadURI(in nsIURI aURI);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Destroy the frame loader and everything inside it. This will
|
|
|
|
* clear the weak owner content reference.
|
|
|
|
*/
|
|
|
|
void destroy();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Find out whether the loader's frame is at too great a depth in
|
|
|
|
* the frame tree. This can be used to decide what operations may
|
|
|
|
* or may not be allowed on the loader's docshell.
|
|
|
|
*/
|
|
|
|
readonly attribute boolean depthTooGreat;
|
2009-10-05 04:52:19 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Updates the position and size of the subdocument loaded by this frameloader.
|
|
|
|
*
|
|
|
|
* @param aIFrame The nsIFrame for the content node that owns this frameloader
|
|
|
|
*/
|
|
|
|
[noscript] void updatePositionAndSize(in nsIFrame aIFrame);
|
2009-11-05 10:14:22 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Activate remote frame.
|
|
|
|
* Throws an exception with non-remote frames.
|
|
|
|
*/
|
|
|
|
void activateRemoteFrame();
|
2009-11-05 10:21:09 -08:00
|
|
|
|
2011-06-17 17:08:32 -07:00
|
|
|
/**
|
|
|
|
* Deactivate remote frame.
|
|
|
|
* Throws an exception with non-remote frames.
|
|
|
|
*/
|
|
|
|
void deactivateRemoteFrame();
|
|
|
|
|
2009-11-05 10:21:09 -08:00
|
|
|
/**
|
|
|
|
* @see nsIDOMWindowUtils sendMouseEvent.
|
|
|
|
*/
|
|
|
|
void sendCrossProcessMouseEvent(in AString aType,
|
|
|
|
in float aX,
|
|
|
|
in float aY,
|
|
|
|
in long aButton,
|
|
|
|
in long aClickCount,
|
|
|
|
in long aModifiers,
|
|
|
|
[optional] in boolean aIgnoreRootScrollFrame);
|
|
|
|
|
2009-11-17 06:22:23 -08:00
|
|
|
/**
|
|
|
|
* Activate event forwarding from client (remote frame) to parent.
|
|
|
|
*/
|
|
|
|
void activateFrameEvent(in AString aType, in boolean capture);
|
2010-02-20 09:05:20 -08:00
|
|
|
|
2010-05-18 05:28:37 -07:00
|
|
|
// Note, when frameloaders are swapped, also messageManagers are swapped.
|
2010-02-20 09:05:20 -08:00
|
|
|
readonly attribute nsIChromeFrameMessageManager messageManager;
|
2010-03-18 23:52:18 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @see nsIDOMWindowUtils sendKeyEvent.
|
|
|
|
*/
|
|
|
|
void sendCrossProcessKeyEvent(in AString aType,
|
|
|
|
in long aKeyCode,
|
|
|
|
in long aCharCode,
|
|
|
|
in long aModifiers,
|
|
|
|
[optional] in boolean aPreventDefault);
|
|
|
|
|
2010-05-17 04:25:22 -07:00
|
|
|
attribute boolean delayRemoteDialogs;
|
|
|
|
|
2011-03-25 08:03:35 -07:00
|
|
|
/**
|
|
|
|
* The default rendering mode is synchronous scrolling. In this
|
|
|
|
* mode, it's an error to try to set a target viewport.
|
|
|
|
*/
|
|
|
|
const unsigned long RENDER_MODE_DEFAULT = 0x00000000;
|
2011-01-13 09:45:14 -08:00
|
|
|
|
2010-09-03 13:10:46 -07:00
|
|
|
/**
|
2011-03-25 08:03:35 -07:00
|
|
|
* When asynchronous scrolling is enabled, a target viewport can be
|
|
|
|
* set to transform content pixels wrt its CSS viewport.
|
|
|
|
*
|
|
|
|
* NB: when async scrolling is enabled, it's the *user's*
|
|
|
|
* responsibility to update the target scroll offset. In effect,
|
|
|
|
* the platform hands over control of scroll offset to the user.
|
2010-09-03 13:10:46 -07:00
|
|
|
*/
|
2011-03-25 08:03:35 -07:00
|
|
|
const unsigned long RENDER_MODE_ASYNC_SCROLL = 0x00000001;
|
|
|
|
|
|
|
|
attribute unsigned long renderMode;
|
2011-06-21 17:32:43 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The default event mode automatically forwards the events
|
|
|
|
* handled in nsEventStateManager::HandleCrossProcessEvent to
|
|
|
|
* the child content process when these events are targeted to
|
|
|
|
* the remote browser element.
|
|
|
|
*
|
|
|
|
* Used primarly for input events (mouse, keyboard)
|
|
|
|
*/
|
|
|
|
const unsigned long EVENT_MODE_NORMAL_DISPATCH = 0x00000000;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* With this event mode, it's the application's responsability to
|
|
|
|
* convert and forward events to the content process
|
|
|
|
*/
|
|
|
|
const unsigned long EVENT_MODE_DONT_FORWARD_TO_CHILD = 0x00000001;
|
|
|
|
|
|
|
|
attribute unsigned long eventMode;
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
|
|
|
|
2009-10-20 14:33:59 -07:00
|
|
|
native alreadyAddRefed_nsFrameLoader(already_AddRefed<nsFrameLoader>);
|
|
|
|
|
2009-11-06 12:43:39 -08:00
|
|
|
[scriptable, uuid(5879040e-83e9-40e3-b2bb-5ddf43b76e47)]
|
2007-03-22 10:30:00 -07:00
|
|
|
interface nsIFrameLoaderOwner : nsISupports
|
|
|
|
{
|
2008-08-07 16:15:40 -07:00
|
|
|
/**
|
|
|
|
* The frame loader owned by this nsIFrameLoaderOwner
|
|
|
|
*/
|
2007-03-22 10:30:00 -07:00
|
|
|
readonly attribute nsIFrameLoader frameLoader;
|
2009-10-20 14:33:59 -07:00
|
|
|
[noscript, notxpcom] alreadyAddRefed_nsFrameLoader GetFrameLoader();
|
2008-08-07 16:15:40 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Swap frame loaders with the given nsIFrameLoaderOwner. This may
|
|
|
|
* only be posible in a very limited range of circumstances, or
|
|
|
|
* never, depending on the object implementing this interface.
|
|
|
|
*
|
|
|
|
* @throws NS_ERROR_NOT_IMPLEMENTED if the swapping logic is not
|
|
|
|
* implemented for the two given frame loader owners.
|
|
|
|
* @throws NS_ERROR_DOM_SECURITY_ERR if the swap is not allowed on
|
|
|
|
* security grounds.
|
|
|
|
*/
|
|
|
|
void swapFrameLoaders(in nsIFrameLoaderOwner aOtherOwner);
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|