xref: /aoo41x/main/xmloff/inc/xexptran.hxx (revision 1f882ec4)
1ecfe53c5SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3ecfe53c5SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4ecfe53c5SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5ecfe53c5SAndrew Rist  * distributed with this work for additional information
6ecfe53c5SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7ecfe53c5SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8ecfe53c5SAndrew Rist  * "License"); you may not use this file except in compliance
9ecfe53c5SAndrew Rist  * with the License.  You may obtain a copy of the License at
10ecfe53c5SAndrew Rist  *
11ecfe53c5SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12ecfe53c5SAndrew Rist  *
13ecfe53c5SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14ecfe53c5SAndrew Rist  * software distributed under the License is distributed on an
15ecfe53c5SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16ecfe53c5SAndrew Rist  * KIND, either express or implied.  See the License for the
17ecfe53c5SAndrew Rist  * specific language governing permissions and limitations
18ecfe53c5SAndrew Rist  * under the License.
19ecfe53c5SAndrew Rist  *
20ecfe53c5SAndrew Rist  *************************************************************/
21ecfe53c5SAndrew Rist 
22ecfe53c5SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _XEXPTRANSFORM_HXX
25cdf0e10cSrcweir #define _XEXPTRANSFORM_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <rtl/ustring.hxx>
28cdf0e10cSrcweir #include <com/sun/star/drawing/PointSequenceSequence.hpp>
29cdf0e10cSrcweir #include <com/sun/star/drawing/PointSequence.hpp>
30cdf0e10cSrcweir #include <com/sun/star/awt/Size.hpp>
31cdf0e10cSrcweir #include <com/sun/star/drawing/FlagSequenceSequence.hpp>
32cdf0e10cSrcweir #include <com/sun/star/drawing/FlagSequence.hpp>
33cdf0e10cSrcweir #include <com/sun/star/drawing/HomogenMatrix.hpp>
34cdf0e10cSrcweir #include <tools/mapunit.hxx>
35cdf0e10cSrcweir 
36cdf0e10cSrcweir #include <vector>
37cdf0e10cSrcweir 
38cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
39cdf0e10cSrcweir // predeclarations
40cdf0e10cSrcweir 
41cdf0e10cSrcweir struct ImpSdXMLExpTransObj2DBase;
42cdf0e10cSrcweir struct ImpSdXMLExpTransObj3DBase;
43cdf0e10cSrcweir class SvXMLUnitConverter;
44cdf0e10cSrcweir 
45cdf0e10cSrcweir namespace basegfx
46cdf0e10cSrcweir {
47cdf0e10cSrcweir 	class B2DTuple;
48cdf0e10cSrcweir 	class B2DHomMatrix;
49cdf0e10cSrcweir 	class B3DTuple;
50cdf0e10cSrcweir 	class B3DHomMatrix;
51cdf0e10cSrcweir } // end of namespace basegfx
52cdf0e10cSrcweir 
53cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
54cdf0e10cSrcweir 
55cdf0e10cSrcweir typedef ::std::vector< ImpSdXMLExpTransObj2DBase* > ImpSdXMLExpTransObj2DBaseList;
56cdf0e10cSrcweir typedef ::std::vector< ImpSdXMLExpTransObj3DBase* > ImpSdXMLExpTransObj3DBaseList;
57cdf0e10cSrcweir 
58cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
59cdf0e10cSrcweir 
60cdf0e10cSrcweir class SdXMLImExTransform2D
61cdf0e10cSrcweir {
62cdf0e10cSrcweir 	ImpSdXMLExpTransObj2DBaseList	maList;
63cdf0e10cSrcweir 	rtl::OUString					msString;
64cdf0e10cSrcweir 
65cdf0e10cSrcweir 	void EmptyList();
66cdf0e10cSrcweir 
67cdf0e10cSrcweir public:
SdXMLImExTransform2D()68cdf0e10cSrcweir 	SdXMLImExTransform2D() {}
69cdf0e10cSrcweir 	SdXMLImExTransform2D(const rtl::OUString& rNew, const SvXMLUnitConverter& rConv);
~SdXMLImExTransform2D()70cdf0e10cSrcweir 	~SdXMLImExTransform2D() { EmptyList(); }
71cdf0e10cSrcweir 
72cdf0e10cSrcweir 	void AddRotate(double fNew);
73cdf0e10cSrcweir 	void AddScale(const ::basegfx::B2DTuple& rNew);
74cdf0e10cSrcweir 	void AddTranslate(const ::basegfx::B2DTuple& rNew);
75cdf0e10cSrcweir 	void AddSkewX(double fNew);
76cdf0e10cSrcweir 	void AddSkewY(double fNew);
77cdf0e10cSrcweir 	void AddMatrix(const ::basegfx::B2DHomMatrix& rNew);
78cdf0e10cSrcweir 
NeedsAction() const79cdf0e10cSrcweir 	bool NeedsAction() const { return !maList.empty(); }
80cdf0e10cSrcweir 	void GetFullTransform(::basegfx::B2DHomMatrix& rFullTrans);
81cdf0e10cSrcweir 	const rtl::OUString& GetExportString(const SvXMLUnitConverter& rConv);
82cdf0e10cSrcweir 	void SetString(const rtl::OUString& rNew, const SvXMLUnitConverter& rConv);
83cdf0e10cSrcweir };
84cdf0e10cSrcweir 
85cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
86cdf0e10cSrcweir 
87cdf0e10cSrcweir class SdXMLImExTransform3D
88cdf0e10cSrcweir {
89cdf0e10cSrcweir 	ImpSdXMLExpTransObj3DBaseList	maList;
90cdf0e10cSrcweir 	rtl::OUString					msString;
91cdf0e10cSrcweir 
92cdf0e10cSrcweir 	void EmptyList();
93cdf0e10cSrcweir 
94cdf0e10cSrcweir public:
SdXMLImExTransform3D()95cdf0e10cSrcweir 	SdXMLImExTransform3D() {}
96cdf0e10cSrcweir 	SdXMLImExTransform3D(const rtl::OUString& rNew, const SvXMLUnitConverter& rConv);
~SdXMLImExTransform3D()97cdf0e10cSrcweir 	~SdXMLImExTransform3D() { EmptyList(); }
98cdf0e10cSrcweir 
99cdf0e10cSrcweir 	void AddRotateX(double fNew);
100cdf0e10cSrcweir 	void AddRotateY(double fNew);
101cdf0e10cSrcweir 	void AddRotateZ(double fNew);
102cdf0e10cSrcweir 	void AddScale(const ::basegfx::B3DTuple& rNew);
103cdf0e10cSrcweir 	void AddTranslate(const ::basegfx::B3DTuple& rNew);
104cdf0e10cSrcweir 	void AddMatrix(const ::basegfx::B3DHomMatrix& rNew);
105cdf0e10cSrcweir 
106cdf0e10cSrcweir 	void AddHomogenMatrix(const com::sun::star::drawing::HomogenMatrix& xHomMat);
NeedsAction() const107cdf0e10cSrcweir 	bool NeedsAction() const { return !maList.empty(); }
108cdf0e10cSrcweir 	void GetFullTransform(::basegfx::B3DHomMatrix& rFullTrans);
109cdf0e10cSrcweir 	bool GetFullHomogenTransform(com::sun::star::drawing::HomogenMatrix& xHomMat);
110cdf0e10cSrcweir 	const rtl::OUString& GetExportString(const SvXMLUnitConverter& rConv);
111cdf0e10cSrcweir 	void SetString(const rtl::OUString& rNew, const SvXMLUnitConverter& rConv);
112cdf0e10cSrcweir };
113cdf0e10cSrcweir 
114cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
115cdf0e10cSrcweir 
116cdf0e10cSrcweir class SdXMLImExViewBox
117cdf0e10cSrcweir {
118*1f882ec4SArmin Le Grand     rtl::OUString				msString;
119*1f882ec4SArmin Le Grand     double                      mfX;
120*1f882ec4SArmin Le Grand     double                      mfY;
121*1f882ec4SArmin Le Grand     double                      mfW;
122*1f882ec4SArmin Le Grand     double                      mfH;
123cdf0e10cSrcweir 
124cdf0e10cSrcweir public:
125*1f882ec4SArmin Le Grand     SdXMLImExViewBox(double fX = 0.0, double fY = 0.0, double fW = 1000.0, double fH = 1000.0);
126*1f882ec4SArmin Le Grand     SdXMLImExViewBox(const rtl::OUString& rNew, const SvXMLUnitConverter& rConv);
127*1f882ec4SArmin Le Grand 
GetX() const128*1f882ec4SArmin Le Grand     double GetX() const { return mfX; }
GetY() const129*1f882ec4SArmin Le Grand     double GetY() const { return mfY; }
GetWidth() const130*1f882ec4SArmin Le Grand     double GetWidth() const { return mfW; }
GetHeight() const131*1f882ec4SArmin Le Grand     double GetHeight() const { return mfH; }
132*1f882ec4SArmin Le Grand     const rtl::OUString& GetExportString();
133cdf0e10cSrcweir };
134cdf0e10cSrcweir 
135cdf0e10cSrcweir #endif	//  _XEXPTRANSFORM_HXX
136*1f882ec4SArmin Le Grand // eof
137