2 * This file is part of the WebKit project.
4 * Copyright (C) 2006, 2008 Apple Computer, Inc.
5 * Copyright (C) 2009 Torch Mobile, Inc.
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
17 * You should have received a copy of the GNU Library General Public License
18 * along with this library; see the file COPYING.LIB. If not, write to
19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 * Boston, MA 02110-1301, USA.
24 #ifndef RenderThemeWinCE_h
25 #define RenderThemeWinCE_h
27 #include "RenderTheme.h"
30 typedef struct HINSTANCE__* HINSTANCE;
31 typedef HINSTANCE HMODULE;
36 ThemeData() :m_part(0), m_state(0), m_classicState(0) {}
37 ThemeData(int part, int state)
45 unsigned m_classicState;
48 class RenderThemeWinCE : public RenderTheme {
50 static PassRefPtr<RenderTheme> create();
53 virtual String extraDefaultStyleSheet();
54 virtual String extraQuirksStyleSheet();
56 // A method asking if the theme's controls actually care about redrawing when hovered.
57 virtual bool supportsHover(const RenderStyle*) const;
59 virtual Color platformActiveSelectionBackgroundColor() const;
60 virtual Color platformInactiveSelectionBackgroundColor() const;
61 virtual Color platformActiveSelectionForegroundColor() const;
62 virtual Color platformInactiveSelectionForegroundColor() const;
65 virtual void systemFont(int propId, FontDescription&) const;
66 virtual Color systemColor(int cssValueId) const;
68 virtual bool paintCheckbox(RenderObject* o, const PaintInfo& i, const IntRect& r)
69 { return paintButton(o, i, r); }
70 virtual void setCheckboxSize(RenderStyle*) const;
72 virtual bool paintRadio(RenderObject* o, const PaintInfo& i, const IntRect& r)
73 { return paintButton(o, i, r); }
74 virtual void setRadioSize(RenderStyle* style) const
75 { return setCheckboxSize(style); }
77 virtual bool paintButton(RenderObject*, const PaintInfo&, const IntRect&);
79 virtual bool paintTextField(RenderObject*, const PaintInfo&, const IntRect&);
81 virtual bool paintTextArea(RenderObject* o, const PaintInfo& i, const IntRect& r)
82 { return paintTextField(o, i, r); }
84 virtual void adjustMenuListStyle(StyleResolver*, RenderStyle*, Element*) const;
85 virtual bool paintMenuList(RenderObject*, const PaintInfo&, const IntRect&);
86 virtual void adjustMenuListButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
88 virtual bool paintMenuListButton(RenderObject*, const PaintInfo&, const IntRect&);
90 virtual bool paintSliderTrack(RenderObject* o, const PaintInfo& i, const IntRect& r);
91 virtual bool paintSliderThumb(RenderObject* o, const PaintInfo& i, const IntRect& r);
92 virtual void adjustSliderThumbSize(RenderStyle*, Element*) const;
94 virtual bool popupOptionSupportsTextIndent() const { return true; }
96 virtual void adjustSearchFieldStyle(StyleResolver*, RenderStyle*, Element*) const;
97 virtual bool paintSearchField(RenderObject*, const PaintInfo&, const IntRect&);
99 virtual void adjustSearchFieldCancelButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
100 virtual bool paintSearchFieldCancelButton(RenderObject*, const PaintInfo&, const IntRect&);
102 virtual void adjustSearchFieldDecorationStyle(StyleResolver*, RenderStyle*, Element*) const;
103 virtual bool paintSearchFieldDecoration(RenderObject*, const PaintInfo&, const IntRect&) { return false; }
105 virtual void adjustSearchFieldResultsDecorationStyle(StyleResolver*, RenderStyle*, Element*) const;
106 virtual bool paintSearchFieldResultsDecoration(RenderObject*, const PaintInfo&, const IntRect&);
108 virtual void adjustSearchFieldResultsButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
109 virtual bool paintSearchFieldResultsButton(RenderObject*, const PaintInfo&, const IntRect&);
111 virtual void themeChanged();
113 virtual void adjustButtonStyle(StyleResolver*, RenderStyle* style, Element*) const { }
114 virtual void adjustTextFieldStyle(StyleResolver*, RenderStyle* style, Element*) const { }
115 virtual void adjustTextAreaStyle(StyleResolver*, RenderStyle* style, Element*) const { }
117 static void setWebKitIsBeingUnloaded();
119 virtual bool supportsFocusRing(const RenderStyle*) const;
122 virtual bool paintMediaFullscreenButton(RenderObject*, const PaintInfo&, const IntRect&);
123 virtual bool paintMediaPlayButton(RenderObject*, const PaintInfo&, const IntRect&);
124 virtual bool paintMediaMuteButton(RenderObject*, const PaintInfo&, const IntRect&);
125 virtual bool paintMediaSeekBackButton(RenderObject*, const PaintInfo&, const IntRect&);
126 virtual bool paintMediaSeekForwardButton(RenderObject*, const PaintInfo&, const IntRect&);
127 virtual bool paintMediaSliderTrack(RenderObject*, const PaintInfo&, const IntRect&);
128 virtual bool paintMediaSliderThumb(RenderObject*, const PaintInfo&, const IntRect&);
134 unsigned determineClassicState(RenderObject*);
135 bool supportsFocus(ControlPart) const;
137 ThemeData getThemeData(RenderObject*);
142 #endif // RenderThemeWinCE_h