File indexing completed on 2024-04-28 15:24:43

0001 /*
0002     Copyright (C) 2007 Rob Buis <buis@kde.org>
0003 
0004     This file is part of the KDE project
0005 
0006     This library is free software; you can redistribute it and/or
0007     modify it under the terms of the GNU Library General Public
0008     License as published by the Free Software Foundation; either
0009     version 2 of the License, or (at your option) any later version.
0010 
0011     This library is distributed in the hope that it will be useful,
0012     but WITHOUT ANY WARRANTY; without even the implied warranty of
0013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0014     Library General Public License for more details.
0015 
0016     You should have received a copy of the GNU Library General Public License
0017     along with this library; see the file COPYING.LIB.  If not, write to
0018     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0019     Boston, MA 02110-1301, USA.
0020 */
0021 
0022 #ifndef SVGViewSpec_h
0023 #define SVGViewSpec_h
0024 
0025 #if ENABLE(SVG)
0026 #include "SVGFitToViewBox.h"
0027 #include "SVGZoomAndPan.h"
0028 
0029 #include <wtf/RefPtr.h>
0030 
0031 namespace WebCore
0032 {
0033 
0034 class SVGElement;
0035 class SVGSVGElement;
0036 class SVGTransformList;
0037 
0038 class SVGViewSpec : public SVGFitToViewBox,
0039     public SVGZoomAndPan
0040 {
0041 public:
0042     SVGViewSpec(const SVGSVGElement *);
0043     virtual ~SVGViewSpec();
0044 
0045     bool parseViewSpec(const String &);
0046 
0047     void setTransform(const String &);
0048     SVGTransformList *transform() const
0049     {
0050         return m_transform.get();
0051     }
0052 
0053     void setViewBoxString(const String &);
0054 
0055     void setPreserveAspectRatioString(const String &);
0056 
0057     void setViewTargetString(const String &);
0058     String viewTargetString() const
0059     {
0060         return m_viewTargetString;
0061     }
0062     SVGElement *viewTarget() const;
0063 
0064 protected:
0065     const SVGElement *contextElement() const override;
0066 
0067 private:
0068     mutable RefPtr<SVGTransformList> m_transform;
0069     const SVGSVGElement *m_contextElement;
0070     String m_viewTargetString;
0071 };
0072 
0073 } // namespace WebCore
0074 
0075 #endif // ENABLE(SVG)
0076 #endif