~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to src/3rdparty/webkit/WebCore/rendering/RenderSlider.h

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2009-11-02 18:30:08 UTC
  • mfrom: (1.2.2 upstream)
  • mto: (15.2.5 experimental)
  • mto: This revision was merged to the branch mainline in revision 88.
  • Revision ID: james.westby@ubuntu.com-20091102183008-b6a4gcs128mvfb3m
Tags: upstream-4.6.0~beta1
ImportĀ upstreamĀ versionĀ 4.6.0~beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/**
2
 
 *
3
 
 * Copyright (C) 2006 Apple Computer, Inc.
 
1
/*
 
2
 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
4
3
 *
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
26
25
 
27
26
namespace WebCore {
28
27
 
29
 
    class HTMLDivElement;
30
28
    class HTMLInputElement;
31
 
    class HTMLSliderThumbElement;
32
29
    class MouseEvent;
 
30
    class SliderThumbElement;
33
31
    
34
32
    class RenderSlider : public RenderBlock {
35
33
    public:
36
34
        RenderSlider(HTMLInputElement*);
37
 
        ~RenderSlider();
38
 
 
 
35
        virtual ~RenderSlider();
 
36
 
 
37
        void forwardEvent(Event*);
 
38
        bool inDragMode() const;
 
39
        IntRect thumbRect();
 
40
 
 
41
    private:
39
42
        virtual const char* renderName() const { return "RenderSlider"; }
40
43
        virtual bool isSlider() const { return true; }
41
44
 
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();
46
 
        
 
49
 
47
50
        bool mouseEventIsInThumb(MouseEvent*);
 
51
        FloatPoint mouseEventOffsetToThumb(MouseEvent*);
48
52
 
49
53
        void setValueForPosition(int position);
50
 
        double setPositionFromValue(bool inLayout = false);
 
54
        void setPositionFromValue();
51
55
        int positionForOffset(const IntPoint&);
52
56
 
53
 
        void valueChanged();
54
 
        
55
57
        int currentPosition();
56
 
        void setCurrentPosition(int pos);        
57
 
        
58
 
        void forwardEvent(Event*);
59
 
        bool inDragMode() const;
60
 
 
61
 
    protected:
62
 
        virtual void styleDidChange(RenderStyle::Diff, const RenderStyle* oldStyle);
63
 
    
64
 
    private:
65
 
        PassRefPtr<RenderStyle> createThumbStyle(const RenderStyle* parentStyle, const RenderStyle* oldStyle = 0);
 
58
 
 
59
        virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
 
60
 
 
61
        PassRefPtr<RenderStyle> createThumbStyle(const RenderStyle* parentStyle);
 
62
 
66
63
        int trackSize();
67
64
 
68
 
        RefPtr<HTMLSliderThumbElement> m_thumb;
69
 
};
 
65
        RefPtr<SliderThumbElement> m_thumb;
 
66
 
 
67
        friend class SliderThumbElement;
 
68
    };
 
69
 
 
70
    inline RenderSlider* toRenderSlider(RenderObject* object)
 
71
    {
 
72
        ASSERT(!object || object->isSlider());
 
73
        return static_cast<RenderSlider*>(object);
 
74
    }
 
75
 
 
76
    // This will catch anyone doing an unnecessary cast.
 
77
    void toRenderSlider(const RenderSlider*);
70
78
 
71
79
} // namespace WebCore
72
80