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_SVGLINENODE_HXX
21 : #define INCLUDED_SVGIO_SVGREADER_SVGLINENODE_HXX
22 :
23 : #include <svgio/svgreader/svgnode.hxx>
24 : #include <svgio/svgreader/svgstyleattributes.hxx>
25 :
26 : //////////////////////////////////////////////////////////////////////////////
27 :
28 : namespace svgio
29 : {
30 : namespace svgreader
31 : {
32 : class SvgLineNode : public SvgNode
33 : {
34 : private:
35 : /// use styles
36 : SvgStyleAttributes maSvgStyleAttributes;
37 :
38 : /// variable scan values, dependent of given XAttributeList
39 : SvgNumber maX1;
40 : SvgNumber maY1;
41 : SvgNumber maX2;
42 : SvgNumber maY2;
43 : basegfx::B2DHomMatrix* mpaTransform;
44 :
45 : public:
46 : SvgLineNode(
47 : SvgDocument& rDocument,
48 : SvgNode* pParent);
49 : virtual ~SvgLineNode();
50 :
51 : virtual const SvgStyleAttributes* getSvgStyleAttributes() const;
52 : virtual void parseAttribute(const rtl::OUString& rTokenName, SVGToken aSVGToken, const rtl::OUString& aContent);
53 : virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DSequence& rTarget, bool bReferenced) const;
54 :
55 : /// X1 content, set if found in current context
56 0 : const SvgNumber& getX1() const { return maX1; }
57 0 : void setX1(const SvgNumber& rX1 = SvgNumber()) { maX1 = rX1; }
58 :
59 : /// Y1 content, set if found in current context
60 0 : const SvgNumber& getY1() const { return maY1; }
61 0 : void setY1(const SvgNumber& rY1 = SvgNumber()) { maY1 = rY1; }
62 :
63 : /// X2 content, set if found in current context
64 0 : const SvgNumber& getX2() const { return maX2; }
65 0 : void setX2(const SvgNumber& rX2 = SvgNumber()) { maX2 = rX2; }
66 :
67 : /// Y2 content, set if found in current context
68 0 : const SvgNumber& getY2() const { return maY2; }
69 0 : void setY2(const SvgNumber& rY2 = SvgNumber()) { maY2 = rY2; }
70 :
71 : /// transform content, set if found in current context
72 0 : const basegfx::B2DHomMatrix* getTransform() const { return mpaTransform; }
73 0 : void setTransform(const basegfx::B2DHomMatrix* pMatrix = 0) { if(mpaTransform) delete mpaTransform; mpaTransform = 0; if(pMatrix) mpaTransform = new basegfx::B2DHomMatrix(*pMatrix); }
74 : };
75 : } // end of namespace svgreader
76 : } // end of namespace svgio
77 :
78 : //////////////////////////////////////////////////////////////////////////////
79 :
80 : #endif //INCLUDED_SVGIO_SVGREADER_SVGLINENODE_HXX
81 :
82 : // eof
83 :
84 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|