Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #ifndef INCLUDED_SVGIO_SVGREADER_SVGSVGNODE_HXX
21 : #define INCLUDED_SVGIO_SVGREADER_SVGSVGNODE_HXX
22 :
23 : #include <svgio/svgreader/svgstyleattributes.hxx>
24 :
25 : //////////////////////////////////////////////////////////////////////////////
26 :
27 : namespace svgio
28 : {
29 : namespace svgreader
30 : {
31 : class SvgSvgNode : public SvgNode
32 : {
33 : private:
34 : /// use styles
35 : SvgStyleAttributes maSvgStyleAttributes;
36 :
37 : /// variable scan values, dependent of given XAttributeList
38 : basegfx::B2DRange* mpViewBox;
39 : SvgAspectRatio maSvgAspectRatio;
40 : SvgNumber maX;
41 : SvgNumber maY;
42 : SvgNumber maWidth;
43 : SvgNumber maHeight;
44 : SvgNumber maVersion;
45 :
46 : public:
47 : SvgSvgNode(
48 : SvgDocument& rDocument,
49 : SvgNode* pParent);
50 : virtual ~SvgSvgNode();
51 :
52 : virtual const SvgStyleAttributes* getSvgStyleAttributes() const;
53 : virtual void parseAttribute(const rtl::OUString& rTokenName, SVGToken aSVGToken, const rtl::OUString& aContent);
54 : virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DSequence& rTarget, bool bReferenced) const;
55 :
56 : /// InfoProvider support for % values
57 : virtual const basegfx::B2DRange* getCurrentViewPort() const;
58 :
59 : /// viewBox content
60 0 : const basegfx::B2DRange* getViewBox() const { return mpViewBox; }
61 0 : void setViewBox(const basegfx::B2DRange* pViewBox = 0) { if(mpViewBox) delete mpViewBox; mpViewBox = 0; if(pViewBox) mpViewBox = new basegfx::B2DRange(*pViewBox); }
62 :
63 : /// SvgAspectRatio content
64 0 : const SvgAspectRatio& getSvgAspectRatio() const { return maSvgAspectRatio; }
65 0 : void setSvgAspectRatio(const SvgAspectRatio& rSvgAspectRatio = SvgAspectRatio()) { maSvgAspectRatio = rSvgAspectRatio; }
66 :
67 : /// x content
68 0 : const SvgNumber& getX() const { return maX; }
69 0 : void setX(const SvgNumber& rX = SvgNumber()) { maX = rX; }
70 :
71 : /// y content
72 0 : const SvgNumber& getY() const { return maY; }
73 0 : void setY(const SvgNumber& rY = SvgNumber()) { maY = rY; }
74 :
75 : /// width content
76 0 : const SvgNumber& getWidth() const { return maWidth; }
77 0 : void setWidth(const SvgNumber& rWidth = SvgNumber()) { maWidth = rWidth; }
78 :
79 : /// height content
80 0 : const SvgNumber& getHeight() const { return maHeight; }
81 0 : void setHeight(const SvgNumber& rHeight = SvgNumber()) { maHeight = rHeight; }
82 :
83 : /// version content
84 : const SvgNumber& getVersion() const { return maVersion; }
85 0 : void setVersion(const SvgNumber& rVersion = SvgNumber()) { maVersion = rVersion; }
86 : };
87 : } // end of namespace svgreader
88 : } // end of namespace svgio
89 :
90 : //////////////////////////////////////////////////////////////////////////////
91 :
92 : #endif //INCLUDED_SVGIO_SVGREADER_SVGSVGNODE_HXX
93 :
94 : // eof
95 :
96 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|