1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/embedding/browser/webBrowser/nsIEmbeddingSiteWindow.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,125 @@ 1.4 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- 1.5 + * 1.6 + * This Source Code Form is subject to the terms of the Mozilla Public 1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.9 + 1.10 +#include "nsISupports.idl" 1.11 + 1.12 +/* THIS IS A PUBLIC EMBEDDING API */ 1.13 + 1.14 +/** 1.15 + * The nsIEmbeddingSiteWindow is implemented by the embedder to provide 1.16 + * Gecko with the means to call up to the host to resize the window, 1.17 + * hide or show it and set/get its title. 1.18 + */ 1.19 +[scriptable, uuid(0b976267-4aaa-4f36-a2d4-27b5ca8d73bb)] 1.20 +interface nsIEmbeddingSiteWindow : nsISupports 1.21 +{ 1.22 + /** 1.23 + * Flag indicates that position of the top left corner of the outer area 1.24 + * is required/specified. 1.25 + * 1.26 + * @see setDimensions 1.27 + * @see getDimensions 1.28 + */ 1.29 + const unsigned long DIM_FLAGS_POSITION = 1; 1.30 + 1.31 + /** 1.32 + * Flag indicates that the size of the inner area is required/specified. 1.33 + * 1.34 + * @note The inner and outer flags are mutually exclusive and it is 1.35 + * invalid to combine them. 1.36 + * 1.37 + * @see setDimensions 1.38 + * @see getDimensions 1.39 + * @see DIM_FLAGS_SIZE_OUTER 1.40 + */ 1.41 + const unsigned long DIM_FLAGS_SIZE_INNER = 2; 1.42 + 1.43 + /** 1.44 + * Flag indicates that the size of the outer area is required/specified. 1.45 + * 1.46 + * @see setDimensions 1.47 + * @see getDimensions 1.48 + * @see DIM_FLAGS_SIZE_INNER 1.49 + */ 1.50 + const unsigned long DIM_FLAGS_SIZE_OUTER = 4; 1.51 + 1.52 + /** 1.53 + * Sets the dimensions for the window; the position & size. The 1.54 + * flags to indicate what the caller wants to set and whether the size 1.55 + * refers to the inner or outer area. The inner area refers to just 1.56 + * the embedded area, wheras the outer area can also include any 1.57 + * surrounding chrome, window frame, title bar, and so on. 1.58 + * 1.59 + * @param flags Combination of position, inner and outer size flags. 1.60 + * @param x Left hand corner of the outer area. 1.61 + * @param y Top corner of the outer area. 1.62 + * @param cx Width of the inner or outer area. 1.63 + * @param cy Height of the inner or outer area. 1.64 + * 1.65 + * @return <code>NS_OK</code> if operation was performed correctly; 1.66 + * <code>NS_ERROR_UNEXPECTED</code> if window could not be 1.67 + * destroyed; 1.68 + * <code>NS_ERROR_INVALID_ARG</code> for bad flag combination 1.69 + * or illegal dimensions. 1.70 + * 1.71 + * @see getDimensions 1.72 + * @see DIM_FLAGS_POSITION 1.73 + * @see DIM_FLAGS_SIZE_OUTER 1.74 + * @see DIM_FLAGS_SIZE_INNER 1.75 + */ 1.76 + void setDimensions(in unsigned long flags, in long x, in long y, in long cx, in long cy); 1.77 + 1.78 + /** 1.79 + * Gets the dimensions of the window. The caller may pass 1.80 + * <CODE>nullptr</CODE> for any value it is uninterested in receiving. 1.81 + * 1.82 + * @param flags Combination of position, inner and outer size flag . 1.83 + * @param x Left hand corner of the outer area; or <CODE>nullptr</CODE>. 1.84 + * @param y Top corner of the outer area; or <CODE>nullptr</CODE>. 1.85 + * @param cx Width of the inner or outer area; or <CODE>nullptr</CODE>. 1.86 + * @param cy Height of the inner or outer area; or <CODE>nullptr</CODE>. 1.87 + * 1.88 + * @see setDimensions 1.89 + * @see DIM_FLAGS_POSITION 1.90 + * @see DIM_FLAGS_SIZE_OUTER 1.91 + * @see DIM_FLAGS_SIZE_INNER 1.92 + */ 1.93 + void getDimensions(in unsigned long flags, out long x, out long y, out long cx, out long cy); 1.94 + 1.95 + /** 1.96 + * Give the window focus. 1.97 + */ 1.98 + void setFocus(); 1.99 + 1.100 + /** 1.101 + * Visibility of the window. 1.102 + */ 1.103 + attribute boolean visibility; 1.104 + 1.105 + /** 1.106 + * Title of the window. 1.107 + */ 1.108 + attribute wstring title; 1.109 + 1.110 + /** 1.111 + * Native window for the site's window. The implementor should copy the 1.112 + * native window object into the address supplied by the caller. The 1.113 + * type of the native window that the address refers to is platform 1.114 + * and OS specific as follows: 1.115 + * 1.116 + * <ul> 1.117 + * <li>On Win32 it is an <CODE>HWND</CODE>.</li> 1.118 + * <li>On MacOS this is a <CODE>WindowPtr</CODE>.</li> 1.119 + * <li>On GTK this is a <CODE>GtkWidget*</CODE>.</li> 1.120 + * </ul> 1.121 + */ 1.122 + [noscript] readonly attribute voidPtr siteWindow; 1.123 + 1.124 + /** 1.125 + * Blur the window. This should unfocus the window and send an onblur event. 1.126 + */ 1.127 + void blur(); 1.128 +};