michael@0: /* -*- Mode: C++; tab-width: 2; 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 __LookAndFeel
michael@0: #define __LookAndFeel
michael@0:
michael@0: #ifndef MOZILLA_INTERNAL_API
michael@0: #error "This header is only usable from within libxul (MOZILLA_INTERNAL_API)."
michael@0: #endif
michael@0:
michael@0: #include "nsDebug.h"
michael@0: #include "nsColor.h"
michael@0:
michael@0: struct gfxFontStyle;
michael@0:
michael@0: namespace mozilla {
michael@0:
michael@0: class LookAndFeel
michael@0: {
michael@0: public:
michael@0: // When modifying this list, also modify nsXPLookAndFeel::sColorPrefs
michael@0: // in widget/xpwidgts/nsXPLookAndFeel.cpp.
michael@0: enum ColorID {
michael@0:
michael@0: // WARNING : NO NEGATIVE VALUE IN THIS ENUMERATION
michael@0: // see patch in bug 57757 for more information
michael@0:
michael@0: eColorID_WindowBackground,
michael@0: eColorID_WindowForeground,
michael@0: eColorID_WidgetBackground,
michael@0: eColorID_WidgetForeground,
michael@0: eColorID_WidgetSelectBackground,
michael@0: eColorID_WidgetSelectForeground,
michael@0: eColorID_Widget3DHighlight,
michael@0: eColorID_Widget3DShadow,
michael@0: eColorID_TextBackground,
michael@0: eColorID_TextForeground,
michael@0: eColorID_TextSelectBackground,
michael@0: eColorID_TextSelectForeground,
michael@0: eColorID_TextSelectBackgroundDisabled,
michael@0: eColorID_TextSelectBackgroundAttention,
michael@0: eColorID_TextHighlightBackground,
michael@0: eColorID_TextHighlightForeground,
michael@0:
michael@0: eColorID_IMERawInputBackground,
michael@0: eColorID_IMERawInputForeground,
michael@0: eColorID_IMERawInputUnderline,
michael@0: eColorID_IMESelectedRawTextBackground,
michael@0: eColorID_IMESelectedRawTextForeground,
michael@0: eColorID_IMESelectedRawTextUnderline,
michael@0: eColorID_IMEConvertedTextBackground,
michael@0: eColorID_IMEConvertedTextForeground,
michael@0: eColorID_IMEConvertedTextUnderline,
michael@0: eColorID_IMESelectedConvertedTextBackground,
michael@0: eColorID_IMESelectedConvertedTextForeground,
michael@0: eColorID_IMESelectedConvertedTextUnderline,
michael@0:
michael@0: eColorID_SpellCheckerUnderline,
michael@0:
michael@0: // New CSS 2 color definitions
michael@0: eColorID_activeborder,
michael@0: eColorID_activecaption,
michael@0: eColorID_appworkspace,
michael@0: eColorID_background,
michael@0: eColorID_buttonface,
michael@0: eColorID_buttonhighlight,
michael@0: eColorID_buttonshadow,
michael@0: eColorID_buttontext,
michael@0: eColorID_captiontext,
michael@0: eColorID_graytext,
michael@0: eColorID_highlight,
michael@0: eColorID_highlighttext,
michael@0: eColorID_inactiveborder,
michael@0: eColorID_inactivecaption,
michael@0: eColorID_inactivecaptiontext,
michael@0: eColorID_infobackground,
michael@0: eColorID_infotext,
michael@0: eColorID_menu,
michael@0: eColorID_menutext,
michael@0: eColorID_scrollbar,
michael@0: eColorID_threeddarkshadow,
michael@0: eColorID_threedface,
michael@0: eColorID_threedhighlight,
michael@0: eColorID_threedlightshadow,
michael@0: eColorID_threedshadow,
michael@0: eColorID_window,
michael@0: eColorID_windowframe,
michael@0: eColorID_windowtext,
michael@0:
michael@0: eColorID__moz_buttondefault,
michael@0: // Colors which will hopefully become CSS3
michael@0: eColorID__moz_field,
michael@0: eColorID__moz_fieldtext,
michael@0: eColorID__moz_dialog,
michael@0: eColorID__moz_dialogtext,
michael@0: // used to highlight valid regions to drop something onto
michael@0: eColorID__moz_dragtargetzone,
michael@0:
michael@0: // used to cell text background, selected but not focus
michael@0: eColorID__moz_cellhighlight,
michael@0: // used to cell text, selected but not focus
michael@0: eColorID__moz_cellhighlighttext,
michael@0: // used to html select cell text background, selected but not focus
michael@0: eColorID__moz_html_cellhighlight,
michael@0: // used to html select cell text, selected but not focus
michael@0: eColorID__moz_html_cellhighlighttext,
michael@0: // used to button text background, when mouse is over
michael@0: eColorID__moz_buttonhoverface,
michael@0: // used to button text, when mouse is over
michael@0: eColorID__moz_buttonhovertext,
michael@0: // used to menu item background, when mouse is over
michael@0: eColorID__moz_menuhover,
michael@0: // used to menu item text, when mouse is over
michael@0: eColorID__moz_menuhovertext,
michael@0: // used to menu bar item text
michael@0: eColorID__moz_menubartext,
michael@0: // used to menu bar item text, when mouse is over
michael@0: eColorID__moz_menubarhovertext,
michael@0: // On platforms where these colors are the same as
michael@0: // -moz-field, use -moz-fieldtext as foreground color
michael@0: eColorID__moz_eventreerow,
michael@0: eColorID__moz_oddtreerow,
michael@0:
michael@0: // colors needed by the Mac OS X theme
michael@0:
michael@0: // background color of chrome toolbars in active windows
michael@0: eColorID__moz_mac_chrome_active,
michael@0: // background color of chrome toolbars in inactive windows
michael@0: eColorID__moz_mac_chrome_inactive,
michael@0: //ring around text fields and lists
michael@0: eColorID__moz_mac_focusring,
michael@0: //colour used when mouse is over a menu item
michael@0: eColorID__moz_mac_menuselect,
michael@0: //colour used to do shadows on menu items
michael@0: eColorID__moz_mac_menushadow,
michael@0: // color used to display text for disabled menu items
michael@0: eColorID__moz_mac_menutextdisable,
michael@0: //colour used to display text while mouse is over a menu item
michael@0: eColorID__moz_mac_menutextselect,
michael@0: // text color of disabled text on toolbars
michael@0: eColorID__moz_mac_disabledtoolbartext,
michael@0: //inactive light hightlight
michael@0: eColorID__moz_mac_secondaryhighlight,
michael@0:
michael@0: // vista rebars
michael@0:
michael@0: // media rebar text
michael@0: eColorID__moz_win_mediatext,
michael@0: // communications rebar text
michael@0: eColorID__moz_win_communicationstext,
michael@0:
michael@0: // Hyperlink color extracted from the system, not affected by the
michael@0: // browser.anchor_color user pref.
michael@0: // There is no OS-specified safe background color for this text,
michael@0: // but it is used regularly within Windows and the Gnome DE on Dialog and
michael@0: // Window colors.
michael@0: eColorID__moz_nativehyperlinktext,
michael@0:
michael@0: // Combo box widgets
michael@0: eColorID__moz_comboboxtext,
michael@0: eColorID__moz_combobox,
michael@0:
michael@0: // keep this one last, please
michael@0: eColorID_LAST_COLOR
michael@0: };
michael@0:
michael@0: // When modifying this list, also modify nsXPLookAndFeel::sIntPrefs
michael@0: // in widget/xpwidgts/nsXPLookAndFeel.cpp.
michael@0: enum IntID {
michael@0: // default, may be overriden by OS
michael@0: eIntID_CaretBlinkTime,
michael@0: // pixel width of caret
michael@0: eIntID_CaretWidth,
michael@0: // show the caret when text is selected?
michael@0: eIntID_ShowCaretDuringSelection,
michael@0: // select textfields when focused via tab/accesskey?
michael@0: eIntID_SelectTextfieldsOnKeyFocus,
michael@0: // delay before submenus open
michael@0: eIntID_SubmenuDelay,
michael@0: // can popups overlap menu/task bar?
michael@0: eIntID_MenusCanOverlapOSBar,
michael@0: // should overlay scrollbars be used?
michael@0: eIntID_UseOverlayScrollbars,
michael@0: // allow H and V overlay scrollbars to overlap?
michael@0: eIntID_AllowOverlayScrollbarsOverlap,
michael@0: // show/hide scrollbars based on activity
michael@0: eIntID_ShowHideScrollbars,
michael@0: // skip navigating to disabled menu item?
michael@0: eIntID_SkipNavigatingDisabledMenuItem,
michael@0: // begin a drag if the mouse is moved further than the threshold while the
michael@0: // button is down
michael@0: eIntID_DragThresholdX,
michael@0: eIntID_DragThresholdY,
michael@0: // Accessibility theme being used?
michael@0: eIntID_UseAccessibilityTheme,
michael@0:
michael@0: // position of scroll arrows in a scrollbar
michael@0: eIntID_ScrollArrowStyle,
michael@0: // is scroll thumb proportional or fixed?
michael@0: eIntID_ScrollSliderStyle,
michael@0:
michael@0: // each button can take one of four values:
michael@0: eIntID_ScrollButtonLeftMouseButtonAction,
michael@0: // 0 - scrolls one line, 1 - scrolls one page
michael@0: eIntID_ScrollButtonMiddleMouseButtonAction,
michael@0: // 2 - scrolls to end, 3 - button ignored
michael@0: eIntID_ScrollButtonRightMouseButtonAction,
michael@0:
michael@0: // delay for opening spring loaded folders
michael@0: eIntID_TreeOpenDelay,
michael@0: // delay for closing spring loaded folders
michael@0: eIntID_TreeCloseDelay,
michael@0: // delay for triggering the tree scrolling
michael@0: eIntID_TreeLazyScrollDelay,
michael@0: // delay for scrolling the tree
michael@0: eIntID_TreeScrollDelay,
michael@0: // the maximum number of lines to be scrolled at ones
michael@0: eIntID_TreeScrollLinesMax,
michael@0: // What type of tab-order to use
michael@0: eIntID_TabFocusModel,
michael@0: // Should menu items blink when they're chosen?
michael@0: eIntID_ChosenMenuItemsShouldBlink,
michael@0:
michael@0: /*
michael@0: * A Boolean value to determine whether the Windows default theme is
michael@0: * being used.
michael@0: *
michael@0: * The value of this metric is not used on other platforms. These platforms
michael@0: * should return NS_ERROR_NOT_IMPLEMENTED when queried for this metric.
michael@0: */
michael@0: eIntID_WindowsDefaultTheme,
michael@0:
michael@0: /*
michael@0: * A Boolean value to determine whether the DWM compositor is being used
michael@0: *
michael@0: * This metric is not used on non-Windows platforms. These platforms
michael@0: * should return NS_ERROR_NOT_IMPLEMENTED when queried for this metric.
michael@0: */
michael@0: eIntID_DWMCompositor,
michael@0:
michael@0: /*
michael@0: * A Boolean value to determine whether Windows is themed (Classic vs.
michael@0: * uxtheme)
michael@0: *
michael@0: * This is Windows-specific and is not implemented on other platforms
michael@0: * (will return the default of NS_ERROR_FAILURE).
michael@0: */
michael@0: eIntID_WindowsClassic,
michael@0:
michael@0: /*
michael@0: * A Boolean value to determine whether the current Windows desktop theme
michael@0: * supports Aero Glass.
michael@0: *
michael@0: * This is Windows-specific and is not implemented on other platforms
michael@0: * (will return the default of NS_ERROR_FAILURE).
michael@0: */
michael@0: eIntID_WindowsGlass,
michael@0:
michael@0: /*
michael@0: * A Boolean value to determine whether the device is a touch enabled
michael@0: * device. Currently this is only supported by the Windows 7 Touch API.
michael@0: *
michael@0: * Platforms that do not support this metric should return
michael@0: * NS_ERROR_NOT_IMPLEMENTED when queried for this metric.
michael@0: */
michael@0: eIntID_TouchEnabled,
michael@0:
michael@0: /*
michael@0: * A Boolean value to determine whether the Mac graphite theme is
michael@0: * being used.
michael@0: *
michael@0: * The value of this metric is not used on other platforms. These platforms
michael@0: * should return NS_ERROR_NOT_IMPLEMENTED when queried for this metric.
michael@0: */
michael@0: eIntID_MacGraphiteTheme,
michael@0:
michael@0: /*
michael@0: * A Boolean value to determine whether the Mac OS X Lion-specific theming
michael@0: * should be used.
michael@0: *
michael@0: * The value of this metric is not used on non-Mac platforms. These
michael@0: * platforms should return NS_ERROR_NOT_IMPLEMENTED when queried for this
michael@0: * metric.
michael@0: */
michael@0: eIntID_MacLionTheme,
michael@0:
michael@0: /*
michael@0: * eIntID_AlertNotificationOrigin indicates from which corner of the
michael@0: * screen alerts slide in, and from which direction (horizontal/vertical).
michael@0: * 0, the default, represents bottom right, sliding vertically.
michael@0: * Use any bitwise combination of the following constants:
michael@0: * NS_ALERT_HORIZONTAL (1), NS_ALERT_LEFT (2), NS_ALERT_TOP (4).
michael@0: *
michael@0: * 6 4
michael@0: * +-----------+
michael@0: * 7| |5
michael@0: * | |
michael@0: * 3| |1
michael@0: * +-----------+
michael@0: * 2 0
michael@0: */
michael@0: eIntID_AlertNotificationOrigin,
michael@0:
michael@0: /**
michael@0: * If true, clicking on a scrollbar (not as in dragging the thumb) defaults
michael@0: * to scrolling the view corresponding to the clicked point. Otherwise, we
michael@0: * only do so if the scrollbar is clicked using the middle mouse button or
michael@0: * if shift is pressed when the scrollbar is clicked.
michael@0: */
michael@0: eIntID_ScrollToClick,
michael@0:
michael@0: /**
michael@0: * IME and spell checker underline styles, the values should be
michael@0: * NS_DECORATION_LINE_STYLE_*. They are defined below.
michael@0: */
michael@0: eIntID_IMERawInputUnderlineStyle,
michael@0: eIntID_IMESelectedRawTextUnderlineStyle,
michael@0: eIntID_IMEConvertedTextUnderlineStyle,
michael@0: eIntID_IMESelectedConvertedTextUnderline,
michael@0: eIntID_SpellCheckerUnderlineStyle,
michael@0:
michael@0: /**
michael@0: * If this metric != 0, show icons in menus.
michael@0: */
michael@0: eIntID_ImagesInMenus,
michael@0: /**
michael@0: * If this metric != 0, show icons in buttons.
michael@0: */
michael@0: eIntID_ImagesInButtons,
michael@0: /**
michael@0: * If this metric != 0, support window dragging on the menubar.
michael@0: */
michael@0: eIntID_MenuBarDrag,
michael@0: /**
michael@0: * Return the appropriate WindowsThemeIdentifier for the current theme.
michael@0: */
michael@0: eIntID_WindowsThemeIdentifier,
michael@0: /**
michael@0: * Return an appropriate os version identifier.
michael@0: */
michael@0: eIntID_OperatingSystemVersionIdentifier,
michael@0: /**
michael@0: * 0: scrollbar button repeats to scroll only when cursor is on the button.
michael@0: * 1: scrollbar button repeats to scroll even if cursor is outside of it.
michael@0: */
michael@0: eIntID_ScrollbarButtonAutoRepeatBehavior,
michael@0: /**
michael@0: * Delay before showing a tooltip.
michael@0: */
michael@0: eIntID_TooltipDelay,
michael@0: /*
michael@0: * A Boolean value to determine whether Mac OS X Lion style swipe animations
michael@0: * should be used.
michael@0: */
michael@0: eIntID_SwipeAnimationEnabled,
michael@0:
michael@0: /*
michael@0: * A Boolean value to determine whether we have a color picker available
michael@0: * for to hook into.
michael@0: *
michael@0: * This lets us selectively enable the style for
michael@0: * based on whether it's functional or not.
michael@0: */
michael@0: eIntID_ColorPickerAvailable,
michael@0:
michael@0: /*
michael@0: * A boolean value indicating whether or not the device has a hardware
michael@0: * home button. Used on gaia to determine whether a home button
michael@0: * is shown.
michael@0: */
michael@0: eIntID_PhysicalHomeButton,
michael@0:
michael@0: /*
michael@0: * Controls whether overlay scrollbars display when the user moves
michael@0: * the mouse in a scrollable frame.
michael@0: */
michael@0: eIntID_ScrollbarDisplayOnMouseMove,
michael@0:
michael@0: /*
michael@0: * Overlay scrollbar animation constants.
michael@0: */
michael@0: eIntID_ScrollbarFadeBeginDelay,
michael@0: eIntID_ScrollbarFadeDuration
michael@0: };
michael@0:
michael@0: /**
michael@0: * Windows themes we currently detect.
michael@0: */
michael@0: enum WindowsTheme {
michael@0: eWindowsTheme_Generic = 0, // unrecognized theme
michael@0: eWindowsTheme_Classic,
michael@0: eWindowsTheme_Aero,
michael@0: eWindowsTheme_LunaBlue,
michael@0: eWindowsTheme_LunaOlive,
michael@0: eWindowsTheme_LunaSilver,
michael@0: eWindowsTheme_Royale,
michael@0: eWindowsTheme_Zune,
michael@0: eWindowsTheme_AeroLite
michael@0: };
michael@0:
michael@0: /**
michael@0: * Operating system versions.
michael@0: */
michael@0: enum OperatingSystemVersion {
michael@0: eOperatingSystemVersion_WindowsXP = 0,
michael@0: eOperatingSystemVersion_WindowsVista,
michael@0: eOperatingSystemVersion_Windows7,
michael@0: eOperatingSystemVersion_Windows8,
michael@0: eOperatingSystemVersion_Unknown
michael@0: };
michael@0:
michael@0: enum {
michael@0: eScrollArrow_None = 0,
michael@0: eScrollArrow_StartBackward = 0x1000,
michael@0: eScrollArrow_StartForward = 0x0100,
michael@0: eScrollArrow_EndBackward = 0x0010,
michael@0: eScrollArrow_EndForward = 0x0001
michael@0: };
michael@0:
michael@0: enum {
michael@0: // single arrow at each end
michael@0: eScrollArrowStyle_Single =
michael@0: eScrollArrow_StartBackward | eScrollArrow_EndForward,
michael@0: // both arrows at bottom/right, none at top/left
michael@0: eScrollArrowStyle_BothAtBottom =
michael@0: eScrollArrow_EndBackward | eScrollArrow_EndForward,
michael@0: // both arrows at both ends
michael@0: eScrollArrowStyle_BothAtEachEnd =
michael@0: eScrollArrow_EndBackward | eScrollArrow_EndForward |
michael@0: eScrollArrow_StartBackward | eScrollArrow_StartForward,
michael@0: // both arrows at top/left, none at bottom/right
michael@0: eScrollArrowStyle_BothAtTop =
michael@0: eScrollArrow_StartBackward | eScrollArrow_StartForward
michael@0: };
michael@0:
michael@0: enum {
michael@0: eScrollThumbStyle_Normal,
michael@0: eScrollThumbStyle_Proportional
michael@0: };
michael@0:
michael@0: // When modifying this list, also modify nsXPLookAndFeel::sFloatPrefs
michael@0: // in widget/xpwidgts/nsXPLookAndFeel.cpp.
michael@0: enum FloatID {
michael@0: eFloatID_IMEUnderlineRelativeSize,
michael@0: eFloatID_SpellCheckerUnderlineRelativeSize,
michael@0:
michael@0: // The width/height ratio of the cursor. If used, the CaretWidth int metric
michael@0: // should be added to the calculated caret width.
michael@0: eFloatID_CaretAspectRatio
michael@0: };
michael@0:
michael@0: // These constants must be kept in 1:1 correspondence with the
michael@0: // NS_STYLE_FONT_* system font constants.
michael@0: enum FontID {
michael@0: eFont_Caption = 1, // css2
michael@0: eFont_Icon,
michael@0: eFont_Menu,
michael@0: eFont_MessageBox,
michael@0: eFont_SmallCaption,
michael@0: eFont_StatusBar,
michael@0:
michael@0: eFont_Window, // css3
michael@0: eFont_Document,
michael@0: eFont_Workspace,
michael@0: eFont_Desktop,
michael@0: eFont_Info,
michael@0: eFont_Dialog,
michael@0: eFont_Button,
michael@0: eFont_PullDownMenu,
michael@0: eFont_List,
michael@0: eFont_Field,
michael@0:
michael@0: eFont_Tooltips, // moz
michael@0: eFont_Widget
michael@0: };
michael@0:
michael@0: /**
michael@0: * GetColor() return a native color value (might be overwritten by prefs) for
michael@0: * aID. Some platforms don't return an error even if the index doesn't
michael@0: * match any system colors. And also some platforms may initialize the
michael@0: * return value even when it returns an error. Therefore, if you want to
michael@0: * use a color for the default value, you should use the other GetColor()
michael@0: * which returns nscolor directly.
michael@0: *
michael@0: * NOTE:
michael@0: * eColorID_TextSelectForeground might return NS_DONT_CHANGE_COLOR.
michael@0: * eColorID_IME* might return NS_TRANSPARENT, NS_SAME_AS_FOREGROUND_COLOR or
michael@0: * NS_40PERCENT_FOREGROUND_COLOR.
michael@0: * These values have particular meaning. Then, they are not an actual
michael@0: * color value.
michael@0: */
michael@0: static nsresult GetColor(ColorID aID, nscolor* aResult);
michael@0:
michael@0: /**
michael@0: * This variant of GetColor() take an extra Boolean parameter that allows
michael@0: * the caller to ask that hard-coded color values be substituted for
michael@0: * native colors (used when it is desireable to hide system colors to
michael@0: * avoid system fingerprinting).
michael@0: */
michael@0: static nsresult GetColor(ColorID aID, bool aUseStandinsForNativeColors,
michael@0: nscolor* aResult);
michael@0:
michael@0: static nsresult GetColorForNativeAppearance(uint8_t aWidgetType,
michael@0: bool aIsDisabled, nscolor* aResult);
michael@0:
michael@0: /**
michael@0: * GetInt() and GetFloat() return a int or float value for aID. The result
michael@0: * might be distance, time, some flags or a int value which has particular
michael@0: * meaning. See each document at definition of each ID for the detail.
michael@0: * The result is always 0 when they return error. Therefore, if you want to
michael@0: * use a value for the default value, you should use the other method which
michael@0: * returns int or float directly.
michael@0: */
michael@0: static nsresult GetInt(IntID aID, int32_t* aResult);
michael@0: static nsresult GetFloat(FloatID aID, float* aResult);
michael@0:
michael@0: static nscolor GetColor(ColorID aID, nscolor aDefault = NS_RGB(0, 0, 0))
michael@0: {
michael@0: nscolor result = NS_RGB(0, 0, 0);
michael@0: if (NS_FAILED(GetColor(aID, &result))) {
michael@0: return aDefault;
michael@0: }
michael@0: return result;
michael@0: }
michael@0:
michael@0: static int32_t GetInt(IntID aID, int32_t aDefault = 0)
michael@0: {
michael@0: int32_t result;
michael@0: if (NS_FAILED(GetInt(aID, &result))) {
michael@0: return aDefault;
michael@0: }
michael@0: return result;
michael@0: }
michael@0:
michael@0: static float GetFloat(FloatID aID, float aDefault = 0.0f)
michael@0: {
michael@0: float result;
michael@0: if (NS_FAILED(GetFloat(aID, &result))) {
michael@0: return aDefault;
michael@0: }
michael@0: return result;
michael@0: }
michael@0:
michael@0: /**
michael@0: * Retrieve the name and style of a system-theme font. Returns true
michael@0: * if the system theme specifies this font, false if a default should
michael@0: * be used. In the latter case neither aName nor aStyle is modified.
michael@0: *
michael@0: * @param aID Which system-theme font is wanted.
michael@0: * @param aName The name of the font to use.
michael@0: * @param aStyle Styling to apply to the font.
michael@0: * @param aDevPixPerCSSPixel Ratio of device pixels to CSS pixels
michael@0: */
michael@0: static bool GetFont(FontID aID, nsString& aName, gfxFontStyle& aStyle,
michael@0: float aDevPixPerCSSPixel);
michael@0:
michael@0: /**
michael@0: * GetPasswordCharacter() returns a unicode character which should be used
michael@0: * for a masked character in password editor. E.g., '*'.
michael@0: */
michael@0: static char16_t GetPasswordCharacter();
michael@0:
michael@0: /**
michael@0: * If the latest character in password field shouldn't be hidden by the
michael@0: * result of GetPasswordCharacter(), GetEchoPassword() returns TRUE.
michael@0: * Otherwise, FALSE.
michael@0: */
michael@0: static bool GetEchoPassword();
michael@0:
michael@0: /**
michael@0: * The millisecond to mask password value.
michael@0: * This value is only valid when GetEchoPassword() returns true.
michael@0: */
michael@0: static uint32_t GetPasswordMaskDelay();
michael@0:
michael@0: /**
michael@0: * When system look and feel is changed, Refresh() must be called. Then,
michael@0: * cached data would be released.
michael@0: */
michael@0: static void Refresh();
michael@0: };
michael@0:
michael@0: } // namespace mozilla
michael@0:
michael@0: // On the Mac, GetColor(eColorID_TextSelectForeground, color) returns this
michael@0: // constant to specify that the foreground color should not be changed
michael@0: // (ie. a colored text keeps its colors when selected).
michael@0: // Of course if other plaforms work like the Mac, they can use it too.
michael@0: #define NS_DONT_CHANGE_COLOR NS_RGB(0x01, 0x01, 0x01)
michael@0:
michael@0: // ---------------------------------------------------------------------
michael@0: // Special colors for eColorID_IME* and eColorID_SpellCheckerUnderline
michael@0: // ---------------------------------------------------------------------
michael@0:
michael@0: // For background color only.
michael@0: #define NS_TRANSPARENT NS_RGBA(0x01, 0x00, 0x00, 0x00)
michael@0: // For foreground color only.
michael@0: #define NS_SAME_AS_FOREGROUND_COLOR NS_RGBA(0x02, 0x00, 0x00, 0x00)
michael@0: #define NS_40PERCENT_FOREGROUND_COLOR NS_RGBA(0x03, 0x00, 0x00, 0x00)
michael@0:
michael@0: #define NS_IS_SELECTION_SPECIAL_COLOR(c) ((c) == NS_TRANSPARENT || \
michael@0: (c) == NS_SAME_AS_FOREGROUND_COLOR || \
michael@0: (c) == NS_40PERCENT_FOREGROUND_COLOR)
michael@0:
michael@0: // ------------------------------------------
michael@0: // Bits for eIntID_AlertNotificationOrigin
michael@0: // ------------------------------------------
michael@0:
michael@0: #define NS_ALERT_HORIZONTAL 1
michael@0: #define NS_ALERT_LEFT 2
michael@0: #define NS_ALERT_TOP 4
michael@0:
michael@0: #endif /* __LookAndFeel */