xref: /aoo41x/main/xmloff/inc/xmloff/shapeimport.hxx (revision ecfe53c5)
1*ecfe53c5SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*ecfe53c5SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*ecfe53c5SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*ecfe53c5SAndrew Rist  * distributed with this work for additional information
6*ecfe53c5SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*ecfe53c5SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*ecfe53c5SAndrew Rist  * "License"); you may not use this file except in compliance
9*ecfe53c5SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*ecfe53c5SAndrew Rist  *
11*ecfe53c5SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*ecfe53c5SAndrew Rist  *
13*ecfe53c5SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*ecfe53c5SAndrew Rist  * software distributed under the License is distributed on an
15*ecfe53c5SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*ecfe53c5SAndrew Rist  * KIND, either express or implied.  See the License for the
17*ecfe53c5SAndrew Rist  * specific language governing permissions and limitations
18*ecfe53c5SAndrew Rist  * under the License.
19*ecfe53c5SAndrew Rist  *
20*ecfe53c5SAndrew Rist  *************************************************************/
21*ecfe53c5SAndrew Rist 
22*ecfe53c5SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _XMLOFF_SHAPEIMPORT_HXX_
25cdf0e10cSrcweir #define _XMLOFF_SHAPEIMPORT_HXX_
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include "sal/config.h"
28cdf0e10cSrcweir #include "xmloff/dllapi.h"
29cdf0e10cSrcweir #include <com/sun/star/beans/XPropertySet.hpp>
30cdf0e10cSrcweir #include <com/sun/star/frame/XModel.hpp>
31cdf0e10cSrcweir #include <com/sun/star/xml/sax/XAttributeList.hpp>
32cdf0e10cSrcweir #include <com/sun/star/drawing/XShapes.hpp>
33cdf0e10cSrcweir #include <com/sun/star/drawing/HomogenMatrix.hpp>
34cdf0e10cSrcweir #include <com/sun/star/drawing/ProjectionMode.hpp>
35cdf0e10cSrcweir #include <com/sun/star/drawing/ShadeMode.hpp>
36cdf0e10cSrcweir #include <tools/color.hxx>
37cdf0e10cSrcweir #include <xmloff/uniref.hxx>
38cdf0e10cSrcweir #include <xmloff/xmlictxt.hxx>
39cdf0e10cSrcweir 
40cdf0e10cSrcweir #include "xmloff/table/XMLTableImport.hxx"
41cdf0e10cSrcweir #include <basegfx/vector/b3dvector.hxx>
42cdf0e10cSrcweir 
43cdf0e10cSrcweir class SvXMLImport;
44cdf0e10cSrcweir class SvXMLImportContext;
45cdf0e10cSrcweir class SvXMLTokenMap;
46cdf0e10cSrcweir class SvXMLStylesContext;
47cdf0e10cSrcweir class XMLSdPropHdlFactory;
48cdf0e10cSrcweir class XMLPropertySetMapper;
49cdf0e10cSrcweir class SvXMLImportPropertyMapper;
50cdf0e10cSrcweir 
51cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
52cdf0e10cSrcweir 
53cdf0e10cSrcweir enum SdXMLGroupShapeElemTokenMap
54cdf0e10cSrcweir {
55cdf0e10cSrcweir 	XML_TOK_GROUP_GROUP,
56cdf0e10cSrcweir 	XML_TOK_GROUP_RECT,
57cdf0e10cSrcweir 	XML_TOK_GROUP_LINE,
58cdf0e10cSrcweir 	XML_TOK_GROUP_CIRCLE,
59cdf0e10cSrcweir 	XML_TOK_GROUP_ELLIPSE,
60cdf0e10cSrcweir 	XML_TOK_GROUP_POLYGON,
61cdf0e10cSrcweir 	XML_TOK_GROUP_POLYLINE,
62cdf0e10cSrcweir 	XML_TOK_GROUP_PATH,
63cdf0e10cSrcweir 
64cdf0e10cSrcweir 	XML_TOK_GROUP_CONTROL,
65cdf0e10cSrcweir 	XML_TOK_GROUP_CONNECTOR,
66cdf0e10cSrcweir 	XML_TOK_GROUP_MEASURE,
67cdf0e10cSrcweir 	XML_TOK_GROUP_PAGE,
68cdf0e10cSrcweir 	XML_TOK_GROUP_CAPTION,
69cdf0e10cSrcweir 
70cdf0e10cSrcweir 	XML_TOK_GROUP_CHART,
71cdf0e10cSrcweir 	XML_TOK_GROUP_3DSCENE,
72cdf0e10cSrcweir 
73cdf0e10cSrcweir 	XML_TOK_GROUP_FRAME,
74cdf0e10cSrcweir 
75cdf0e10cSrcweir 	XML_TOK_GROUP_CUSTOM_SHAPE,
76cdf0e10cSrcweir 
77cdf0e10cSrcweir 	XML_TOK_GROUP_ANNOTATION,
78cdf0e10cSrcweir 
79cdf0e10cSrcweir 	XML_TOK_GROUP_A,
80cdf0e10cSrcweir 
81cdf0e10cSrcweir 	XML_TOK_GROUP_LAST
82cdf0e10cSrcweir };
83cdf0e10cSrcweir 
84cdf0e10cSrcweir enum SdXMLFrameShapeElemTokenMap
85cdf0e10cSrcweir {
86cdf0e10cSrcweir 	XML_TOK_FRAME_TEXT_BOX,
87cdf0e10cSrcweir 	XML_TOK_FRAME_IMAGE,
88cdf0e10cSrcweir 	XML_TOK_FRAME_OBJECT,
89cdf0e10cSrcweir 	XML_TOK_FRAME_OBJECT_OLE,
90cdf0e10cSrcweir 	XML_TOK_FRAME_PLUGIN,
91cdf0e10cSrcweir 	XML_TOK_FRAME_FRAME,
92cdf0e10cSrcweir 	XML_TOK_FRAME_FLOATING_FRAME,
93cdf0e10cSrcweir 	XML_TOK_FRAME_APPLET,
94cdf0e10cSrcweir 	XML_TOK_FRAME_TABLE,
95cdf0e10cSrcweir 
96cdf0e10cSrcweir 	XML_TOK_FRAME_LAST
97cdf0e10cSrcweir };
98cdf0e10cSrcweir 
99cdf0e10cSrcweir enum SdXML3DSceneShapeElemTokenMap
100cdf0e10cSrcweir {
101cdf0e10cSrcweir 	XML_TOK_3DSCENE_3DSCENE,
102cdf0e10cSrcweir 	XML_TOK_3DSCENE_3DCUBE,
103cdf0e10cSrcweir 	XML_TOK_3DSCENE_3DSPHERE,
104cdf0e10cSrcweir 	XML_TOK_3DSCENE_3DLATHE,
105cdf0e10cSrcweir 	XML_TOK_3DSCENE_3DEXTRUDE,
106cdf0e10cSrcweir 
107cdf0e10cSrcweir 	XML_TOK_3DSCENE_LAST
108cdf0e10cSrcweir };
109cdf0e10cSrcweir 
110cdf0e10cSrcweir enum SdXMLShapeAttrTokenMap
111cdf0e10cSrcweir {
112cdf0e10cSrcweir 	XML_TOK_SHAPE_NAME,
113cdf0e10cSrcweir 	XML_TOK_SHAPE_DRAWSTYLE_NAME_GRAPHICS,
114cdf0e10cSrcweir 	XML_TOK_SHAPE_PRESENTATION_CLASS,
115cdf0e10cSrcweir 	XML_TOK_SHAPE_DRAWSTYLE_NAME_PRESENTATION,
116cdf0e10cSrcweir 	XML_TOK_SHAPE_TRANSFORM,
117cdf0e10cSrcweir 	XML_TOK_SHAPE_IS_PLACEHOLDER,
118cdf0e10cSrcweir 	XML_TOK_SHAPE_IS_USER_TRANSFORMED
119cdf0e10cSrcweir };
120cdf0e10cSrcweir 
121cdf0e10cSrcweir enum SdXML3DObjectAttrTokenMap
122cdf0e10cSrcweir {
123cdf0e10cSrcweir 	XML_TOK_3DOBJECT_DRAWSTYLE_NAME,
124cdf0e10cSrcweir 	XML_TOK_3DOBJECT_TRANSFORM
125cdf0e10cSrcweir };
126cdf0e10cSrcweir 
127cdf0e10cSrcweir enum SdXML3DPolygonBasedAttrTokenMap
128cdf0e10cSrcweir {
129cdf0e10cSrcweir 	XML_TOK_3DPOLYGONBASED_VIEWBOX,
130cdf0e10cSrcweir 	XML_TOK_3DPOLYGONBASED_D
131cdf0e10cSrcweir };
132cdf0e10cSrcweir 
133cdf0e10cSrcweir enum SdXML3DCubeObjectAttrTokenMap
134cdf0e10cSrcweir {
135cdf0e10cSrcweir 	XML_TOK_3DCUBEOBJ_MINEDGE,
136cdf0e10cSrcweir 	XML_TOK_3DCUBEOBJ_MAXEDGE
137cdf0e10cSrcweir };
138cdf0e10cSrcweir 
139cdf0e10cSrcweir enum SdXML3DSphereObjectAttrTokenMap
140cdf0e10cSrcweir {
141cdf0e10cSrcweir 	XML_TOK_3DSPHEREOBJ_CENTER,
142cdf0e10cSrcweir 	XML_TOK_3DSPHEREOBJ_SIZE
143cdf0e10cSrcweir };
144cdf0e10cSrcweir 
145cdf0e10cSrcweir enum SdXMLPolygonShapeAttrTokenMap
146cdf0e10cSrcweir {
147cdf0e10cSrcweir 	XML_TOK_POLYGONSHAPE_VIEWBOX,
148cdf0e10cSrcweir 	XML_TOK_POLYGONSHAPE_POINTS
149cdf0e10cSrcweir };
150cdf0e10cSrcweir 
151cdf0e10cSrcweir enum SdXMLPathShapeAttrTokenMap
152cdf0e10cSrcweir {
153cdf0e10cSrcweir 	XML_TOK_PATHSHAPE_VIEWBOX,
154cdf0e10cSrcweir 	XML_TOK_PATHSHAPE_D
155cdf0e10cSrcweir };
156cdf0e10cSrcweir 
157cdf0e10cSrcweir enum SdXML3DSceneShapeAttrTokenMap
158cdf0e10cSrcweir {
159cdf0e10cSrcweir 	XML_TOK_3DSCENESHAPE_TRANSFORM,
160cdf0e10cSrcweir 	XML_TOK_3DSCENESHAPE_VRP,
161cdf0e10cSrcweir 	XML_TOK_3DSCENESHAPE_VPN,
162cdf0e10cSrcweir 	XML_TOK_3DSCENESHAPE_VUP,
163cdf0e10cSrcweir 	XML_TOK_3DSCENESHAPE_PROJECTION,
164cdf0e10cSrcweir 	XML_TOK_3DSCENESHAPE_DISTANCE,
165cdf0e10cSrcweir 	XML_TOK_3DSCENESHAPE_FOCAL_LENGTH,
166cdf0e10cSrcweir 	XML_TOK_3DSCENESHAPE_SHADOW_SLANT,
167cdf0e10cSrcweir 	XML_TOK_3DSCENESHAPE_SHADE_MODE,
168cdf0e10cSrcweir 	XML_TOK_3DSCENESHAPE_AMBIENT_COLOR,
169cdf0e10cSrcweir 	XML_TOK_3DSCENESHAPE_LIGHTING_MODE
170cdf0e10cSrcweir };
171cdf0e10cSrcweir 
172cdf0e10cSrcweir enum SdXML3DLightAttrTokenMap
173cdf0e10cSrcweir {
174cdf0e10cSrcweir 	XML_TOK_3DLIGHT_DIFFUSE_COLOR,
175cdf0e10cSrcweir 	XML_TOK_3DLIGHT_DIRECTION,
176cdf0e10cSrcweir 	XML_TOK_3DLIGHT_ENABLED,
177cdf0e10cSrcweir 	XML_TOK_3DLIGHT_SPECULAR
178cdf0e10cSrcweir };
179cdf0e10cSrcweir 
180cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
181cdf0e10cSrcweir // dr3d:3dlight context
182cdf0e10cSrcweir 
183cdf0e10cSrcweir class SdXML3DLightContext: public SvXMLImportContext
184cdf0e10cSrcweir {
185cdf0e10cSrcweir 	// local parameters which need to be read
186cdf0e10cSrcweir 	Color						maDiffuseColor;
187cdf0e10cSrcweir 	::basegfx::B3DVector		maDirection;
188cdf0e10cSrcweir 	sal_Bool						mbEnabled;
189cdf0e10cSrcweir 	sal_Bool						mbSpecular;
190cdf0e10cSrcweir 
191cdf0e10cSrcweir public:
192cdf0e10cSrcweir 	SdXML3DLightContext(
193cdf0e10cSrcweir 		SvXMLImport& rImport,
194cdf0e10cSrcweir 		sal_uInt16 nPrfx,
195cdf0e10cSrcweir 		const rtl::OUString& rLName,
196cdf0e10cSrcweir 		const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList);
197cdf0e10cSrcweir 	virtual ~SdXML3DLightContext();
198cdf0e10cSrcweir 
199cdf0e10cSrcweir 	const Color& GetDiffuseColor() { return maDiffuseColor; }
200cdf0e10cSrcweir 	const ::basegfx::B3DVector& GetDirection() { return maDirection; }
201cdf0e10cSrcweir 	sal_Bool GetEnabled() { return mbEnabled; }
202cdf0e10cSrcweir 	sal_Bool GetSpecular() { return mbSpecular; }
203cdf0e10cSrcweir };
204cdf0e10cSrcweir 
205cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
206cdf0e10cSrcweir 
207cdf0e10cSrcweir DECLARE_LIST(Imp3DLightList, SdXML3DLightContext*)
208cdf0e10cSrcweir 
209cdf0e10cSrcweir class SdXML3DSceneAttributesHelper
210cdf0e10cSrcweir {
211cdf0e10cSrcweir protected:
212cdf0e10cSrcweir 	SvXMLImport& mrImport;
213cdf0e10cSrcweir 
214cdf0e10cSrcweir 	// list for local light contexts
215cdf0e10cSrcweir 	Imp3DLightList				maList;
216cdf0e10cSrcweir 
217cdf0e10cSrcweir 	// local parameters which need to be read
218cdf0e10cSrcweir 	com::sun::star::drawing::HomogenMatrix mxHomMat;
219cdf0e10cSrcweir 	sal_Bool						mbSetTransform;
220cdf0e10cSrcweir 
221cdf0e10cSrcweir 	com::sun::star::drawing::ProjectionMode mxPrjMode;
222cdf0e10cSrcweir 	sal_Int32					mnDistance;
223cdf0e10cSrcweir 	sal_Int32					mnFocalLength;
224cdf0e10cSrcweir 	sal_Int32					mnShadowSlant;
225cdf0e10cSrcweir 	com::sun::star::drawing::ShadeMode mxShadeMode;
226cdf0e10cSrcweir 	Color						maAmbientColor;
227cdf0e10cSrcweir 	sal_Bool						mbLightingMode;
228cdf0e10cSrcweir 
229cdf0e10cSrcweir 	::basegfx::B3DVector		maVRP;
230cdf0e10cSrcweir 	::basegfx::B3DVector		maVPN;
231cdf0e10cSrcweir 	::basegfx::B3DVector		maVUP;
232cdf0e10cSrcweir 	sal_Bool						mbVRPUsed;
233cdf0e10cSrcweir 	sal_Bool						mbVPNUsed;
234cdf0e10cSrcweir 	sal_Bool						mbVUPUsed;
235cdf0e10cSrcweir 
236cdf0e10cSrcweir public:
237cdf0e10cSrcweir 	SdXML3DSceneAttributesHelper( SvXMLImport& rImporter );
238cdf0e10cSrcweir 	~SdXML3DSceneAttributesHelper();
239cdf0e10cSrcweir 
240cdf0e10cSrcweir 	/** creates a 3d ligth context and adds it to the internal list for later processing */
241cdf0e10cSrcweir 	SvXMLImportContext * create3DLightContext( sal_uInt16 nPrfx, const rtl::OUString& rLName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList);
242cdf0e10cSrcweir 
243cdf0e10cSrcweir 	/** this should be called for each scene attribute */
244cdf0e10cSrcweir 	void processSceneAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue );
245cdf0e10cSrcweir 
246cdf0e10cSrcweir 	/** this sets the scene attributes at this propertyset */
247cdf0e10cSrcweir 	void setSceneAttributes( const com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet >& xPropSet );
248cdf0e10cSrcweir };
249cdf0e10cSrcweir 
250cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
251cdf0e10cSrcweir 
252cdf0e10cSrcweir class SvXMLShapeContext : public SvXMLImportContext
253cdf0e10cSrcweir {
254cdf0e10cSrcweir protected:
255cdf0e10cSrcweir 	com::sun::star::uno::Reference< com::sun::star::drawing::XShape >	mxShape;
256cdf0e10cSrcweir     sal_Bool                                                            mbTemporaryShape;
257cdf0e10cSrcweir 	rtl::OUString														msHyperlink;
258cdf0e10cSrcweir 
259cdf0e10cSrcweir public:
260cdf0e10cSrcweir 	SvXMLShapeContext( SvXMLImport& rImp, sal_uInt16 nPrfx,
261cdf0e10cSrcweir 		const ::rtl::OUString& rLName, sal_Bool bTemporaryShape ) : SvXMLImportContext( rImp, nPrfx, rLName ), mbTemporaryShape(bTemporaryShape) {}
262cdf0e10cSrcweir 
263cdf0e10cSrcweir 	TYPEINFO();
264cdf0e10cSrcweir 
265cdf0e10cSrcweir 	const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& getShape() const { return mxShape; }
266cdf0e10cSrcweir 
267cdf0e10cSrcweir 	void setHyperlink( const ::rtl::OUString& rHyperlink );
268cdf0e10cSrcweir };
269cdf0e10cSrcweir 
270cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
271cdf0e10cSrcweir 
272cdf0e10cSrcweir class ShapeSortContext;
273cdf0e10cSrcweir struct XMLShapeImportHelperImpl;
274cdf0e10cSrcweir struct XMLShapeImportPageContextImpl;
275cdf0e10cSrcweir 
276cdf0e10cSrcweir class XMLOFF_DLLPUBLIC XMLShapeImportHelper : public UniRefBase
277cdf0e10cSrcweir {
278cdf0e10cSrcweir 	XMLShapeImportHelperImpl*	mpImpl;
279cdf0e10cSrcweir 
280cdf0e10cSrcweir 	XMLShapeImportPageContextImpl*	mpPageContext;
281cdf0e10cSrcweir 
282cdf0e10cSrcweir 	com::sun::star::uno::Reference< com::sun::star::frame::XModel > mxModel;
283cdf0e10cSrcweir 
284cdf0e10cSrcweir 	// PropertySetMappers and factory
285cdf0e10cSrcweir 	XMLSdPropHdlFactory*		mpSdPropHdlFactory;
286cdf0e10cSrcweir 	SvXMLImportPropertyMapper*		mpPropertySetMapper;
287cdf0e10cSrcweir 	SvXMLImportPropertyMapper*		mpPresPagePropsMapper;
288cdf0e10cSrcweir 
289cdf0e10cSrcweir 	// contexts for Style and AutoStyle import
290cdf0e10cSrcweir 	SvXMLStylesContext*			mpStylesContext;
291cdf0e10cSrcweir 	SvXMLStylesContext*			mpAutoStylesContext;
292cdf0e10cSrcweir 
293cdf0e10cSrcweir 	// contexts for xShape contents TokenMaps
294cdf0e10cSrcweir 	SvXMLTokenMap*				mpGroupShapeElemTokenMap;
295cdf0e10cSrcweir 	SvXMLTokenMap*				mpFrameShapeElemTokenMap;
296cdf0e10cSrcweir 	SvXMLTokenMap*				mp3DSceneShapeElemTokenMap;
297cdf0e10cSrcweir 	SvXMLTokenMap*				mp3DObjectAttrTokenMap;
298cdf0e10cSrcweir 	SvXMLTokenMap*				mp3DPolygonBasedAttrTokenMap;
299cdf0e10cSrcweir 	SvXMLTokenMap*				mp3DCubeObjectAttrTokenMap;
300cdf0e10cSrcweir 	SvXMLTokenMap*				mp3DSphereObjectAttrTokenMap;
301cdf0e10cSrcweir 	SvXMLTokenMap*				mp3DSceneShapeAttrTokenMap;
302cdf0e10cSrcweir 	SvXMLTokenMap*				mp3DLightAttrTokenMap;
303cdf0e10cSrcweir 	SvXMLTokenMap*				mpPathShapeAttrTokenMap;
304cdf0e10cSrcweir 	SvXMLTokenMap*				mpPolygonShapeAttrTokenMap;
305cdf0e10cSrcweir 
306cdf0e10cSrcweir 	const ::rtl::OUString		msStartShape;
307cdf0e10cSrcweir 	const ::rtl::OUString		msEndShape;
308cdf0e10cSrcweir 	const ::rtl::OUString		msStartGluePointIndex;
309cdf0e10cSrcweir 	const ::rtl::OUString		msEndGluePointIndex;
310cdf0e10cSrcweir 
311cdf0e10cSrcweir 	rtl::Reference< XMLTableImport > mxShapeTableImport;
312cdf0e10cSrcweir 
313cdf0e10cSrcweir protected:
314cdf0e10cSrcweir 	SvXMLImport& mrImporter;
315cdf0e10cSrcweir 
316cdf0e10cSrcweir public:
317cdf0e10cSrcweir 	XMLShapeImportHelper( SvXMLImport& rImporter,
318cdf0e10cSrcweir 		const com::sun::star::uno::Reference< com::sun::star::frame::XModel>& rModel,
319cdf0e10cSrcweir 	SvXMLImportPropertyMapper *pExtMapper=0 );
320cdf0e10cSrcweir 
321cdf0e10cSrcweir 	~XMLShapeImportHelper();
322cdf0e10cSrcweir 
323cdf0e10cSrcweir 	SvXMLShapeContext* CreateGroupChildContext(
324cdf0e10cSrcweir 		SvXMLImport& rImport, sal_uInt16 nPrefix, const rtl::OUString& rLocalName,
325cdf0e10cSrcweir 		const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList,
326cdf0e10cSrcweir 		com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
327cdf0e10cSrcweir         sal_Bool bTemporaryShape = sal_False);
328cdf0e10cSrcweir 
329cdf0e10cSrcweir 	SvXMLShapeContext* CreateFrameChildContext(
330cdf0e10cSrcweir 		SvXMLImport& rImport, sal_uInt16 nPrefix, const rtl::OUString& rLocalName,
331cdf0e10cSrcweir 		const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList,
332cdf0e10cSrcweir 		com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
333cdf0e10cSrcweir 		const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xFrameAttrList);
334cdf0e10cSrcweir 	SvXMLImportContext* CreateFrameChildContext(
335cdf0e10cSrcweir 		SvXMLImportContext *pThisContext, sal_uInt16 nPrefix, const rtl::OUString& rLocalName,
336cdf0e10cSrcweir 		const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList );
337cdf0e10cSrcweir 
338cdf0e10cSrcweir 	SvXMLShapeContext* Create3DSceneChildContext(
339cdf0e10cSrcweir 		SvXMLImport& rImport, sal_uInt16 nPrefix, const rtl::OUString& rLocalName,
340cdf0e10cSrcweir 		const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList,
341cdf0e10cSrcweir 		com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes);
342cdf0e10cSrcweir 
343cdf0e10cSrcweir 	const SvXMLTokenMap& GetGroupShapeElemTokenMap();
344cdf0e10cSrcweir 	const SvXMLTokenMap& GetFrameShapeElemTokenMap();
345cdf0e10cSrcweir 	const SvXMLTokenMap& Get3DSceneShapeElemTokenMap();
346cdf0e10cSrcweir 	const SvXMLTokenMap& Get3DObjectAttrTokenMap();
347cdf0e10cSrcweir 	const SvXMLTokenMap& Get3DPolygonBasedAttrTokenMap();
348cdf0e10cSrcweir 	const SvXMLTokenMap& Get3DCubeObjectAttrTokenMap();
349cdf0e10cSrcweir 	const SvXMLTokenMap& Get3DSphereObjectAttrTokenMap();
350cdf0e10cSrcweir 	const SvXMLTokenMap& Get3DSceneShapeAttrTokenMap();
351cdf0e10cSrcweir 	const SvXMLTokenMap& Get3DLightAttrTokenMap();
352cdf0e10cSrcweir 	const SvXMLTokenMap& GetPathShapeAttrTokenMap();
353cdf0e10cSrcweir 	const SvXMLTokenMap& GetPolygonShapeAttrTokenMap();
354cdf0e10cSrcweir 
355cdf0e10cSrcweir 	// Styles and AutoStyles contexts
356cdf0e10cSrcweir 	SvXMLStylesContext* GetStylesContext() const { return mpStylesContext; }
357cdf0e10cSrcweir 	void SetStylesContext(SvXMLStylesContext* pNew);
358cdf0e10cSrcweir 	SvXMLStylesContext* GetAutoStylesContext() const { return mpAutoStylesContext; }
359cdf0e10cSrcweir 	void SetAutoStylesContext(SvXMLStylesContext* pNew);
360cdf0e10cSrcweir 
361cdf0e10cSrcweir 	// get factories and mappers
362cdf0e10cSrcweir 	SvXMLImportPropertyMapper* GetPropertySetMapper() const { return mpPropertySetMapper; }
363cdf0e10cSrcweir 	SvXMLImportPropertyMapper* GetPresPagePropsMapper() const { return mpPresPagePropsMapper; }
364cdf0e10cSrcweir 
365cdf0e10cSrcweir 	// this function is called whenever the implementation classes like to add this new
366cdf0e10cSrcweir 	// shape to the given XShapes.
367cdf0e10cSrcweir 	virtual void addShape(
368cdf0e10cSrcweir 		com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& rShape,
369cdf0e10cSrcweir 		const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList,
370cdf0e10cSrcweir 		com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes);
371cdf0e10cSrcweir 
372cdf0e10cSrcweir 	// this function is called whenever the implementation classes have finished importing
373cdf0e10cSrcweir 	// a shape to the given XShapes. The shape is already inserted into its XShapes and
374cdf0e10cSrcweir 	// all properties and styles are set.
375cdf0e10cSrcweir 	virtual void finishShape(
376cdf0e10cSrcweir 		com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& rShape,
377cdf0e10cSrcweir 		const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList,
378cdf0e10cSrcweir 		com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes);
379cdf0e10cSrcweir 
380cdf0e10cSrcweir 	// helper functions for z-order sorting
381cdf0e10cSrcweir 	void pushGroupForSorting( com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes );
382cdf0e10cSrcweir 	void popGroupAndSort();
383cdf0e10cSrcweir 
384cdf0e10cSrcweir 	void shapeWithZIndexAdded( com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& rShape,
385cdf0e10cSrcweir 							   sal_Int32 nZIndex );
386cdf0e10cSrcweir 
387cdf0e10cSrcweir 	void addShapeConnection( com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& rConnectorShape,
388cdf0e10cSrcweir 							 sal_Bool bStart,
389cdf0e10cSrcweir 							 const rtl::OUString& rDestShapeId,
390cdf0e10cSrcweir 							 sal_Int32 nDestGlueId );
391cdf0e10cSrcweir 
392cdf0e10cSrcweir 	/** adds a mapping for a glue point identifier from an xml file to the identifier created after inserting
393cdf0e10cSrcweir 		the new glue point into the core. The saved mappings can be retrieved by getGluePointId() */
394cdf0e10cSrcweir 	void addGluePointMapping( com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape,
395cdf0e10cSrcweir 							  sal_Int32 nSourceId, sal_Int32 nDestinnationId );
396cdf0e10cSrcweir 
397cdf0e10cSrcweir 	/** moves all current DestinationId's for rXShape by n */
398cdf0e10cSrcweir 	void moveGluePointMapping( const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, const sal_Int32 n );
399cdf0e10cSrcweir 
400cdf0e10cSrcweir 	/** retrieves a mapping for a glue point identifier from the current xml file to the identifier created after
401cdf0e10cSrcweir 		inserting the new glue point into the core. The mapping must be initialized first with addGluePointMapping() */
402cdf0e10cSrcweir 	sal_Int32 getGluePointId( com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, sal_Int32 nSourceId );
403cdf0e10cSrcweir 
404cdf0e10cSrcweir 	/** this method must be calling before the first shape is imported for the given page.
405cdf0e10cSrcweir 		Calls to this method can be nested */
406cdf0e10cSrcweir 	void startPage( com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes );
407cdf0e10cSrcweir 
408cdf0e10cSrcweir 	/** this method must be calling after the last shape is imported for the given page
409cdf0e10cSrcweir 		Calls to this method can be nested */
410cdf0e10cSrcweir 	void endPage( com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes );
411cdf0e10cSrcweir 
412cdf0e10cSrcweir 	void restoreConnections();
413cdf0e10cSrcweir 
414cdf0e10cSrcweir 	/** creates a property mapper for external chaining */
415cdf0e10cSrcweir 	static SvXMLImportPropertyMapper* CreateShapePropMapper(
416cdf0e10cSrcweir 		const com::sun::star::uno::Reference< com::sun::star::frame::XModel>& rModel, SvXMLImport& rImport );
417cdf0e10cSrcweir 
418cdf0e10cSrcweir 	/** creates a shape property set mapper that can be used for non shape elements */
419cdf0e10cSrcweir 	static SvXMLImportPropertyMapper* CreateExternalShapePropMapper(
420cdf0e10cSrcweir 		const com::sun::star::uno::Reference< com::sun::star::frame::XModel>& rModel, SvXMLImport& rImport );
421cdf0e10cSrcweir 
422cdf0e10cSrcweir 	// #88546#
423cdf0e10cSrcweir 	/** defines if the import should increment the progress bar or not */
424cdf0e10cSrcweir 	void enableHandleProgressBar( sal_Bool bEnable = sal_True );
425cdf0e10cSrcweir 	sal_Bool IsHandleProgressBarEnabled() const;
426cdf0e10cSrcweir 
427cdf0e10cSrcweir 	/** queries the capability of the current model to create presentation shapes */
428cdf0e10cSrcweir 	sal_Bool IsPresentationShapesSupported();
429cdf0e10cSrcweir 
430cdf0e10cSrcweir 	XMLSdPropHdlFactory* GetSdPropHdlFactory() const { return mpSdPropHdlFactory; }
431cdf0e10cSrcweir 
432cdf0e10cSrcweir 	const rtl::Reference< XMLTableImport >&		GetShapeTableImport();
433cdf0e10cSrcweir };
434cdf0e10cSrcweir 
435cdf0e10cSrcweir #endif // _XMLOFF_SHAPEIMPORT_HXX_
436