3
* Copyright (C) 2006 Apple Computer, Inc.
2
* Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
5
4
* This library is free software; you can redistribute it and/or
6
5
* modify it under the terms of the GNU Library General Public
27
26
namespace WebCore {
30
28
class HTMLInputElement;
31
class HTMLSliderThumbElement;
30
class SliderThumbElement;
34
32
class RenderSlider : public RenderBlock {
36
34
RenderSlider(HTMLInputElement*);
35
virtual ~RenderSlider();
37
void forwardEvent(Event*);
38
bool inDragMode() const;
39
42
virtual const char* renderName() const { return "RenderSlider"; }
40
43
virtual bool isSlider() const { return true; }
42
virtual int baselinePosition( bool, bool ) const;
45
virtual int baselinePosition(bool, bool) const;
43
46
virtual void calcPrefWidths();
44
47
virtual void layout();
45
48
virtual void updateFromElement();
47
50
bool mouseEventIsInThumb(MouseEvent*);
51
FloatPoint mouseEventOffsetToThumb(MouseEvent*);
49
53
void setValueForPosition(int position);
50
double setPositionFromValue(bool inLayout = false);
54
void setPositionFromValue();
51
55
int positionForOffset(const IntPoint&);
55
57
int currentPosition();
56
void setCurrentPosition(int pos);
58
void forwardEvent(Event*);
59
bool inDragMode() const;
62
virtual void styleDidChange(RenderStyle::Diff, const RenderStyle* oldStyle);
65
PassRefPtr<RenderStyle> createThumbStyle(const RenderStyle* parentStyle, const RenderStyle* oldStyle = 0);
59
virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
61
PassRefPtr<RenderStyle> createThumbStyle(const RenderStyle* parentStyle);
68
RefPtr<HTMLSliderThumbElement> m_thumb;
65
RefPtr<SliderThumbElement> m_thumb;
67
friend class SliderThumbElement;
70
inline RenderSlider* toRenderSlider(RenderObject* object)
72
ASSERT(!object || object->isSlider());
73
return static_cast<RenderSlider*>(object);
76
// This will catch anyone doing an unnecessary cast.
77
void toRenderSlider(const RenderSlider*);
71
79
} // namespace WebCore