~ubuntu-branches/ubuntu/raring/qtwebkit-source/raring-proposed

« back to all changes in this revision

Viewing changes to Source/WebCore/rendering/RenderThemeChromiumSkia.h

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2013-02-18 14:24:18 UTC
  • Revision ID: package-import@ubuntu.com-20130218142418-eon0jmjg3nj438uy
Tags: upstream-2.3
ImportĀ upstreamĀ versionĀ 2.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * This file is part of the WebKit project.
 
3
 *
 
4
 * Copyright (C) 2006 Apple Computer, Inc.
 
5
 * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com
 
6
 * Copyright (C) 2007 Holger Hans Peter Freyther
 
7
 * Copyright (C) 2007 Alp Toker <alp@atoker.com>
 
8
 * Copyright (C) 2008, 2009 Google, Inc.
 
9
 * All rights reserved.
 
10
 *
 
11
 * This library is free software; you can redistribute it and/or
 
12
 * modify it under the terms of the GNU Library General Public
 
13
 * License as published by the Free Software Foundation; either
 
14
 * version 2 of the License, or (at your option) any later version.
 
15
 *
 
16
 * This library is distributed in the hope that it will be useful,
 
17
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
18
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
19
 * Library General Public License for more details.
 
20
 *
 
21
 * You should have received a copy of the GNU Library General Public License
 
22
 * along with this library; see the file COPYING.LIB.  If not, write to
 
23
 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 
24
 * Boston, MA 02110-1301, USA.
 
25
 *
 
26
 */
 
27
 
 
28
#ifndef RenderThemeChromiumSkia_h
 
29
#define RenderThemeChromiumSkia_h
 
30
 
 
31
#include "RenderTheme.h"
 
32
#include "RenderThemeChromiumCommon.h"
 
33
 
 
34
namespace WebCore {
 
35
 
 
36
class RenderProgress;
 
37
 
 
38
class RenderThemeChromiumSkia : public RenderTheme {
 
39
public:
 
40
    RenderThemeChromiumSkia();
 
41
    virtual ~RenderThemeChromiumSkia();
 
42
 
 
43
    virtual String extraDefaultStyleSheet();
 
44
    virtual String extraQuirksStyleSheet();
 
45
#if ENABLE(VIDEO)
 
46
    virtual String extraMediaControlsStyleSheet();
 
47
#endif
 
48
 
 
49
#if ENABLE(TOUCH_EVENTS)
 
50
    virtual Color platformTapHighlightColor() const OVERRIDE
 
51
    {
 
52
        return Color(defaultTapHighlightColor);
 
53
    }
 
54
#endif
 
55
 
 
56
    // A method asking if the theme's controls actually care about redrawing when hovered.
 
57
    virtual bool supportsHover(const RenderStyle*) const;
 
58
 
 
59
    // A method asking if the theme is able to draw the focus ring.
 
60
    virtual bool supportsFocusRing(const RenderStyle*) const;
 
61
 
 
62
    virtual bool supportsDataListUI(const AtomicString& type) const OVERRIDE;
 
63
 
 
64
#if ENABLE(VIDEO_TRACK)
 
65
    virtual bool supportsClosedCaptioning() const OVERRIDE;
 
66
#endif
 
67
    // The platform selection color.
 
68
    virtual Color platformActiveSelectionBackgroundColor() const;
 
69
    virtual Color platformInactiveSelectionBackgroundColor() const;
 
70
    virtual Color platformActiveSelectionForegroundColor() const;
 
71
    virtual Color platformInactiveSelectionForegroundColor() const;
 
72
    virtual Color platformFocusRingColor() const;
 
73
 
 
74
    // To change the blink interval, override caretBlinkIntervalInternal instead of this one so that we may share layout test code an intercepts.
 
75
    virtual double caretBlinkInterval() const;
 
76
 
 
77
    // System fonts.
 
78
    virtual void systemFont(int propId, FontDescription&) const;
 
79
 
 
80
    virtual int minimumMenuListSize(RenderStyle*) const;
 
81
 
 
82
    virtual void setCheckboxSize(RenderStyle*) const;
 
83
 
 
84
    virtual void setRadioSize(RenderStyle*) const;
 
85
 
 
86
    virtual void adjustButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
 
87
 
 
88
    virtual bool paintTextArea(RenderObject*, const PaintInfo&, const IntRect&);
 
89
 
 
90
    virtual void adjustSearchFieldStyle(StyleResolver*, RenderStyle*, Element*) const;
 
91
    virtual bool paintSearchField(RenderObject*, const PaintInfo&, const IntRect&);
 
92
 
 
93
    virtual void adjustSearchFieldCancelButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
 
94
    virtual bool paintSearchFieldCancelButton(RenderObject*, const PaintInfo&, const IntRect&);
 
95
 
 
96
    virtual void adjustSearchFieldDecorationStyle(StyleResolver*, RenderStyle*, Element*) const;
 
97
 
 
98
    virtual void adjustSearchFieldResultsDecorationStyle(StyleResolver*, RenderStyle*, Element*) const;
 
99
    virtual bool paintSearchFieldResultsDecoration(RenderObject*, const PaintInfo&, const IntRect&);
 
100
 
 
101
    virtual void adjustSearchFieldResultsButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
 
102
    virtual bool paintSearchFieldResultsButton(RenderObject*, const PaintInfo&, const IntRect&);
 
103
 
 
104
    virtual bool paintMediaSliderTrack(RenderObject*, const PaintInfo&, const IntRect&);
 
105
    virtual bool paintMediaVolumeSliderTrack(RenderObject*, const PaintInfo&, const IntRect&);
 
106
    virtual void adjustSliderThumbSize(RenderStyle*, Element*) const;
 
107
    virtual bool paintMediaSliderThumb(RenderObject*, const PaintInfo&, const IntRect&);
 
108
    virtual bool paintMediaToggleClosedCaptionsButton(RenderObject*, const PaintInfo&, const IntRect&);
 
109
    virtual bool paintMediaVolumeSliderThumb(RenderObject*, const PaintInfo&, const IntRect&);
 
110
    virtual bool paintMediaPlayButton(RenderObject*, const PaintInfo&, const IntRect&);
 
111
    virtual bool paintMediaMuteButton(RenderObject*, const PaintInfo&, const IntRect&);
 
112
    virtual String formatMediaControlsTime(float time) const;
 
113
    virtual String formatMediaControlsCurrentTime(float currentTime, float duration) const;
 
114
    virtual String formatMediaControlsRemainingTime(float currentTime, float duration) const;
 
115
    virtual bool paintMediaFullscreenButton(RenderObject*, const PaintInfo&, const IntRect&);
 
116
 
 
117
    // MenuList refers to an unstyled menulist (meaning a menulist without
 
118
    // background-color or border set) and MenuListButton refers to a styled
 
119
    // menulist (a menulist with background-color or border set). They have
 
120
    // this distinction to support showing aqua style themes whenever they
 
121
    // possibly can, which is something we don't want to replicate.
 
122
    //
 
123
    // In short, we either go down the MenuList code path or the MenuListButton
 
124
    // codepath. We never go down both. And in both cases, they render the
 
125
    // entire menulist.
 
126
    virtual void adjustMenuListStyle(StyleResolver*, RenderStyle*, Element*) const;
 
127
    virtual void adjustMenuListButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
 
128
    virtual bool paintMenuListButton(RenderObject*, const PaintInfo&, const IntRect&);
 
129
 
 
130
#if ENABLE(PROGRESS_ELEMENT)
 
131
    virtual double animationRepeatIntervalForProgressBar(RenderProgress*) const;
 
132
    virtual double animationDurationForProgressBar(RenderProgress*) const;
 
133
#endif
 
134
 
 
135
    // These methods define the padding for the MenuList's inner block.
 
136
    virtual int popupInternalPaddingLeft(RenderStyle*) const;
 
137
    virtual int popupInternalPaddingRight(RenderStyle*) const;
 
138
    virtual int popupInternalPaddingTop(RenderStyle*) const;
 
139
    virtual int popupInternalPaddingBottom(RenderStyle*) const;
 
140
 
 
141
#if ENABLE(VIDEO)
 
142
    // Media controls
 
143
    virtual bool hasOwnDisabledStateHandlingFor(ControlPart) const { return true; }
 
144
    virtual bool usesVerticalVolumeSlider() const { return false; }
 
145
#endif
 
146
 
 
147
    // Provide a way to pass the default font size from the Settings object
 
148
    // to the render theme. FIXME: http://b/1129186 A cleaner way would be
 
149
    // to remove the default font size from this object and have callers
 
150
    // that need the value to get it directly from the appropriate Settings
 
151
    // object.
 
152
    static void setDefaultFontSize(int);
 
153
 
 
154
protected:
 
155
    virtual double caretBlinkIntervalInternal() const;
 
156
 
 
157
    virtual int menuListArrowPadding() const;
 
158
 
 
159
    static void setSizeIfAuto(RenderStyle*, const IntSize&);
 
160
 
 
161
#if ENABLE(PROGRESS_ELEMENT)
 
162
    IntRect determinateProgressValueRectFor(RenderProgress*, const IntRect&) const;
 
163
    IntRect indeterminateProgressValueRectFor(RenderProgress*, const IntRect&) const;
 
164
    IntRect progressValueRectFor(RenderProgress*, const IntRect&) const;
 
165
 
 
166
    class DirectionFlippingScope {
 
167
    public:
 
168
        DirectionFlippingScope(RenderObject*, const PaintInfo&, const IntRect&);
 
169
        ~DirectionFlippingScope();
 
170
 
 
171
    private:
 
172
        bool m_needsFlipping;
 
173
        const PaintInfo& m_paintInfo;
 
174
    };
 
175
#endif
 
176
 
 
177
private:
 
178
    virtual Color disabledTextColor(const Color& textColor, const Color&) const OVERRIDE { return textColor; }
 
179
    virtual bool shouldShowPlaceholderWhenFocused() const OVERRIDE;
 
180
 
 
181
#if ENABLE(DATALIST_ELEMENT)
 
182
    virtual LayoutUnit sliderTickSnappingThreshold() const OVERRIDE;
 
183
#endif
 
184
#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
 
185
    virtual bool supportsCalendarPicker(const AtomicString& type) const OVERRIDE;
 
186
#endif
 
187
 
 
188
    int menuListInternalPadding(RenderStyle*, int paddingType) const;
 
189
    bool paintMediaButtonInternal(GraphicsContext*, const IntRect&, Image*);
 
190
    IntRect convertToPaintingRect(RenderObject* inputRenderer, const RenderObject* partRenderer, LayoutRect partRect, const IntRect& localOffset) const;
 
191
 
 
192
    static const RGBA32 defaultTapHighlightColor = 0x2e000000; // 18% black.
 
193
};
 
194
 
 
195
} // namespace WebCore
 
196
 
 
197
#endif // RenderThemeChromiumSkia_h