Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / svg / SVGTextPositioningElement.h
1 /*
2  * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org>
3  * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public License
16  * along with this library; see the file COPYING.LIB.  If not, write to
17  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  * Boston, MA 02110-1301, USA.
19  */
20
21 #ifndef SVGTextPositioningElement_h
22 #define SVGTextPositioningElement_h
23
24 #include "core/SVGNames.h"
25 #include "core/svg/SVGAnimatedLengthList.h"
26 #include "core/svg/SVGAnimatedNumberList.h"
27 #include "core/svg/SVGTextContentElement.h"
28
29 namespace blink {
30
31 class SVGTextPositioningElement : public SVGTextContentElement {
32 public:
33     static SVGTextPositioningElement* elementFromRenderer(RenderObject*);
34
35     SVGAnimatedLengthList* x() { return m_x.get(); }
36     SVGAnimatedLengthList* y() { return m_y.get(); }
37     SVGAnimatedLengthList* dx() { return m_dx.get(); }
38     SVGAnimatedLengthList* dy() { return m_dy.get(); }
39     SVGAnimatedNumberList* rotate() { return m_rotate.get(); }
40
41 protected:
42     SVGTextPositioningElement(const QualifiedName&, Document&);
43
44     bool isSupportedAttribute(const QualifiedName&);
45     virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE FINAL;
46     virtual void svgAttributeChanged(const QualifiedName&) OVERRIDE FINAL;
47     virtual bool isTextPositioning() const OVERRIDE FINAL { return true; }
48
49     RefPtr<SVGAnimatedLengthList> m_x;
50     RefPtr<SVGAnimatedLengthList> m_y;
51     RefPtr<SVGAnimatedLengthList> m_dx;
52     RefPtr<SVGAnimatedLengthList> m_dy;
53     RefPtr<SVGAnimatedNumberList> m_rotate;
54 };
55
56 inline bool isSVGTextPositioningElement(const SVGElement& element)
57 {
58     return element.isTextPositioning();
59 }
60
61 DEFINE_SVGELEMENT_TYPE_CASTS_WITH_FUNCTION(SVGTextPositioningElement);
62
63 } // namespace blink
64
65 #endif