]>
git.saurik.com Git - iphone-api.git/blob - WebCore/RenderThemeChromiumWin.h
2 * This file is part of the WebKit project.
4 * Copyright (C) 2006 Apple Computer, Inc.
5 * Copyright (C) 2008, 2009 Google, 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 RenderThemeChromiumWin_h
25 #define RenderThemeChromiumWin_h
27 #include "RenderTheme.h"
31 typedef struct HINSTANCE__
* HINSTANCE
;
32 typedef HINSTANCE HMODULE
;
38 ThemeData() : m_part(0), m_state(0), m_classicState(0) {}
42 unsigned m_classicState
;
45 class RenderThemeChromiumWin
: public RenderTheme
{
47 RenderThemeChromiumWin() { }
48 ~RenderThemeChromiumWin() { }
50 virtual String
extraDefaultStyleSheet();
51 virtual String
extraQuirksStyleSheet();
53 // A method asking if the theme's controls actually care about redrawing when hovered.
54 virtual bool supportsHover(const RenderStyle
*) const { return true; }
56 // A method asking if the theme is able to draw the focus ring.
57 virtual bool supportsFocusRing(const RenderStyle
*) const;
59 // The platform selection color.
60 virtual Color
platformActiveSelectionBackgroundColor() const;
61 virtual Color
platformInactiveSelectionBackgroundColor() const;
62 virtual Color
platformActiveSelectionForegroundColor() const;
63 virtual Color
platformInactiveSelectionForegroundColor() const;
64 virtual Color
platformTextSearchHighlightColor() const;
66 virtual double caretBlinkInterval() const;
69 virtual void systemFont(int propId
, Document
*, FontDescription
&) const;
71 virtual int minimumMenuListSize(RenderStyle
*) const;
73 virtual bool paintCheckbox(RenderObject
* o
, const RenderObject::PaintInfo
& i
, const IntRect
& r
) { return paintButton(o
, i
, r
); }
74 virtual void setCheckboxSize(RenderStyle
*) const;
76 virtual bool paintRadio(RenderObject
* o
, const RenderObject::PaintInfo
& i
, const IntRect
& r
) { return paintButton(o
, i
, r
); }
77 virtual void setRadioSize(RenderStyle
*) const;
79 virtual bool paintButton(RenderObject
*, const RenderObject::PaintInfo
&, const IntRect
&);
81 virtual bool paintTextField(RenderObject
*, const RenderObject::PaintInfo
&, const IntRect
&);
83 virtual bool paintTextArea(RenderObject
* o
, const RenderObject::PaintInfo
& i
, const IntRect
& r
) { return paintTextField(o
, i
, r
); }
85 virtual bool paintSearchField(RenderObject
*, const RenderObject::PaintInfo
&, const IntRect
&);
87 // MenuList refers to an unstyled menulist (meaning a menulist without
88 // background-color or border set) and MenuListButton refers to a styled
89 // menulist (a menulist with background-color or border set). They have
90 // this distinction to support showing aqua style themes whenever they
91 // possibly can, which is something we don't want to replicate.
93 // In short, we either go down the MenuList code path or the MenuListButton
94 // codepath. We never go down both. And in both cases, they render the
96 virtual void adjustMenuListStyle(CSSStyleSelector
*, RenderStyle
*, Element
*) const;
97 virtual bool paintMenuList(RenderObject
*, const RenderObject::PaintInfo
&, const IntRect
&);
98 virtual void adjustMenuListButtonStyle(CSSStyleSelector
*, RenderStyle
*, Element
*) const;
99 virtual bool paintMenuListButton(RenderObject
*, const RenderObject::PaintInfo
&, const IntRect
&);
101 // These methods define the padding for the MenuList's inner block.
102 virtual int popupInternalPaddingLeft(RenderStyle
*) const;
103 virtual int popupInternalPaddingRight(RenderStyle
*) const;
104 virtual int popupInternalPaddingTop(RenderStyle
*) const;
105 virtual int popupInternalPaddingBottom(RenderStyle
*) const;
107 virtual void adjustButtonInnerStyle(RenderStyle
*) const;
109 // Provide a way to pass the default font size from the Settings object
110 // to the render theme. FIXME: http://b/1129186 A cleaner way would be
111 // to remove the default font size from this object and have callers
112 // that need the value to get it directly from the appropriate Settings
114 static void setDefaultFontSize(int);
116 // Enables/Disables FindInPage mode, which (if enabled) overrides the
117 // selection rect color to be orange.
118 static void setFindInPageMode(bool);
121 unsigned determineState(RenderObject
*);
122 unsigned determineClassicState(RenderObject
*);
124 ThemeData
getThemeData(RenderObject
*);
126 bool paintTextFieldInternal(RenderObject
*, const RenderObject::PaintInfo
&, const IntRect
&, bool);
128 int menuListInternalPadding(RenderStyle
*, int paddingType
) const;
130 // A flag specifying whether we are in Find-in-page mode or not.
131 static bool m_findInPageMode
;
134 } // namespace WebCore