1 /* -*- Mode: C++; tab-width: 40; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
15 * The Original Code is mozilla.org code.
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 1998
20 * the Initial Developer. All Rights Reserved.
24 * Alternatively, the contents of this file may be used under the terms of
25 * either the GNU General Public License Version 2 or later (the "GPL"), or
26 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 * in which case the provisions of the GPL or the LGPL are applicable instead
28 * of those above. If you wish to allow use of your version of this file only
29 * under the terms of either the GPL or the LGPL, and not to allow others to
30 * use your version of this file under the terms of the MPL, indicate your
31 * decision by deleting the provisions above and replace them with the notice
32 * and other provisions required by the GPL or the LGPL. If you do not delete
33 * the provisions above, a recipient may use your version of this file under
34 * the terms of any one of the MPL, the GPL or the LGPL.
36 * ***** END LICENSE BLOCK ***** */
38 #ifndef nsWidgetInitData_h__
39 #define nsWidgetInitData_h__
46 * Don't alter previously encoded enum values - 3rd party apps may look at
50 eWindowType_toplevel
, // default top level window
51 eWindowType_dialog
, // top level window but usually handled differently
53 eWindowType_popup
, // used for combo boxes, etc
54 eWindowType_child
, // child windows (contained inside a window on the
55 // desktop (has no border))
56 eWindowType_invisible
, // windows that are invisible or offscreen
57 eWindowType_plugin
, // plugin window
58 eWindowType_java
, // java plugin window
59 eWindowType_sheet
// MacOSX sheet (special dialog class)
65 * For eWindowType_popup
71 ePopupTypeAny
= 0xF000 // used only to pass to
72 // nsXULPopupManager::GetTopPopup
79 eBorderStyle_none
= 0, // no border, titlebar, etc.. opposite of
81 eBorderStyle_all
= 1 << 0, // all window decorations
82 eBorderStyle_border
= 1 << 1, // enables the border on the window. these
83 // are only for decoration and are not
85 eBorderStyle_resizeh
= 1 << 2, // enables the resize handles for the
86 // window. if this is set, border is
87 // implied to also be set
88 eBorderStyle_title
= 1 << 3, // enables the titlebar for the window
89 eBorderStyle_menu
= 1 << 4, // enables the window menu button on the
90 // title bar. this being on should force
91 // the title bar to display
92 eBorderStyle_minimize
= 1 << 5, // enables the minimize button so the user
93 // can minimize the window. turned off for
94 // tranient windows since they can not be
95 // minimized separate from their parent
96 eBorderStyle_maximize
= 1 << 6, // enables the maxmize button so the user
97 // can maximize the window
98 eBorderStyle_close
= 1 << 7, // show the close button
99 eBorderStyle_default
= -1 // whatever the OS wants... i.e. don't do
106 * Exposed so screen readers know what's UI
109 eContentTypeInherit
= -1,
111 eContentTypeContent
= 1,
112 eContentTypeContentFrame
= 2
116 * Basic struct for widget initialization data.
117 * @see Create member function of nsIWidget
120 struct nsWidgetInitData
{
122 mWindowType(eWindowType_child
),
123 mBorderStyle(eBorderStyle_default
),
124 mContentType(eContentTypeInherit
),
125 mPopupHint(ePopupTypePanel
),
126 clipChildren(PR_FALSE
),
127 clipSiblings(PR_FALSE
),
128 mDropShadow(PR_FALSE
),
129 mListenForResizes(PR_FALSE
),
134 nsWindowType mWindowType
;
135 nsBorderStyle mBorderStyle
;
136 nsContentType mContentType
; // Exposed so screen readers know what's UI
137 nsPopupType mPopupHint
;
138 // when painting exclude area occupied by child windows and sibling windows
139 PRPackedBool clipChildren
, clipSiblings
, mDropShadow
;
140 PRPackedBool mListenForResizes
;
141 PRPackedBool mUnicode
;
144 #endif // nsWidgetInitData_h__