• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2007 Rob Buis <buis@kde.org>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public License
15  * along with this library; see the file COPYING.LIB.  If not, write to
16  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  * Boston, MA 02110-1301, USA.
18  */
19 
20 #ifndef SVGViewSpec_h
21 #define SVGViewSpec_h
22 
23 #if ENABLE(SVG)
24 #include "SVGAnimatedPreserveAspectRatio.h"
25 #include "SVGAnimatedRect.h"
26 #include "SVGFitToViewBox.h"
27 #include "SVGTransformList.h"
28 #include "SVGZoomAndPan.h"
29 
30 namespace WebCore {
31 
32 class SVGElement;
33 
34 class SVGViewSpec : public SVGFitToViewBox,
35                     public SVGZoomAndPan {
36     WTF_MAKE_NONCOPYABLE(SVGViewSpec);
37 public:
38     SVGViewSpec(SVGElement*);
39 
40     bool parseViewSpec(const String&);
41 
42     void setTransform(const String&);
transform()43     SVGTransformList transform() const { return m_transform; }
44 
45     void setViewBoxString(const String&);
46 
47     void setPreserveAspectRatioString(const String&);
48 
49     void setViewTargetString(const String&);
viewTargetString()50     String viewTargetString() const { return m_viewTargetString; }
51     SVGElement* viewTarget() const;
52 
contextElement()53     SVGElement* contextElement() const { return const_cast<SVGElement*>(m_contextElement); }
54 
55 private:
56     SVGElement* m_contextElement;
57 
58     // Animated property declarations
59 
60     // SVGFitToViewBox
61     DECLARE_ANIMATED_RECT(ViewBox, viewBox)
62     DECLARE_ANIMATED_PRESERVEASPECTRATIO(PreserveAspectRatio, preserveAspectRatio)
63 
64     SVGTransformList m_transform;
65     String m_viewTargetString;
66 };
67 
68 } // namespace WebCore
69 
70 #endif // ENABLE(SVG)
71 #endif
72