1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
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/. */
7 /* Some prefable colors for style system use */
9 #ifndef mozilla_ColorPreferences_h
10 #define mozilla_ColorPreferences_h
20 struct PreferenceSheet
{
22 nscolor mLinkColor
= NS_RGB(0x00, 0x00, 0xEE);
23 nscolor mActiveLinkColor
= NS_RGB(0xEE, 0x00, 0x00);
24 nscolor mVisitedLinkColor
= NS_RGB(0x55, 0x1A, 0x8B);
26 nscolor mDefaultColor
= NS_RGB(0, 0, 0);
27 nscolor mDefaultBackgroundColor
= NS_RGB(0xFF, 0xFF, 0xFF);
29 nscolor mLinkBackgroundColor
= mDefaultBackgroundColor
;
31 nscolor mFocusTextColor
= mDefaultColor
;
32 nscolor mFocusBackgroundColor
= mDefaultBackgroundColor
;
34 bool mIsChrome
= false;
35 bool mUseAccessibilityTheme
= false;
37 bool mUnderlineLinks
= true;
38 bool mUseFocusColors
= false;
39 bool mUseDocumentColors
= true;
40 uint8_t mFocusRingWidth
= 1;
41 uint8_t mFocusRingStyle
= 1;
42 bool mFocusRingOnAnything
= false;
44 void Load(bool aIsChrome
);
47 static void EnsureInitialized() {
54 static void Refresh() {
59 static Prefs
& ContentPrefs() {
60 MOZ_ASSERT(sInitialized
);
64 static Prefs
& ChromePrefs() {
65 MOZ_ASSERT(sInitialized
);
69 static bool ShouldUseChromePrefs(const dom::Document
&);
70 static const Prefs
& PrefsFor(const dom::Document
& aDocument
) {
71 return ShouldUseChromePrefs(aDocument
) ? ChromePrefs() : ContentPrefs();
75 static bool sInitialized
;
76 static Prefs sContentPrefs
;
77 static Prefs sChromePrefs
;
79 static void Initialize();
82 } // namespace mozilla