Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / Source / core / paint / ThemePainter.h
blob3be991e7c44148d5a851770e5dde13e629b3dca1
1 /*
2 * This file is part of the theme implementation for form controls in WebCore.
4 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Computer, Inc.
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
16 * You should have received a copy of the GNU Library General Public License
17 * along with this library; see the file COPYING.LIB. If not, write to
18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
23 #ifndef ThemePainter_h
24 #define ThemePainter_h
26 #include "platform/ThemeTypes.h"
27 #include "wtf/Allocator.h"
29 namespace blink {
31 class IntRect;
32 class LayoutObject;
34 struct PaintInfo;
36 class ThemePainter {
37 DISALLOW_ALLOCATION();
38 public:
39 // This method is called to paint the widget as a background of the LayoutObject. A widget's foreground, e.g., the
40 // text of a button, is always rendered by the engine itself. The boolean return value indicates
41 // whether the CSS border/background should also be painted.
42 bool paint(LayoutObject*, const PaintInfo&, const IntRect&);
43 bool paintBorderOnly(LayoutObject*, const PaintInfo&, const IntRect&);
44 bool paintDecorations(LayoutObject*, const PaintInfo&, const IntRect&);
46 virtual bool paintCapsLockIndicator(LayoutObject*, const PaintInfo&, const IntRect&) { return 0; }
47 void paintSliderTicks(LayoutObject*, const PaintInfo&, const IntRect&);
49 protected:
50 #if !USE(NEW_THEME)
51 virtual bool paintCheckbox(LayoutObject*, const PaintInfo&, const IntRect&) { return true; }
52 virtual bool paintRadio(LayoutObject*, const PaintInfo&, const IntRect&) { return true; }
53 virtual bool paintButton(LayoutObject*, const PaintInfo&, const IntRect&) { return true; }
54 virtual bool paintInnerSpinButton(LayoutObject*, const PaintInfo&, const IntRect&) { return true; }
55 #endif
57 virtual bool paintTextField(LayoutObject*, const PaintInfo&, const IntRect&) { return true; }
58 virtual bool paintTextArea(LayoutObject*, const PaintInfo&, const IntRect&) { return true; }
59 virtual bool paintMenuList(LayoutObject*, const PaintInfo&, const IntRect&) { return true; }
60 virtual bool paintMenuListButton(LayoutObject*, const PaintInfo&, const IntRect&) { return true; }
61 virtual bool paintMeter(LayoutObject*, const PaintInfo&, const IntRect&);
62 virtual bool paintProgressBar(LayoutObject*, const PaintInfo&, const IntRect&) { return true; }
63 virtual bool paintSliderTrack(LayoutObject*, const PaintInfo&, const IntRect&) { return true; }
64 virtual bool paintSliderThumb(LayoutObject*, const PaintInfo&, const IntRect&) { return true; }
65 virtual bool paintSearchField(LayoutObject*, const PaintInfo&, const IntRect&) { return true; }
66 virtual bool paintSearchFieldCancelButton(LayoutObject*, const PaintInfo&, const IntRect&) { return true; }
67 virtual bool paintSearchFieldDecoration(LayoutObject*, const PaintInfo&, const IntRect&) { return true; }
68 virtual bool paintSearchFieldResultsDecoration(LayoutObject*, const PaintInfo&, const IntRect&) { return true; }
70 bool paintUsingFallbackTheme(LayoutObject*, const PaintInfo&, const IntRect&);
71 bool paintCheckboxUsingFallbackTheme(LayoutObject*, const PaintInfo&, const IntRect&);
72 bool paintRadioUsingFallbackTheme(LayoutObject*, const PaintInfo&, const IntRect&);
75 } // namespace blink
77 #endif // ThemePainter_h