michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- michael@0: * michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: michael@0: /* THIS IS A PUBLIC EMBEDDING API */ michael@0: michael@0: /** michael@0: * The nsIEmbeddingSiteWindow is implemented by the embedder to provide michael@0: * Gecko with the means to call up to the host to resize the window, michael@0: * hide or show it and set/get its title. michael@0: */ michael@0: [scriptable, uuid(0b976267-4aaa-4f36-a2d4-27b5ca8d73bb)] michael@0: interface nsIEmbeddingSiteWindow : nsISupports michael@0: { michael@0: /** michael@0: * Flag indicates that position of the top left corner of the outer area michael@0: * is required/specified. michael@0: * michael@0: * @see setDimensions michael@0: * @see getDimensions michael@0: */ michael@0: const unsigned long DIM_FLAGS_POSITION = 1; michael@0: michael@0: /** michael@0: * Flag indicates that the size of the inner area is required/specified. michael@0: * michael@0: * @note The inner and outer flags are mutually exclusive and it is michael@0: * invalid to combine them. michael@0: * michael@0: * @see setDimensions michael@0: * @see getDimensions michael@0: * @see DIM_FLAGS_SIZE_OUTER michael@0: */ michael@0: const unsigned long DIM_FLAGS_SIZE_INNER = 2; michael@0: michael@0: /** michael@0: * Flag indicates that the size of the outer area is required/specified. michael@0: * michael@0: * @see setDimensions michael@0: * @see getDimensions michael@0: * @see DIM_FLAGS_SIZE_INNER michael@0: */ michael@0: const unsigned long DIM_FLAGS_SIZE_OUTER = 4; michael@0: michael@0: /** michael@0: * Sets the dimensions for the window; the position & size. The michael@0: * flags to indicate what the caller wants to set and whether the size michael@0: * refers to the inner or outer area. The inner area refers to just michael@0: * the embedded area, wheras the outer area can also include any michael@0: * surrounding chrome, window frame, title bar, and so on. michael@0: * michael@0: * @param flags Combination of position, inner and outer size flags. michael@0: * @param x Left hand corner of the outer area. michael@0: * @param y Top corner of the outer area. michael@0: * @param cx Width of the inner or outer area. michael@0: * @param cy Height of the inner or outer area. michael@0: * michael@0: * @return NS_OK if operation was performed correctly; michael@0: * NS_ERROR_UNEXPECTED if window could not be michael@0: * destroyed; michael@0: * NS_ERROR_INVALID_ARG for bad flag combination michael@0: * or illegal dimensions. michael@0: * michael@0: * @see getDimensions michael@0: * @see DIM_FLAGS_POSITION michael@0: * @see DIM_FLAGS_SIZE_OUTER michael@0: * @see DIM_FLAGS_SIZE_INNER michael@0: */ michael@0: void setDimensions(in unsigned long flags, in long x, in long y, in long cx, in long cy); michael@0: michael@0: /** michael@0: * Gets the dimensions of the window. The caller may pass michael@0: * nullptr for any value it is uninterested in receiving. michael@0: * michael@0: * @param flags Combination of position, inner and outer size flag . michael@0: * @param x Left hand corner of the outer area; or nullptr. michael@0: * @param y Top corner of the outer area; or nullptr. michael@0: * @param cx Width of the inner or outer area; or nullptr. michael@0: * @param cy Height of the inner or outer area; or nullptr. michael@0: * michael@0: * @see setDimensions michael@0: * @see DIM_FLAGS_POSITION michael@0: * @see DIM_FLAGS_SIZE_OUTER michael@0: * @see DIM_FLAGS_SIZE_INNER michael@0: */ michael@0: void getDimensions(in unsigned long flags, out long x, out long y, out long cx, out long cy); michael@0: michael@0: /** michael@0: * Give the window focus. michael@0: */ michael@0: void setFocus(); michael@0: michael@0: /** michael@0: * Visibility of the window. michael@0: */ michael@0: attribute boolean visibility; michael@0: michael@0: /** michael@0: * Title of the window. michael@0: */ michael@0: attribute wstring title; michael@0: michael@0: /** michael@0: * Native window for the site's window. The implementor should copy the michael@0: * native window object into the address supplied by the caller. The michael@0: * type of the native window that the address refers to is platform michael@0: * and OS specific as follows: michael@0: * michael@0: * michael@0: */ michael@0: [noscript] readonly attribute voidPtr siteWindow; michael@0: michael@0: /** michael@0: * Blur the window. This should unfocus the window and send an onblur event. michael@0: */ michael@0: void blur(); michael@0: };