1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef _XEXPTRANSFORM_HXX
21 #define _XEXPTRANSFORM_HXX
23 #include <rtl/ustring.hxx>
24 #include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp>
25 #include <com/sun/star/drawing/PointSequence.hpp>
26 #include <com/sun/star/drawing/FlagSequence.hpp>
27 #include <com/sun/star/awt/Size.hpp>
28 #include <com/sun/star/drawing/HomogenMatrix.hpp>
29 #include <tools/mapunit.hxx>
33 //////////////////////////////////////////////////////////////////////////////
36 struct ImpSdXMLExpTransObj2DBase
;
37 struct ImpSdXMLExpTransObj3DBase
;
38 class SvXMLUnitConverter
;
47 } // end of namespace basegfx
49 //////////////////////////////////////////////////////////////////////////////
51 typedef ::std::vector
< ImpSdXMLExpTransObj2DBase
* > ImpSdXMLExpTransObj2DBaseList
;
52 typedef ::std::vector
< ImpSdXMLExpTransObj3DBase
* > ImpSdXMLExpTransObj3DBaseList
;
54 //////////////////////////////////////////////////////////////////////////////
56 class SdXMLImExTransform2D
58 ImpSdXMLExpTransObj2DBaseList maList
;
64 SdXMLImExTransform2D() {}
65 ~SdXMLImExTransform2D() { EmptyList(); }
67 void AddRotate(double fNew
);
68 void AddTranslate(const ::basegfx::B2DTuple
& rNew
);
69 void AddSkewX(double fNew
);
71 bool NeedsAction() const { return !maList
.empty(); }
72 void GetFullTransform(::basegfx::B2DHomMatrix
& rFullTrans
);
73 const OUString
& GetExportString(const SvXMLUnitConverter
& rConv
);
74 void SetString(const OUString
& rNew
, const SvXMLUnitConverter
& rConv
);
77 //////////////////////////////////////////////////////////////////////////////
79 class SdXMLImExTransform3D
81 ImpSdXMLExpTransObj3DBaseList maList
;
87 SdXMLImExTransform3D() {}
88 SdXMLImExTransform3D(const OUString
& rNew
, const SvXMLUnitConverter
& rConv
);
89 ~SdXMLImExTransform3D() { EmptyList(); }
91 void AddMatrix(const ::basegfx::B3DHomMatrix
& rNew
);
93 void AddHomogenMatrix(const com::sun::star::drawing::HomogenMatrix
& xHomMat
);
94 bool NeedsAction() const { return !maList
.empty(); }
95 void GetFullTransform(::basegfx::B3DHomMatrix
& rFullTrans
);
96 bool GetFullHomogenTransform(com::sun::star::drawing::HomogenMatrix
& xHomMat
);
97 const OUString
& GetExportString(const SvXMLUnitConverter
& rConv
);
98 void SetString(const OUString
& rNew
, const SvXMLUnitConverter
& rConv
);
101 //////////////////////////////////////////////////////////////////////////////
103 class SdXMLImExViewBox
112 SdXMLImExViewBox(sal_Int32 nX
= 0L, sal_Int32 nY
= 0L, sal_Int32 nW
= 1000L, sal_Int32 nH
= 1000L);
113 SdXMLImExViewBox(const OUString
& rNew
, const SvXMLUnitConverter
& rConv
);
115 sal_Int32
GetX() const { return mnX
; }
116 sal_Int32
GetY() const { return mnY
; }
117 sal_Int32
GetWidth() const { return mnW
; }
118 sal_Int32
GetHeight() const { return mnH
; }
119 const OUString
& GetExportString();
122 //////////////////////////////////////////////////////////////////////////////
124 class SdXMLImExPointsElement
127 com::sun::star::drawing::PointSequenceSequence maPoly
;
130 SdXMLImExPointsElement(com::sun::star::drawing::PointSequence
* pPoints
,
131 const SdXMLImExViewBox
& rViewBox
,
132 const com::sun::star::awt::Point
& rObjectPos
,
133 const com::sun::star::awt::Size
& rObjectSize
,
135 const bool bClosed
= true);
136 SdXMLImExPointsElement(const OUString
& rNew
,
137 const SdXMLImExViewBox
& rViewBox
,
138 const com::sun::star::awt::Point
& rObjectPos
,
139 const com::sun::star::awt::Size
& rObjectSize
,
140 const SvXMLUnitConverter
& rConv
);
142 const OUString
& GetExportString() const { return msString
; }
143 const com::sun::star::drawing::PointSequenceSequence
& GetPointSequenceSequence() const { return maPoly
; }
146 //////////////////////////////////////////////////////////////////////////////
148 class SdXMLImExSvgDElement
151 const SdXMLImExViewBox
& mrViewBox
;
158 com::sun::star::drawing::PolyPolygonBezierCoords maPoly
;
161 SdXMLImExSvgDElement(const SdXMLImExViewBox
& rViewBox
, const SvXMLExport
& rExport
);
162 SdXMLImExSvgDElement(const OUString
& rNew
,
163 const SdXMLImExViewBox
& rViewBox
,
164 const com::sun::star::awt::Point
& rObjectPos
,
165 const com::sun::star::awt::Size
& rObjectSize
,
166 const SvXMLImport
& rImport
);
169 com::sun::star::drawing::PointSequence
* pPoints
,
170 com::sun::star::drawing::FlagSequence
* pFlags
,
171 const com::sun::star::awt::Point
& rObjectPos
,
172 const com::sun::star::awt::Size
& rObjectSize
,
173 bool bClosed
= false);
175 const OUString
& GetExportString() const { return msString
; }
176 bool IsClosed() const { return mbIsClosed
; }
177 bool IsCurve() const { return mbIsCurve
; }
178 const com::sun::star::drawing::PointSequenceSequence
& GetPointSequenceSequence() const { return maPoly
.Coordinates
; }
179 const com::sun::star::drawing::FlagSequenceSequence
& GetFlagSequenceSequence() const { return maPoly
.Flags
; }
183 #endif // _XEXPTRANSFORM_HXX
185 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */