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

« back to all changes in this revision

Viewing changes to Source/WebCore/rendering/RenderThemeChromiumWin.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) 2008, 2009 Google, Inc.
 
6
 *
 
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.
 
11
 *
 
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.
 
16
 *
 
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.
 
21
 *
 
22
 */
 
23
 
 
24
#ifndef RenderThemeChromiumWin_h
 
25
#define RenderThemeChromiumWin_h
 
26
 
 
27
#include "RenderThemeChromiumSkia.h"
 
28
 
 
29
#if WIN32
 
30
typedef void* HANDLE;
 
31
typedef struct HINSTANCE__* HINSTANCE;
 
32
typedef HINSTANCE HMODULE;
 
33
#endif
 
34
 
 
35
namespace WebCore {
 
36
 
 
37
    struct ThemeData {
 
38
        ThemeData() : m_part(0), m_state(0), m_classicState(0) {}
 
39
 
 
40
        unsigned m_part;
 
41
        unsigned m_state;
 
42
        unsigned m_classicState;
 
43
    };
 
44
 
 
45
    class RenderThemeChromiumWin : public RenderThemeChromiumSkia {
 
46
    public:
 
47
        static PassRefPtr<RenderTheme> create();
 
48
 
 
49
        // A method asking if the theme is able to draw the focus ring.
 
50
        virtual bool supportsFocusRing(const RenderStyle*) const;
 
51
 
 
52
        // The platform selection color.
 
53
        virtual Color platformActiveSelectionBackgroundColor() const;
 
54
        virtual Color platformInactiveSelectionBackgroundColor() const;
 
55
        virtual Color platformActiveSelectionForegroundColor() const;
 
56
        virtual Color platformInactiveSelectionForegroundColor() const;
 
57
        virtual Color platformActiveTextSearchHighlightColor() const;
 
58
        virtual Color platformInactiveTextSearchHighlightColor() const;
 
59
 
 
60
        virtual Color systemColor(int cssValueId) const;
 
61
 
 
62
#if ENABLE(DATALIST_ELEMENT)
 
63
        virtual IntSize sliderTickSize() const OVERRIDE;
 
64
        virtual int sliderTickOffsetFromTrackCenter() const OVERRIDE;
 
65
#endif
 
66
        virtual void adjustSliderThumbSize(RenderStyle*, Element*) const;
 
67
 
 
68
        // Various paint functions.
 
69
        virtual bool paintCheckbox(RenderObject*, const PaintInfo&, const IntRect&);
 
70
        virtual bool paintRadio(RenderObject*, const PaintInfo&, const IntRect&);
 
71
        virtual bool paintButton(RenderObject*, const PaintInfo&, const IntRect&);
 
72
        virtual bool paintTextField(RenderObject*, const PaintInfo&, const IntRect&);
 
73
        virtual bool paintSliderTrack(RenderObject*, const PaintInfo&, const IntRect&);
 
74
        virtual bool paintSliderThumb(RenderObject*, const PaintInfo&, const IntRect&);
 
75
 
 
76
        // MenuList refers to an unstyled menulist (meaning a menulist without
 
77
        // background-color or border set) and MenuListButton refers to a styled
 
78
        // menulist (a menulist with background-color or border set). They have
 
79
        // this distinction to support showing aqua style themes whenever they
 
80
        // possibly can, which is something we don't want to replicate.
 
81
        //
 
82
        // In short, we either go down the MenuList code path or the MenuListButton
 
83
        // codepath. We never go down both. And in both cases, they render the
 
84
        // entire menulist.
 
85
        virtual bool paintMenuList(RenderObject*, const PaintInfo&, const IntRect&);
 
86
 
 
87
        virtual void adjustInnerSpinButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
 
88
        virtual bool paintInnerSpinButton(RenderObject*, const PaintInfo&, const IntRect&);
 
89
 
 
90
#if ENABLE(PROGRESS_ELEMENT)
 
91
        virtual double animationRepeatIntervalForProgressBar(RenderProgress*) const;
 
92
        virtual double animationDurationForProgressBar(RenderProgress*) const;
 
93
        virtual void adjustProgressBarStyle(StyleResolver*, RenderStyle*, Element*) const;
 
94
        virtual bool paintProgressBar(RenderObject*, const PaintInfo&, const IntRect&);
 
95
#endif
 
96
 
 
97
        virtual bool shouldOpenPickerWithF4Key() const OVERRIDE;
 
98
 
 
99
    protected:
 
100
        virtual double caretBlinkIntervalInternal() const;
 
101
 
 
102
    private:
 
103
        enum ControlSubPart {
 
104
            None,
 
105
            SpinButtonDown,
 
106
            SpinButtonUp,
 
107
        };
 
108
 
 
109
        RenderThemeChromiumWin() { }
 
110
        virtual ~RenderThemeChromiumWin() { }
 
111
 
 
112
        unsigned determineState(RenderObject*, ControlSubPart = None);
 
113
        unsigned determineSliderThumbState(RenderObject*);
 
114
        unsigned determineClassicState(RenderObject*, ControlSubPart = None);
 
115
 
 
116
        ThemeData getThemeData(RenderObject*, ControlSubPart = None);
 
117
 
 
118
        bool paintTextFieldInternal(RenderObject*, const PaintInfo&, const IntRect&, bool);
 
119
    };
 
120
 
 
121
} // namespace WebCore
 
122
 
 
123
#endif