1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: xexptran.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _XEXPTRANSFORM_HXX
32 #define _XEXPTRANSFORM_HXX
34 #ifndef _RTL_USTRING_HXX_
35 #include "rtl/ustring.hxx"
38 #ifndef _B2D_MATRIX3D_HXX
39 #include <bf_goodies/matrix3d.hxx>
42 #ifndef _COM_SUN_STAR_DRAWING_POINTSEQUENCESEQUENCE_HPP_
43 #include <com/sun/star/drawing/PointSequenceSequence.hpp>
46 #ifndef _COM_SUN_STAR_DRAWING_POINTSEQUENCE_HPP_
47 #include <com/sun/star/drawing/PointSequence.hpp>
50 #ifndef _COM_SUN_STAR_AWT_SIZE_HPP_
51 #include <com/sun/star/awt/Size.hpp>
54 #ifndef _COM_SUN_STAR_DRAWING_FLAGSEQUENCESEQUENCE_HPP_
55 #include <com/sun/star/drawing/FlagSequenceSequence.hpp>
58 #ifndef _COM_SUN_STAR_DRAWING_FLAGSEQUENCE_HPP_
59 #include <com/sun/star/drawing/FlagSequence.hpp>
62 #ifndef _COM_SUN_STAR_DRAWING_HOMOGENMATRIX_HPP_
63 #include <com/sun/star/drawing/HomogenMatrix.hpp>
71 //////////////////////////////////////////////////////////////////////////////
73 struct ImpSdXMLExpTransObj2DBase
;
74 struct ImpSdXMLExpTransObj3DBase
;
75 class SvXMLUnitConverter
;
77 //////////////////////////////////////////////////////////////////////////////
79 DECLARE_LIST(ImpSdXMLExpTransObj2DBaseList
, ImpSdXMLExpTransObj2DBase
*)//STRIP007 ;
80 DECLARE_LIST(ImpSdXMLExpTransObj3DBaseList
, ImpSdXMLExpTransObj3DBase
*)//STRIP007 ;
82 //////////////////////////////////////////////////////////////////////////////
84 class SdXMLImExTransform2D
86 ImpSdXMLExpTransObj2DBaseList maList
;
87 ::rtl::OUString msString
;
92 SdXMLImExTransform2D() {}
93 ~SdXMLImExTransform2D() { EmptyList(); }
95 void AddRotate(double fNew
);
96 void AddTranslate(const Vector2D
& rNew
);
97 void AddSkewX(double fNew
);
99 sal_Bool
NeedsAction() const { return (sal_Bool
)(maList
.Count() > 0L); }
100 void GetFullTransform(Matrix3D
& rFullTrans
);
101 const ::rtl::OUString
& GetExportString(const SvXMLUnitConverter
& rConv
);
102 void SetString(const ::rtl::OUString
& rNew
, const SvXMLUnitConverter
& rConv
);
105 //////////////////////////////////////////////////////////////////////////////
107 class SdXMLImExTransform3D
109 ImpSdXMLExpTransObj3DBaseList maList
;
110 ::rtl::OUString msString
;
115 SdXMLImExTransform3D() {}
116 SdXMLImExTransform3D(const ::rtl::OUString
& rNew
, const SvXMLUnitConverter
& rConv
);
117 ~SdXMLImExTransform3D() { EmptyList(); }
119 void AddMatrix(const Matrix4D
& rNew
);
121 void AddHomogenMatrix(const ::com::sun::star::drawing::HomogenMatrix
& xHomMat
);
122 sal_Bool
NeedsAction() const { return (sal_Bool
)(maList
.Count() > 0L); }
123 void GetFullTransform(Matrix4D
& rFullTrans
);
124 BOOL
GetFullHomogenTransform( ::com::sun::star::drawing::HomogenMatrix
& xHomMat
);
125 const ::rtl::OUString
& GetExportString(const SvXMLUnitConverter
& rConv
);
126 void SetString(const ::rtl::OUString
& rNew
, const SvXMLUnitConverter
& rConv
);
129 //////////////////////////////////////////////////////////////////////////////
131 class SdXMLImExViewBox
133 ::rtl::OUString msString
;
140 SdXMLImExViewBox(sal_Int32 nX
= 0L, sal_Int32 nY
= 0L, sal_Int32 nW
= 1000L, sal_Int32 nH
= 1000L);
141 SdXMLImExViewBox(const ::rtl::OUString
& rNew
, const SvXMLUnitConverter
& rConv
);
143 sal_Int32
GetX() const { return mnX
; }
144 sal_Int32
GetY() const { return mnY
; }
145 sal_Int32
GetWidth() const { return mnW
; }
146 sal_Int32
GetHeight() const { return mnH
; }
147 const ::rtl::OUString
& GetExportString(const SvXMLUnitConverter
& rConv
);
150 //////////////////////////////////////////////////////////////////////////////
152 class SdXMLImExPointsElement
154 ::rtl::OUString msString
;
155 ::com::sun::star::drawing::PointSequenceSequence maPoly
;
158 SdXMLImExPointsElement( ::com::sun::star::drawing::PointSequence
* pPoints
,
159 const SdXMLImExViewBox
& rViewBox
,
160 const ::com::sun::star::awt::Point
& rObjectPos
,
161 const ::com::sun::star::awt::Size
& rObjectSize
,
162 const SvXMLUnitConverter
& rConv
,
164 const sal_Bool bClosed
= sal_True
);
165 SdXMLImExPointsElement(const ::rtl::OUString
& rNew
,
166 const SdXMLImExViewBox
& rViewBox
,
167 const ::com::sun::star::awt::Point
& rObjectPos
,
168 const ::com::sun::star::awt::Size
& rObjectSize
,
169 const SvXMLUnitConverter
& rConv
);
171 const ::rtl::OUString
& GetExportString() const { return msString
; }
172 const ::com::sun::star::drawing::PointSequenceSequence
& GetPointSequenceSequence() const { return maPoly
; }
175 //////////////////////////////////////////////////////////////////////////////
177 class SdXMLImExSvgDElement
179 ::rtl::OUString msString
;
180 const SdXMLImExViewBox
& mrViewBox
;
187 ::com::sun::star::drawing::PointSequenceSequence maPoly
;
188 ::com::sun::star::drawing::FlagSequenceSequence maFlag
;
191 SdXMLImExSvgDElement(const SdXMLImExViewBox
& rViewBox
);
192 SdXMLImExSvgDElement(const ::rtl::OUString
& rNew
,
193 const SdXMLImExViewBox
& rViewBox
,
194 const ::com::sun::star::awt::Point
& rObjectPos
,
195 const ::com::sun::star::awt::Size
& rObjectSize
,
196 const SvXMLUnitConverter
& rConv
);
199 ::com::sun::star::drawing::PointSequence
* pPoints
,
200 ::com::sun::star::drawing::FlagSequence
* pFlags
,
201 const ::com::sun::star::awt::Point
& rObjectPos
,
202 const ::com::sun::star::awt::Size
& rObjectSize
,
203 const SvXMLUnitConverter
& rConv
,
204 sal_Bool bClosed
= FALSE
, sal_Bool bRelative
= TRUE
);
206 const ::rtl::OUString
& GetExportString() const { return msString
; }
207 sal_Bool
IsClosed() const { return mbIsClosed
; }
208 sal_Bool
IsCurve() const { return mbIsCurve
; }
209 const ::com::sun::star::drawing::PointSequenceSequence
& GetPointSequenceSequence() const { return maPoly
; }
210 const ::com::sun::star::drawing::FlagSequenceSequence
& GetFlagSequenceSequence() const { return maFlag
; }
214 }//end of namespace binfilter
215 #endif // _XEXPTRANSFORM_HXX