michael@0: /* -*- Mode: C++; tab-width: 40; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef nsWidgetInitData_h__ michael@0: #define nsWidgetInitData_h__ michael@0: michael@0: /** michael@0: * Window types michael@0: * michael@0: * Don't alter previously encoded enum values - 3rd party apps may look at michael@0: * these. michael@0: */ michael@0: enum nsWindowType { michael@0: eWindowType_toplevel, // default top level window michael@0: eWindowType_dialog, // top level window but usually handled differently michael@0: // by the OS michael@0: eWindowType_popup, // used for combo boxes, etc michael@0: eWindowType_child, // child windows (contained inside a window on the michael@0: // desktop (has no border)) michael@0: eWindowType_invisible, // windows that are invisible or offscreen michael@0: eWindowType_plugin, // plugin window michael@0: eWindowType_sheet // MacOSX sheet (special dialog class) michael@0: }; michael@0: michael@0: /** michael@0: * Popup types michael@0: * michael@0: * For eWindowType_popup michael@0: */ michael@0: enum nsPopupType { michael@0: ePopupTypePanel, michael@0: ePopupTypeMenu, michael@0: ePopupTypeTooltip, michael@0: ePopupTypeAny = 0xF000 // used only to pass to michael@0: // nsXULPopupManager::GetTopPopup michael@0: }; michael@0: michael@0: /** michael@0: * Popup levels specify the window ordering behaviour. michael@0: */ michael@0: enum nsPopupLevel { michael@0: // the popup appears just above its parent and maintains its position michael@0: // relative to the parent michael@0: ePopupLevelParent, michael@0: // the popup is a floating popup used for tool palettes. A parent window michael@0: // must be specified, but a platform implementation need not use this. michael@0: // On Windows, floating is generally equivalent to parent. On Mac, floating michael@0: // puts the popup at toplevel, but it will hide when the application is deactivated michael@0: ePopupLevelFloating, michael@0: // the popup appears on top of other windows, including those of other applications michael@0: ePopupLevelTop michael@0: }; michael@0: michael@0: /** michael@0: * Border styles michael@0: */ michael@0: enum nsBorderStyle { michael@0: eBorderStyle_none = 0, // no border, titlebar, etc.. opposite of michael@0: // all michael@0: eBorderStyle_all = 1 << 0, // all window decorations michael@0: eBorderStyle_border = 1 << 1, // enables the border on the window. these michael@0: // are only for decoration and are not michael@0: // resize handles michael@0: eBorderStyle_resizeh = 1 << 2, // enables the resize handles for the michael@0: // window. if this is set, border is michael@0: // implied to also be set michael@0: eBorderStyle_title = 1 << 3, // enables the titlebar for the window michael@0: eBorderStyle_menu = 1 << 4, // enables the window menu button on the michael@0: // title bar. this being on should force michael@0: // the title bar to display michael@0: eBorderStyle_minimize = 1 << 5, // enables the minimize button so the user michael@0: // can minimize the window. turned off for michael@0: // tranient windows since they can not be michael@0: // minimized separate from their parent michael@0: eBorderStyle_maximize = 1 << 6, // enables the maxmize button so the user michael@0: // can maximize the window michael@0: eBorderStyle_close = 1 << 7, // show the close button michael@0: eBorderStyle_default = -1 // whatever the OS wants... i.e. don't do michael@0: // anything michael@0: }; michael@0: michael@0: /** michael@0: * Basic struct for widget initialization data. michael@0: * @see Create member function of nsIWidget michael@0: */ michael@0: michael@0: struct nsWidgetInitData { michael@0: nsWidgetInitData() : michael@0: mWindowType(eWindowType_child), michael@0: mBorderStyle(eBorderStyle_default), michael@0: mPopupHint(ePopupTypePanel), michael@0: mPopupLevel(ePopupLevelTop), michael@0: clipChildren(false), michael@0: clipSiblings(false), michael@0: mDropShadow(false), michael@0: mListenForResizes(false), michael@0: mUnicode(true), michael@0: mRTL(false), michael@0: mNoAutoHide(false), michael@0: mIsDragPopup(false), michael@0: mIsAnimationSuppressed(false), michael@0: mSupportTranslucency(false), michael@0: mMouseTransparent(false), michael@0: mRequireOffMainThreadCompositing(false) michael@0: { michael@0: } michael@0: michael@0: nsWindowType mWindowType; michael@0: nsBorderStyle mBorderStyle; michael@0: nsPopupType mPopupHint; michael@0: nsPopupLevel mPopupLevel; michael@0: // when painting exclude area occupied by child windows and sibling windows michael@0: bool clipChildren, clipSiblings, mDropShadow; michael@0: bool mListenForResizes; michael@0: bool mUnicode; michael@0: bool mRTL; michael@0: bool mNoAutoHide; // true for noautohide panels michael@0: bool mIsDragPopup; // true for drag feedback panels michael@0: // true if window creation animation is suppressed, e.g. for session restore michael@0: bool mIsAnimationSuppressed; michael@0: // true if the window should support an alpha channel, if available. michael@0: bool mSupportTranslucency; michael@0: // true if the window should be transparent to mouse events. Currently this is michael@0: // only valid for eWindowType_popup widgets michael@0: bool mMouseTransparent; michael@0: // Windows with out-of-process tabs always require OMTC. This flag designates michael@0: // such windows. michael@0: bool mRequireOffMainThreadCompositing; michael@0: }; michael@0: michael@0: #endif // nsWidgetInitData_h__