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
4 : *
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/
9 : *
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
13 : * License.
14 : *
15 : * The Original Code is mozilla.org code.
16 : *
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.
21 : *
22 : * Contributor(s):
23 : *
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.
35 : *
36 : * ***** END LICENSE BLOCK ***** */
37 :
38 : #ifndef nsWidgetInitData_h__
39 : #define nsWidgetInitData_h__
40 :
41 : #include "prtypes.h"
42 :
43 : /**
44 : * Window types
45 : *
46 : * Don't alter previously encoded enum values - 3rd party apps may look at
47 : * these.
48 : */
49 : enum nsWindowType {
50 : eWindowType_toplevel, // default top level window
51 : eWindowType_dialog, // top level window but usually handled differently
52 : // by the OS
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_sheet // MacOSX sheet (special dialog class)
59 : };
60 :
61 : /**
62 : * Popup types
63 : *
64 : * For eWindowType_popup
65 : */
66 : enum nsPopupType {
67 : ePopupTypePanel,
68 : ePopupTypeMenu,
69 : ePopupTypeTooltip,
70 : ePopupTypeAny = 0xF000 // used only to pass to
71 : // nsXULPopupManager::GetTopPopup
72 : };
73 :
74 : /**
75 : * Popup levels specify the window ordering behaviour.
76 : */
77 : enum nsPopupLevel {
78 : // the popup appears just above its parent and maintains its position
79 : // relative to the parent
80 : ePopupLevelParent,
81 : // the popup is a floating popup used for tool palettes. A parent window
82 : // must be specified, but a platform implementation need not use this.
83 : // On Windows, floating is generally equivalent to parent. On Mac, floating
84 : // puts the popup at toplevel, but it will hide when the application is deactivated
85 : ePopupLevelFloating,
86 : // the popup appears on top of other windows, including those of other applications
87 : ePopupLevelTop
88 : };
89 :
90 : /**
91 : * Border styles
92 : */
93 : enum nsBorderStyle {
94 : eBorderStyle_none = 0, // no border, titlebar, etc.. opposite of
95 : // all
96 : eBorderStyle_all = 1 << 0, // all window decorations
97 : eBorderStyle_border = 1 << 1, // enables the border on the window. these
98 : // are only for decoration and are not
99 : // resize handles
100 : eBorderStyle_resizeh = 1 << 2, // enables the resize handles for the
101 : // window. if this is set, border is
102 : // implied to also be set
103 : eBorderStyle_title = 1 << 3, // enables the titlebar for the window
104 : eBorderStyle_menu = 1 << 4, // enables the window menu button on the
105 : // title bar. this being on should force
106 : // the title bar to display
107 : eBorderStyle_minimize = 1 << 5, // enables the minimize button so the user
108 : // can minimize the window. turned off for
109 : // tranient windows since they can not be
110 : // minimized separate from their parent
111 : eBorderStyle_maximize = 1 << 6, // enables the maxmize button so the user
112 : // can maximize the window
113 : eBorderStyle_close = 1 << 7, // show the close button
114 : eBorderStyle_default = -1 // whatever the OS wants... i.e. don't do
115 : // anything
116 : };
117 :
118 : /**
119 : * Basic struct for widget initialization data.
120 : * @see Create member function of nsIWidget
121 : */
122 :
123 : struct nsWidgetInitData {
124 0 : nsWidgetInitData() :
125 : mWindowType(eWindowType_child),
126 : mBorderStyle(eBorderStyle_default),
127 : mPopupHint(ePopupTypePanel),
128 : mPopupLevel(ePopupLevelTop),
129 : clipChildren(false),
130 : clipSiblings(false),
131 : mDropShadow(false),
132 : mListenForResizes(false),
133 : mUnicode(true),
134 : mRTL(false),
135 : mNoAutoHide(false),
136 : mIsDragPopup(false),
137 0 : mIsAnimationSuppressed(false)
138 : {
139 0 : }
140 :
141 : nsWindowType mWindowType;
142 : nsBorderStyle mBorderStyle;
143 : nsPopupType mPopupHint;
144 : nsPopupLevel mPopupLevel;
145 : // when painting exclude area occupied by child windows and sibling windows
146 : bool clipChildren, clipSiblings, mDropShadow;
147 : bool mListenForResizes;
148 : bool mUnicode;
149 : bool mRTL;
150 : bool mNoAutoHide; // true for noautohide panels
151 : bool mIsDragPopup; // true for drag feedback panels
152 : bool mIsAnimationSuppressed; // true if window creation animation is
153 : // suppressed, e.g. for session restore
154 : };
155 :
156 : #endif // nsWidgetInitData_h__
|