Thu, 15 Jan 2015 21:03:48 +0100
Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)
michael@0 | 1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- |
michael@0 | 2 | * |
michael@0 | 3 | * This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 4 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 5 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 6 | |
michael@0 | 7 | #include "nsISupports.idl" |
michael@0 | 8 | |
michael@0 | 9 | /* THIS IS A PUBLIC EMBEDDING API */ |
michael@0 | 10 | |
michael@0 | 11 | /** |
michael@0 | 12 | * The nsIEmbeddingSiteWindow is implemented by the embedder to provide |
michael@0 | 13 | * Gecko with the means to call up to the host to resize the window, |
michael@0 | 14 | * hide or show it and set/get its title. |
michael@0 | 15 | */ |
michael@0 | 16 | [scriptable, uuid(0b976267-4aaa-4f36-a2d4-27b5ca8d73bb)] |
michael@0 | 17 | interface nsIEmbeddingSiteWindow : nsISupports |
michael@0 | 18 | { |
michael@0 | 19 | /** |
michael@0 | 20 | * Flag indicates that position of the top left corner of the outer area |
michael@0 | 21 | * is required/specified. |
michael@0 | 22 | * |
michael@0 | 23 | * @see setDimensions |
michael@0 | 24 | * @see getDimensions |
michael@0 | 25 | */ |
michael@0 | 26 | const unsigned long DIM_FLAGS_POSITION = 1; |
michael@0 | 27 | |
michael@0 | 28 | /** |
michael@0 | 29 | * Flag indicates that the size of the inner area is required/specified. |
michael@0 | 30 | * |
michael@0 | 31 | * @note The inner and outer flags are mutually exclusive and it is |
michael@0 | 32 | * invalid to combine them. |
michael@0 | 33 | * |
michael@0 | 34 | * @see setDimensions |
michael@0 | 35 | * @see getDimensions |
michael@0 | 36 | * @see DIM_FLAGS_SIZE_OUTER |
michael@0 | 37 | */ |
michael@0 | 38 | const unsigned long DIM_FLAGS_SIZE_INNER = 2; |
michael@0 | 39 | |
michael@0 | 40 | /** |
michael@0 | 41 | * Flag indicates that the size of the outer area is required/specified. |
michael@0 | 42 | * |
michael@0 | 43 | * @see setDimensions |
michael@0 | 44 | * @see getDimensions |
michael@0 | 45 | * @see DIM_FLAGS_SIZE_INNER |
michael@0 | 46 | */ |
michael@0 | 47 | const unsigned long DIM_FLAGS_SIZE_OUTER = 4; |
michael@0 | 48 | |
michael@0 | 49 | /** |
michael@0 | 50 | * Sets the dimensions for the window; the position & size. The |
michael@0 | 51 | * flags to indicate what the caller wants to set and whether the size |
michael@0 | 52 | * refers to the inner or outer area. The inner area refers to just |
michael@0 | 53 | * the embedded area, wheras the outer area can also include any |
michael@0 | 54 | * surrounding chrome, window frame, title bar, and so on. |
michael@0 | 55 | * |
michael@0 | 56 | * @param flags Combination of position, inner and outer size flags. |
michael@0 | 57 | * @param x Left hand corner of the outer area. |
michael@0 | 58 | * @param y Top corner of the outer area. |
michael@0 | 59 | * @param cx Width of the inner or outer area. |
michael@0 | 60 | * @param cy Height of the inner or outer area. |
michael@0 | 61 | * |
michael@0 | 62 | * @return <code>NS_OK</code> if operation was performed correctly; |
michael@0 | 63 | * <code>NS_ERROR_UNEXPECTED</code> if window could not be |
michael@0 | 64 | * destroyed; |
michael@0 | 65 | * <code>NS_ERROR_INVALID_ARG</code> for bad flag combination |
michael@0 | 66 | * or illegal dimensions. |
michael@0 | 67 | * |
michael@0 | 68 | * @see getDimensions |
michael@0 | 69 | * @see DIM_FLAGS_POSITION |
michael@0 | 70 | * @see DIM_FLAGS_SIZE_OUTER |
michael@0 | 71 | * @see DIM_FLAGS_SIZE_INNER |
michael@0 | 72 | */ |
michael@0 | 73 | void setDimensions(in unsigned long flags, in long x, in long y, in long cx, in long cy); |
michael@0 | 74 | |
michael@0 | 75 | /** |
michael@0 | 76 | * Gets the dimensions of the window. The caller may pass |
michael@0 | 77 | * <CODE>nullptr</CODE> for any value it is uninterested in receiving. |
michael@0 | 78 | * |
michael@0 | 79 | * @param flags Combination of position, inner and outer size flag . |
michael@0 | 80 | * @param x Left hand corner of the outer area; or <CODE>nullptr</CODE>. |
michael@0 | 81 | * @param y Top corner of the outer area; or <CODE>nullptr</CODE>. |
michael@0 | 82 | * @param cx Width of the inner or outer area; or <CODE>nullptr</CODE>. |
michael@0 | 83 | * @param cy Height of the inner or outer area; or <CODE>nullptr</CODE>. |
michael@0 | 84 | * |
michael@0 | 85 | * @see setDimensions |
michael@0 | 86 | * @see DIM_FLAGS_POSITION |
michael@0 | 87 | * @see DIM_FLAGS_SIZE_OUTER |
michael@0 | 88 | * @see DIM_FLAGS_SIZE_INNER |
michael@0 | 89 | */ |
michael@0 | 90 | void getDimensions(in unsigned long flags, out long x, out long y, out long cx, out long cy); |
michael@0 | 91 | |
michael@0 | 92 | /** |
michael@0 | 93 | * Give the window focus. |
michael@0 | 94 | */ |
michael@0 | 95 | void setFocus(); |
michael@0 | 96 | |
michael@0 | 97 | /** |
michael@0 | 98 | * Visibility of the window. |
michael@0 | 99 | */ |
michael@0 | 100 | attribute boolean visibility; |
michael@0 | 101 | |
michael@0 | 102 | /** |
michael@0 | 103 | * Title of the window. |
michael@0 | 104 | */ |
michael@0 | 105 | attribute wstring title; |
michael@0 | 106 | |
michael@0 | 107 | /** |
michael@0 | 108 | * Native window for the site's window. The implementor should copy the |
michael@0 | 109 | * native window object into the address supplied by the caller. The |
michael@0 | 110 | * type of the native window that the address refers to is platform |
michael@0 | 111 | * and OS specific as follows: |
michael@0 | 112 | * |
michael@0 | 113 | * <ul> |
michael@0 | 114 | * <li>On Win32 it is an <CODE>HWND</CODE>.</li> |
michael@0 | 115 | * <li>On MacOS this is a <CODE>WindowPtr</CODE>.</li> |
michael@0 | 116 | * <li>On GTK this is a <CODE>GtkWidget*</CODE>.</li> |
michael@0 | 117 | * </ul> |
michael@0 | 118 | */ |
michael@0 | 119 | [noscript] readonly attribute voidPtr siteWindow; |
michael@0 | 120 | |
michael@0 | 121 | /** |
michael@0 | 122 | * Blur the window. This should unfocus the window and send an onblur event. |
michael@0 | 123 | */ |
michael@0 | 124 | void blur(); |
michael@0 | 125 | }; |