| OLD | NEW |
| 1 /* | 1 /* |
| 2 * This file is part of the theme implementation for form controls in WebCore. | 2 * This file is part of the theme implementation for form controls in WebCore. |
| 3 * | 3 * |
| 4 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Computer, Inc. | 4 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Computer, Inc. |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 class ComputedStyle; | 36 class ComputedStyle; |
| 37 class Element; | 37 class Element; |
| 38 class FileList; | 38 class FileList; |
| 39 class HTMLInputElement; | 39 class HTMLInputElement; |
| 40 class LayoutMeter; | 40 class LayoutMeter; |
| 41 class Theme; | 41 class Theme; |
| 42 class ThemePainter; | 42 class ThemePainter; |
| 43 | 43 |
| 44 class CORE_EXPORT LayoutTheme : public RefCounted<LayoutTheme> { | 44 class CORE_EXPORT LayoutTheme : public RefCounted<LayoutTheme> { |
| 45 protected: | 45 protected: |
| 46 LayoutTheme(); | 46 explicit LayoutTheme(Theme*); |
| 47 | 47 |
| 48 public: | 48 public: |
| 49 virtual ~LayoutTheme() { } | 49 virtual ~LayoutTheme() { } |
| 50 | 50 |
| 51 // This function is to be implemented in your platform-specific theme implem
entation to hand back the | |
| 52 // appropriate platform theme. | |
| 53 static LayoutTheme& theme(); | 51 static LayoutTheme& theme(); |
| 54 | 52 |
| 55 virtual ThemePainter& painter() = 0; | 53 virtual ThemePainter& painter() = 0; |
| 56 | 54 |
| 57 static void setSizeIfAuto(ComputedStyle&, const IntSize&); | 55 static void setSizeIfAuto(ComputedStyle&, const IntSize&); |
| 58 | 56 |
| 59 // This method is called whenever style has been computed for an element and
the appearance | 57 // This method is called whenever style has been computed for an element and
the appearance |
| 60 // property has been set to a value other than "none". The theme should map
in all of the appropriate | 58 // property has been set to a value other than "none". The theme should map
in all of the appropriate |
| 61 // metrics and defaults given the contents of the style. This includes soph
isticated operations like | 59 // metrics and defaults given the contents of the style. This includes soph
isticated operations like |
| 62 // selection of control size based off the font, the disabling of appearance
when certain other properties like | 60 // selection of control size based off the font, the disabling of appearance
when certain other properties like |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 virtual Color platformActiveSelectionForegroundColor() const; | 193 virtual Color platformActiveSelectionForegroundColor() const; |
| 196 virtual Color platformInactiveSelectionForegroundColor() const; | 194 virtual Color platformInactiveSelectionForegroundColor() const; |
| 197 | 195 |
| 198 virtual Color platformActiveListBoxSelectionBackgroundColor() const; | 196 virtual Color platformActiveListBoxSelectionBackgroundColor() const; |
| 199 virtual Color platformInactiveListBoxSelectionBackgroundColor() const; | 197 virtual Color platformInactiveListBoxSelectionBackgroundColor() const; |
| 200 virtual Color platformActiveListBoxSelectionForegroundColor() const; | 198 virtual Color platformActiveListBoxSelectionForegroundColor() const; |
| 201 virtual Color platformInactiveListBoxSelectionForegroundColor() const; | 199 virtual Color platformInactiveListBoxSelectionForegroundColor() const; |
| 202 | 200 |
| 203 virtual bool themeDrawsFocusRing(const ComputedStyle&) const = 0; | 201 virtual bool themeDrawsFocusRing(const ComputedStyle&) const = 0; |
| 204 | 202 |
| 205 #if !USE(NEW_THEME) | |
| 206 // Methods for each appearance value. | 203 // Methods for each appearance value. |
| 207 virtual void adjustCheckboxStyle(ComputedStyle&) const; | 204 virtual void adjustCheckboxStyle(ComputedStyle&) const; |
| 208 virtual void setCheckboxSize(ComputedStyle&) const { } | 205 virtual void setCheckboxSize(ComputedStyle&) const { } |
| 209 | 206 |
| 210 virtual void adjustRadioStyle(ComputedStyle&) const; | 207 virtual void adjustRadioStyle(ComputedStyle&) const; |
| 211 virtual void setRadioSize(ComputedStyle&) const { } | 208 virtual void setRadioSize(ComputedStyle&) const { } |
| 212 | 209 |
| 213 virtual void adjustButtonStyle(ComputedStyle&) const; | 210 virtual void adjustButtonStyle(ComputedStyle&) const; |
| 214 virtual void adjustInnerSpinButtonStyle(ComputedStyle&) const; | 211 virtual void adjustInnerSpinButtonStyle(ComputedStyle&) const; |
| 215 #endif | |
| 216 | 212 |
| 217 virtual void adjustMenuListStyle(ComputedStyle&, Element*) const; | 213 virtual void adjustMenuListStyle(ComputedStyle&, Element*) const; |
| 218 virtual void adjustMenuListButtonStyle(ComputedStyle&, Element*) const; | 214 virtual void adjustMenuListButtonStyle(ComputedStyle&, Element*) const; |
| 219 virtual void adjustSliderThumbStyle(ComputedStyle&) const; | 215 virtual void adjustSliderThumbStyle(ComputedStyle&) const; |
| 220 virtual void adjustSearchFieldStyle(ComputedStyle&) const; | 216 virtual void adjustSearchFieldStyle(ComputedStyle&) const; |
| 221 virtual void adjustSearchFieldCancelButtonStyle(ComputedStyle&) const; | 217 virtual void adjustSearchFieldCancelButtonStyle(ComputedStyle&) const; |
| 222 virtual void adjustSearchFieldDecorationStyle(ComputedStyle&) const; | 218 virtual void adjustSearchFieldDecorationStyle(ComputedStyle&) const; |
| 223 virtual void adjustSearchFieldResultsDecorationStyle(ComputedStyle&) const; | 219 virtual void adjustSearchFieldResultsDecorationStyle(ComputedStyle&) const; |
| 224 void adjustStyleUsingFallbackTheme(ComputedStyle&); | 220 void adjustStyleUsingFallbackTheme(ComputedStyle&); |
| 225 void adjustCheckboxStyleUsingFallbackTheme(ComputedStyle&) const; | 221 void adjustCheckboxStyleUsingFallbackTheme(ComputedStyle&) const; |
| 226 void adjustRadioStyleUsingFallbackTheme(ComputedStyle&) const; | 222 void adjustRadioStyleUsingFallbackTheme(ComputedStyle&) const; |
| 227 | 223 |
| 224 bool hasPlatformTheme() const { return m_platformTheme; } |
| 225 |
| 228 public: | 226 public: |
| 229 // Methods for state querying | 227 // Methods for state querying |
| 230 static ControlStates controlStatesForLayoutObject(const LayoutObject&); | 228 static ControlStates controlStatesForLayoutObject(const LayoutObject&); |
| 231 static bool isActive(const LayoutObject&); | 229 static bool isActive(const LayoutObject&); |
| 232 static bool isChecked(const LayoutObject&); | 230 static bool isChecked(const LayoutObject&); |
| 233 static bool isIndeterminate(const LayoutObject&); | 231 static bool isIndeterminate(const LayoutObject&); |
| 234 static bool isEnabled(const LayoutObject&); | 232 static bool isEnabled(const LayoutObject&); |
| 235 static bool isFocused(const LayoutObject&); | 233 static bool isFocused(const LayoutObject&); |
| 236 static bool isPressed(const LayoutObject&); | 234 static bool isPressed(const LayoutObject&); |
| 237 static bool isSpinUpButtonPartPressed(const LayoutObject&); | 235 static bool isSpinUpButtonPartPressed(const LayoutObject&); |
| 238 static bool isHovered(const LayoutObject&); | 236 static bool isHovered(const LayoutObject&); |
| 239 static bool isSpinUpButtonPartHovered(const LayoutObject&); | 237 static bool isSpinUpButtonPartHovered(const LayoutObject&); |
| 240 static bool isReadOnlyControl(const LayoutObject&); | 238 static bool isReadOnlyControl(const LayoutObject&); |
| 241 | 239 |
| 242 private: | 240 private: |
| 241 // This function is to be implemented in your platform-specific theme implem
entation to hand back the |
| 242 // appropriate platform theme. |
| 243 static LayoutTheme& nativeTheme(); |
| 244 |
| 243 Color m_customFocusRingColor; | 245 Color m_customFocusRingColor; |
| 244 bool m_hasCustomFocusRingColor; | 246 bool m_hasCustomFocusRingColor; |
| 245 | 247 |
| 246 // This color is expected to be drawn on a semi-transparent overlay, | 248 // This color is expected to be drawn on a semi-transparent overlay, |
| 247 // making it more transparent than its alpha value indicates. | 249 // making it more transparent than its alpha value indicates. |
| 248 static const RGBA32 defaultTapHighlightColor = 0x66000000; | 250 static const RGBA32 defaultTapHighlightColor = 0x66000000; |
| 249 | 251 |
| 250 static const RGBA32 defaultCompositionBackgroundColor = 0xFFFFDD55; | 252 static const RGBA32 defaultCompositionBackgroundColor = 0xFFFFDD55; |
| 251 | 253 |
| 252 #if USE(NEW_THEME) | |
| 253 Theme* m_platformTheme; // The platform-specific theme. | 254 Theme* m_platformTheme; // The platform-specific theme. |
| 254 #endif | |
| 255 }; | 255 }; |
| 256 | 256 |
| 257 } // namespace blink | 257 } // namespace blink |
| 258 | 258 |
| 259 #endif // LayoutTheme_h | 259 #endif // LayoutTheme_h |
| OLD | NEW |