embedding/browser/webBrowser/nsIEmbeddingSiteWindow.idl

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

mercurial