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 INCLUDED_XMLOFF_SOURCE_DRAW_XIMP3DOBJECT_HXX
21 #define INCLUDED_XMLOFF_SOURCE_DRAW_XIMP3DOBJECT_HXX
23 #include <xmloff/xmlictxt.hxx>
24 #include "sdxmlimp_impl.hxx"
25 #include <xmloff/nmspmap.hxx>
26 #include <com/sun/star/drawing/XShapes.hpp>
27 #include <tools/rtti.hxx>
28 #include <com/sun/star/drawing/HomogenMatrix.hpp>
29 #include <com/sun/star/drawing/Direction3D.hpp>
30 #include <com/sun/star/drawing/Position3D.hpp>
31 #include "ximpshap.hxx"
33 // common shape context
35 class SdXML3DObjectContext
: public SdXMLShapeContext
38 // the shape group this object should be created inside
40 com::sun::star::drawing::HomogenMatrix mxHomMat
;
46 SdXML3DObjectContext( SvXMLImport
& rImport
,
48 const OUString
& rLocalName
,
49 const com::sun::star::uno::Reference
< com::sun::star::xml::sax::XAttributeList
>& xAttrList
,
50 com::sun::star::uno::Reference
< com::sun::star::drawing::XShapes
>& rShapes
,
51 bool bTemporaryShape
);
52 virtual ~SdXML3DObjectContext();
54 virtual void StartElement(const com::sun::star::uno::Reference
< com::sun::star::xml::sax::XAttributeList
>& xAttrList
) SAL_OVERRIDE
;
55 virtual void EndElement() SAL_OVERRIDE
;
58 // dr3d:3dcube context
60 class SdXML3DCubeObjectShapeContext
: public SdXML3DObjectContext
62 ::basegfx::B3DVector maMinEdge
;
63 ::basegfx::B3DVector maMaxEdge
;
70 SdXML3DCubeObjectShapeContext( SvXMLImport
& rImport
, sal_uInt16 nPrfx
,
71 const OUString
& rLocalName
,
72 const com::sun::star::uno::Reference
< com::sun::star::xml::sax::XAttributeList
>& xAttrList
,
73 com::sun::star::uno::Reference
< com::sun::star::drawing::XShapes
>& rShapes
,
74 bool bTemporaryShape
);
75 virtual ~SdXML3DCubeObjectShapeContext();
77 virtual void StartElement(const com::sun::star::uno::Reference
< com::sun::star::xml::sax::XAttributeList
>& xAttrList
) SAL_OVERRIDE
;
78 virtual void EndElement() SAL_OVERRIDE
;
81 // dr3d:3dsphere context
83 class SdXML3DSphereObjectShapeContext
: public SdXML3DObjectContext
85 ::basegfx::B3DVector maCenter
;
86 ::basegfx::B3DVector maSize
;
93 SdXML3DSphereObjectShapeContext( SvXMLImport
& rImport
, sal_uInt16 nPrfx
,
94 const OUString
& rLocalName
,
95 const com::sun::star::uno::Reference
< com::sun::star::xml::sax::XAttributeList
>& xAttrList
,
96 com::sun::star::uno::Reference
< com::sun::star::drawing::XShapes
>& rShapes
,
97 bool bTemporaryShape
);
98 virtual ~SdXML3DSphereObjectShapeContext();
100 virtual void StartElement(const com::sun::star::uno::Reference
< com::sun::star::xml::sax::XAttributeList
>& xAttrList
) SAL_OVERRIDE
;
101 virtual void EndElement() SAL_OVERRIDE
;
104 // polygonbased context
106 class SdXML3DPolygonBasedShapeContext
: public SdXML3DObjectContext
114 SdXML3DPolygonBasedShapeContext( SvXMLImport
& rImport
, sal_uInt16 nPrfx
,
115 const OUString
& rLocalName
,
116 const com::sun::star::uno::Reference
< com::sun::star::xml::sax::XAttributeList
>& xAttrList
,
117 com::sun::star::uno::Reference
< com::sun::star::drawing::XShapes
>& rShapes
,
118 bool bTemporaryShape
);
119 virtual ~SdXML3DPolygonBasedShapeContext();
121 virtual void StartElement(const com::sun::star::uno::Reference
< com::sun::star::xml::sax::XAttributeList
>& xAttrList
) SAL_OVERRIDE
;
122 virtual void EndElement() SAL_OVERRIDE
;
125 // dr3d:3dlathe context
127 class SdXML3DLatheObjectShapeContext
: public SdXML3DPolygonBasedShapeContext
132 SdXML3DLatheObjectShapeContext( SvXMLImport
& rImport
, sal_uInt16 nPrfx
,
133 const OUString
& rLocalName
,
134 const com::sun::star::uno::Reference
< com::sun::star::xml::sax::XAttributeList
>& xAttrList
,
135 com::sun::star::uno::Reference
< com::sun::star::drawing::XShapes
>& rShapes
,
136 bool bTemporaryShape
);
137 virtual ~SdXML3DLatheObjectShapeContext();
139 virtual void StartElement(const com::sun::star::uno::Reference
< com::sun::star::xml::sax::XAttributeList
>& xAttrList
) SAL_OVERRIDE
;
140 virtual void EndElement() SAL_OVERRIDE
;
143 // dr3d:3dextrude context
145 class SdXML3DExtrudeObjectShapeContext
: public SdXML3DPolygonBasedShapeContext
150 SdXML3DExtrudeObjectShapeContext( SvXMLImport
& rImport
, sal_uInt16 nPrfx
,
151 const OUString
& rLocalName
,
152 const com::sun::star::uno::Reference
< com::sun::star::xml::sax::XAttributeList
>& xAttrList
,
153 com::sun::star::uno::Reference
< com::sun::star::drawing::XShapes
>& rShapes
,
154 bool bTemporaryShape
);
155 virtual ~SdXML3DExtrudeObjectShapeContext();
157 virtual void StartElement(const com::sun::star::uno::Reference
< com::sun::star::xml::sax::XAttributeList
>& xAttrList
) SAL_OVERRIDE
;
158 virtual void EndElement() SAL_OVERRIDE
;
161 #endif // INCLUDED_XMLOFF_SOURCE_DRAW_XIMP3DOBJECT_HXX
163 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */