1*ddde725dSArmin Le Grand /**************************************************************
2*ddde725dSArmin Le Grand  *
3*ddde725dSArmin Le Grand  * Licensed to the Apache Software Foundation (ASF) under one
4*ddde725dSArmin Le Grand  * or more contributor license agreements.  See the NOTICE file
5*ddde725dSArmin Le Grand  * distributed with this work for additional information
6*ddde725dSArmin Le Grand  * regarding copyright ownership.  The ASF licenses this file
7*ddde725dSArmin Le Grand  * to you under the Apache License, Version 2.0 (the
8*ddde725dSArmin Le Grand  * "License"); you may not use this file except in compliance
9*ddde725dSArmin Le Grand  * with the License.  You may obtain a copy of the License at
10*ddde725dSArmin Le Grand  *
11*ddde725dSArmin Le Grand  *   http://www.apache.org/licenses/LICENSE-2.0
12*ddde725dSArmin Le Grand  *
13*ddde725dSArmin Le Grand  * Unless required by applicable law or agreed to in writing,
14*ddde725dSArmin Le Grand  * software distributed under the License is distributed on an
15*ddde725dSArmin Le Grand  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*ddde725dSArmin Le Grand  * KIND, either express or implied.  See the License for the
17*ddde725dSArmin Le Grand  * specific language governing permissions and limitations
18*ddde725dSArmin Le Grand  * under the License.
19*ddde725dSArmin Le Grand  *
20*ddde725dSArmin Le Grand  *************************************************************/
21*ddde725dSArmin Le Grand 
22*ddde725dSArmin Le Grand #ifndef INCLUDED_SVGIO_SVGREADER_SVGRECTNODE_HXX
23*ddde725dSArmin Le Grand #define INCLUDED_SVGIO_SVGREADER_SVGRECTNODE_HXX
24*ddde725dSArmin Le Grand 
25*ddde725dSArmin Le Grand #include <svgio/svgiodllapi.h>
26*ddde725dSArmin Le Grand #include <svgio/svgreader/svgnode.hxx>
27*ddde725dSArmin Le Grand #include <svgio/svgreader/svgstyleattributes.hxx>
28*ddde725dSArmin Le Grand 
29*ddde725dSArmin Le Grand //////////////////////////////////////////////////////////////////////////////
30*ddde725dSArmin Le Grand 
31*ddde725dSArmin Le Grand namespace svgio
32*ddde725dSArmin Le Grand {
33*ddde725dSArmin Le Grand     namespace svgreader
34*ddde725dSArmin Le Grand     {
35*ddde725dSArmin Le Grand         class SvgRectNode : public SvgNode
36*ddde725dSArmin Le Grand         {
37*ddde725dSArmin Le Grand         private:
38*ddde725dSArmin Le Grand             /// use styles
39*ddde725dSArmin Le Grand             SvgStyleAttributes          maSvgStyleAttributes;
40*ddde725dSArmin Le Grand 
41*ddde725dSArmin Le Grand             /// variable scan values, dependent of given XAttributeList
42*ddde725dSArmin Le Grand             SvgNumber               maX;
43*ddde725dSArmin Le Grand             SvgNumber               maY;
44*ddde725dSArmin Le Grand             SvgNumber               maWidth;
45*ddde725dSArmin Le Grand             SvgNumber               maHeight;
46*ddde725dSArmin Le Grand             SvgNumber               maRx;
47*ddde725dSArmin Le Grand             SvgNumber               maRy;
48*ddde725dSArmin Le Grand             basegfx::B2DHomMatrix*  mpaTransform;
49*ddde725dSArmin Le Grand 
50*ddde725dSArmin Le Grand         public:
51*ddde725dSArmin Le Grand             SvgRectNode(
52*ddde725dSArmin Le Grand                 SvgDocument& rDocument,
53*ddde725dSArmin Le Grand                 SvgNode* pParent);
54*ddde725dSArmin Le Grand             virtual ~SvgRectNode();
55*ddde725dSArmin Le Grand 
56*ddde725dSArmin Le Grand             virtual const SvgStyleAttributes* getSvgStyleAttributes() const;
57*ddde725dSArmin Le Grand             virtual void parseAttribute(const rtl::OUString& rTokenName, SVGToken aSVGToken, const rtl::OUString& aContent);
58*ddde725dSArmin Le Grand             virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DSequence& rTarget, bool bReferenced) const;
59*ddde725dSArmin Le Grand 
60*ddde725dSArmin Le Grand             /// x content, set if found in current context
getX() const61*ddde725dSArmin Le Grand             const SvgNumber& getX() const { return maX; }
setX(const SvgNumber & rX=SvgNumber ())62*ddde725dSArmin Le Grand             void setX(const SvgNumber& rX = SvgNumber()) { maX = rX; }
63*ddde725dSArmin Le Grand 
64*ddde725dSArmin Le Grand             /// y content, set if found in current context
getY() const65*ddde725dSArmin Le Grand             const SvgNumber& getY() const { return maY; }
setY(const SvgNumber & rY=SvgNumber ())66*ddde725dSArmin Le Grand             void setY(const SvgNumber& rY = SvgNumber()) { maY = rY; }
67*ddde725dSArmin Le Grand 
68*ddde725dSArmin Le Grand             /// width content, set if found in current context
getWidth() const69*ddde725dSArmin Le Grand             const SvgNumber& getWidth() const { return maWidth; }
setWidth(const SvgNumber & rWidth=SvgNumber ())70*ddde725dSArmin Le Grand             void setWidth(const SvgNumber& rWidth = SvgNumber()) { maWidth = rWidth; }
71*ddde725dSArmin Le Grand 
72*ddde725dSArmin Le Grand             /// height content, set if found in current context
getHeight() const73*ddde725dSArmin Le Grand             const SvgNumber& getHeight() const { return maHeight; }
setHeight(const SvgNumber & rHeight=SvgNumber ())74*ddde725dSArmin Le Grand             void setHeight(const SvgNumber& rHeight = SvgNumber()) { maHeight = rHeight; }
75*ddde725dSArmin Le Grand 
76*ddde725dSArmin Le Grand             /// Rx content, set if found in current context
getRx() const77*ddde725dSArmin Le Grand             const SvgNumber& getRx() const { return maRx; }
setRx(const SvgNumber & rRx=SvgNumber ())78*ddde725dSArmin Le Grand             void setRx(const SvgNumber& rRx = SvgNumber()) { maRx = rRx; }
79*ddde725dSArmin Le Grand 
80*ddde725dSArmin Le Grand             /// Ry content, set if found in current context
getRy() const81*ddde725dSArmin Le Grand             const SvgNumber& getRy() const { return maRy; }
setRy(const SvgNumber & rRy=SvgNumber ())82*ddde725dSArmin Le Grand             void setRy(const SvgNumber& rRy = SvgNumber()) { maRy = rRy; }
83*ddde725dSArmin Le Grand 
84*ddde725dSArmin Le Grand             /// transform content, set if found in current context
getTransform() const85*ddde725dSArmin Le Grand             const basegfx::B2DHomMatrix* getTransform() const { return mpaTransform; }
setTransform(const basegfx::B2DHomMatrix * pMatrix=0)86*ddde725dSArmin Le Grand             void setTransform(const basegfx::B2DHomMatrix* pMatrix = 0) { if(mpaTransform) delete mpaTransform; mpaTransform = 0; if(pMatrix) mpaTransform = new basegfx::B2DHomMatrix(*pMatrix); }
87*ddde725dSArmin Le Grand         };
88*ddde725dSArmin Le Grand     } // end of namespace svgreader
89*ddde725dSArmin Le Grand } // end of namespace svgio
90*ddde725dSArmin Le Grand 
91*ddde725dSArmin Le Grand //////////////////////////////////////////////////////////////////////////////
92*ddde725dSArmin Le Grand 
93*ddde725dSArmin Le Grand #endif //INCLUDED_SVGIO_SVGREADER_SVGRECTNODE_HXX
94*ddde725dSArmin Le Grand 
95*ddde725dSArmin Le Grand // eof
96