xref: /aoo41x/main/xmloff/source/draw/ximpshap.hxx (revision ddde725d)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _XIMPSHAPE_HXX
25 #define _XIMPSHAPE_HXX
26 
27 #include <com/sun/star/io/XOutputStream.hpp>
28 #include <com/sun/star/document/XActionLockable.hpp>
29 #include <com/sun/star/container/XIdentifierContainer.hpp>
30 #include <xmloff/xmlictxt.hxx>
31 #include "sdxmlimp_impl.hxx"
32 #include <xmloff/nmspmap.hxx>
33 #include <com/sun/star/drawing/XShapes.hpp>
34 #include <com/sun/star/text/XTextCursor.hpp>
35 #include <com/sun/star/awt/Point.hpp>
36 #include <tools/rtti.hxx>
37 #include "xexptran.hxx"
38 
39 #include <vector>
40 #include <xmloff/shapeimport.hxx>
41 #include <xmloff/xmlmultiimagehelper.hxx>
42 
43 //////////////////////////////////////////////////////////////////////////////
44 // common shape context
45 
46 class SdXMLShapeContext : public SvXMLShapeContext
47 {
48 protected:
49 	// the shape group this object should be created inside
50 	com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >	mxShapes;
51 	com::sun::star::uno::Reference< com::sun::star::text::XTextCursor >	mxCursor;
52 	com::sun::star::uno::Reference< com::sun::star::text::XTextCursor >	mxOldCursor;
53 	com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList> mxAttrList;
54 	com::sun::star::uno::Reference< com::sun::star::container::XIdentifierContainer > mxGluePoints;
55 	com::sun::star::uno::Reference< com::sun::star::document::XActionLockable > mxLockable;
56 
57 	rtl::OUString				maDrawStyleName;
58 	rtl::OUString				maTextStyleName;
59 	rtl::OUString				maPresentationClass;
60 	rtl::OUString				maShapeName;
61 	rtl::OUString				maThumbnailURL;
62 
63     /// whether to restore list context (#91964#)
64     bool                        mbListContextPushed;
65 
66 	sal_uInt16					mnStyleFamily;
67 	sal_uInt16					mnClass;
68 	sal_Bool					mbIsPlaceholder;
69 	bool						mbClearDefaultAttributes;
70 	sal_Bool					mbIsUserTransformed;
71 	sal_Int32					mnZOrder;
72 	rtl::OUString				maShapeId;
73 	rtl::OUString				maLayerName;
74 
75 	// #i68101#
76 	rtl::OUString				maShapeTitle;
77 	rtl::OUString				maShapeDescription;
78 
79 	SdXMLImExTransform2D		mnTransform;
80 	com::sun::star::awt::Size	maSize;
81 	com::sun::star::awt::Point	maPosition;
82 
83 	bool						mbVisible;
84 	bool						mbPrintable;
85 
86 	/** if bSupportsStyle is false, auto styles will be set but not	a style */
87 	void SetStyle( bool bSupportsStyle = true );
88 	void SetLayer();
89 	void SetThumbnail();
90 
91 	void AddShape(com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape);
92 	void AddShape(const char* pServiceName );
93 	void SetTransformation();
94 
95 	SvXMLImport& GetImport() { return SvXMLImportContext::GetImport(); }
96 	const SvXMLImport& GetImport() const { return SvXMLImportContext::GetImport(); }
97 
98 	void addGluePoint( const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList );
99 
100 	sal_Bool isPresentationShape() const;
101 
102 public:
103 	TYPEINFO();
104 
105 	SdXMLShapeContext( SvXMLImport& rImport,
106 		sal_uInt16 nPrfx,
107 		const rtl::OUString& rLocalName,
108 		const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
109 		com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
110         sal_Bool bTemporaryShape);
111 	virtual ~SdXMLShapeContext();
112 
113 	virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList);
114 	virtual void EndElement();
115 
116 	virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName,
117 		const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList );
118 
119 	// this is called from the parent group for each unparsed attribute in the attribute list
120 	virtual void processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue );
121 };
122 
123 //////////////////////////////////////////////////////////////////////////////
124 // draw:rect context
125 
126 class SdXMLRectShapeContext : public SdXMLShapeContext
127 {
128 	sal_Int32					mnRadius;
129 
130 public:
131 	TYPEINFO();
132 
133 	SdXMLRectShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
134 		const rtl::OUString& rLocalName,
135 		const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
136 		com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
137         sal_Bool bTemporaryShape);
138 	virtual ~SdXMLRectShapeContext();
139 	virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList);
140 
141 	// this is called from the parent group for each unparsed attribute in the attribute list
142 	virtual void processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue );
143 };
144 
145 //////////////////////////////////////////////////////////////////////////////
146 // draw:line context
147 
148 class SdXMLLineShapeContext : public SdXMLShapeContext
149 {
150 	sal_Int32					mnX1;
151 	sal_Int32					mnY1;
152 	sal_Int32					mnX2;
153 	sal_Int32					mnY2;
154 
155 public:
156 	TYPEINFO();
157 
158 	SdXMLLineShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
159 		const rtl::OUString& rLocalName,
160 		const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
161 		com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
162         sal_Bool bTemporaryShape);
163 	virtual ~SdXMLLineShapeContext();
164 	virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList);
165 
166 	// this is called from the parent group for each unparsed attribute in the attribute list
167 	virtual void processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue );
168 };
169 
170 //////////////////////////////////////////////////////////////////////////////
171 // draw:ellipse and draw:circle context
172 
173 class SdXMLEllipseShapeContext : public SdXMLShapeContext
174 {
175 	sal_Int32					mnCX;
176 	sal_Int32					mnCY;
177 	sal_Int32					mnRX;
178 	sal_Int32					mnRY;
179 
180 	sal_uInt16						meKind;
181 	sal_Int32					mnStartAngle;
182 	sal_Int32					mnEndAngle;
183 public:
184 	TYPEINFO();
185 
186 	SdXMLEllipseShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
187 		const rtl::OUString& rLocalName,
188 		const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
189 		com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
190         sal_Bool bTemporaryShape);
191 	virtual ~SdXMLEllipseShapeContext();
192 	virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList);
193 
194 	// this is called from the parent group for each unparsed attribute in the attribute list
195 	virtual void processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue );
196 };
197 
198 //////////////////////////////////////////////////////////////////////////////
199 // draw:polyline and draw:polygon context
200 
201 class SdXMLPolygonShapeContext : public SdXMLShapeContext
202 {
203 	rtl::OUString				maPoints;
204 	rtl::OUString				maViewBox;
205 	sal_Bool					mbClosed;
206 
207 public:
208 	TYPEINFO();
209 
210 	SdXMLPolygonShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
211 		const rtl::OUString& rLocalName,
212 		const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
213 		com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes, sal_Bool bClosed, sal_Bool bTemporaryShape);
214 	virtual ~SdXMLPolygonShapeContext();
215 	virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList);
216 
217 	// this is called from the parent group for each unparsed attribute in the attribute list
218 	virtual void processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue );
219 };
220 
221 //////////////////////////////////////////////////////////////////////////////
222 // draw:path context
223 
224 class SdXMLPathShapeContext : public SdXMLShapeContext
225 {
226 	rtl::OUString				maD;
227 	rtl::OUString				maViewBox;
228 	sal_Bool					mbClosed;
229 
230 public:
231 	TYPEINFO();
232 
233 	SdXMLPathShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
234 		const rtl::OUString& rLocalName,
235 		const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
236 		com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
237         sal_Bool bTemporaryShape);
238 	virtual ~SdXMLPathShapeContext();
239 	virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList);
240 
241 	// this is called from the parent group for each unparsed attribute in the attribute list
242 	virtual void processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue );
243 };
244 
245 //////////////////////////////////////////////////////////////////////////////
246 // draw:text-box context
247 
248 class SdXMLTextBoxShapeContext : public SdXMLShapeContext
249 {
250 	sal_Int32					mnRadius;
251 
252 public:
253 	TYPEINFO();
254 
255 	SdXMLTextBoxShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
256 		const rtl::OUString& rLocalName,
257 		const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
258 		com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
259         sal_Bool bTemporaryShape);
260 	virtual ~SdXMLTextBoxShapeContext();
261 	virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList);
262 
263 	// this is called from the parent group for each unparsed attribute in the attribute list
264 	virtual void processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue );
265 };
266 
267 //////////////////////////////////////////////////////////////////////////////
268 // draw:control context
269 
270 class SdXMLControlShapeContext : public SdXMLShapeContext
271 {
272 private:
273 	rtl::OUString maFormId;
274 
275 public:
276 	TYPEINFO();
277 
278 	SdXMLControlShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
279 		const rtl::OUString& rLocalName,
280 		const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
281 		com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
282         sal_Bool bTemporaryShape);
283 	virtual ~SdXMLControlShapeContext();
284 	virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList);
285 
286 	// this is called from the parent group for each unparsed attribute in the attribute list
287 	virtual void processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue );
288 };
289 
290 //////////////////////////////////////////////////////////////////////////////
291 // draw:connector context
292 
293 class SdXMLConnectorShapeContext : public SdXMLShapeContext
294 {
295 private:
296 	::com::sun::star::awt::Point maStart;
297 	::com::sun::star::awt::Point maEnd;
298 
299 	sal_uInt16		mnType;
300 
301 	rtl::OUString	maStartShapeId;
302 	sal_Int32		mnStartGlueId;
303 	rtl::OUString	maEndShapeId;
304 	sal_Int32		mnEndGlueId;
305 
306 	sal_Int32	mnDelta1;
307 	sal_Int32	mnDelta2;
308 	sal_Int32	mnDelta3;
309 
310 	com::sun::star::uno::Any maPath;
311 
312 public:
313 	TYPEINFO();
314 
315 	SdXMLConnectorShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
316 		const rtl::OUString& rLocalName,
317 		const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
318 		com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
319         sal_Bool bTemporaryShape);
320 	virtual ~SdXMLConnectorShapeContext();
321 	virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList);
322 
323 	// this is called from the parent group for each unparsed attribute in the attribute list
324 	virtual void processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue );
325 };
326 
327 //////////////////////////////////////////////////////////////////////////////
328 // draw:measure context
329 
330 class SdXMLMeasureShapeContext : public SdXMLShapeContext
331 {
332 private:
333 	::com::sun::star::awt::Point maStart;
334 	::com::sun::star::awt::Point maEnd;
335 
336 public:
337 	TYPEINFO();
338 
339 	SdXMLMeasureShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
340 		const rtl::OUString& rLocalName,
341 		const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
342 		com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
343         sal_Bool bTemporaryShape);
344 	virtual ~SdXMLMeasureShapeContext();
345 	virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList);
346 	virtual void EndElement();
347 
348 	// this is called from the parent group for each unparsed attribute in the attribute list
349 	virtual void processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue );
350 };
351 
352 //////////////////////////////////////////////////////////////////////////////
353 // draw:page context
354 
355 class SdXMLPageShapeContext : public SdXMLShapeContext
356 {
357 private:
358 	sal_Int32	mnPageNumber;
359 public:
360 	TYPEINFO();
361 
362 	SdXMLPageShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
363 		const rtl::OUString& rLocalName,
364 		const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
365 		com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
366         sal_Bool bTemporaryShape);
367 	virtual ~SdXMLPageShapeContext();
368 	virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList);
369 
370 	// this is called from the parent group for each unparsed attribute in the attribute list
371 	virtual void processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue );
372 };
373 
374 //////////////////////////////////////////////////////////////////////////////
375 // draw:caption context
376 
377 class SdXMLCaptionShapeContext : public SdXMLShapeContext
378 {
379 private:
380 	com::sun::star::awt::Point maCaptionPoint;
381 	sal_Int32 mnRadius;
382 
383 public:
384 	TYPEINFO();
385 
386 	SdXMLCaptionShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
387 		const rtl::OUString& rLocalName,
388 		const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
389 		com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
390         sal_Bool bTemporaryShape);
391 	virtual ~SdXMLCaptionShapeContext();
392 	virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList);
393 
394 	// this is called from the parent group for each unparsed attribute in the attribute list
395 	virtual void processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue );
396 };
397 
398 //////////////////////////////////////////////////////////////////////////////
399 // office:image context
400 
401 class SdXMLGraphicObjectShapeContext : public SdXMLShapeContext
402 {
403 private:
404 	::rtl::OUString maURL;
405 	::com::sun::star::uno::Reference < ::com::sun::star::io::XOutputStream > mxBase64Stream;
406 
407 public:
408 	TYPEINFO();
409 
410 	SdXMLGraphicObjectShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
411 		const rtl::OUString& rLocalName,
412 		const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
413 		com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
414         sal_Bool bTemporaryShape);
415 	virtual ~SdXMLGraphicObjectShapeContext();
416 
417 	virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
418 	virtual void EndElement();
419 	virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName,
420 		const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList );
421 
422 	// this is called from the parent group for each unparsed attribute in the attribute list
423 	virtual void processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue );
424 };
425 
426 //////////////////////////////////////////////////////////////////////////////
427 // chart:chart context
428 
429 class SdXMLChartShapeContext : public SdXMLShapeContext
430 {
431 	SvXMLImportContext*			mpChartContext;
432 
433 public:
434 	TYPEINFO();
435 
436 	SdXMLChartShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
437 		const rtl::OUString& rLocalName,
438 		const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
439 		com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
440         sal_Bool bTemporaryShape);
441 	virtual ~SdXMLChartShapeContext();
442 
443 	virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
444 	virtual void EndElement();
445 	virtual void Characters( const ::rtl::OUString& rChars );
446 	virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName,
447 		const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList );
448 };
449 
450 //////////////////////////////////////////////////////////////////////////////
451 // draw:object and draw:object_ole context
452 
453 class SdXMLObjectShapeContext : public SdXMLShapeContext
454 {
455 private:
456 	rtl::OUString maCLSID;
457 	rtl::OUString maHref;
458 
459 	// #100592#
460 	::com::sun::star::uno::Reference < ::com::sun::star::io::XOutputStream > mxBase64Stream;
461 
462 public:
463 	TYPEINFO();
464 
465 	SdXMLObjectShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
466 		const rtl::OUString& rLocalName,
467 		const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
468 		com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
469         sal_Bool bTemporaryShape);
470 	virtual ~SdXMLObjectShapeContext();
471 
472 	virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
473 	virtual void EndElement();
474 
475 	// #100592#
476 	virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName,
477 		const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList );
478 
479 	// this is called from the parent group for each unparsed attribute in the attribute list
480 	virtual void processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue );
481 };
482 
483 //////////////////////////////////////////////////////////////////////////////
484 // draw:applet
485 
486 class SdXMLAppletShapeContext : public SdXMLShapeContext
487 {
488 private:
489 	rtl::OUString maAppletName;
490 	rtl::OUString maAppletCode;
491 	rtl::OUString maHref;
492 	sal_Bool mbIsScript;
493 
494 	com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > maParams;
495 
496 public:
497 	TYPEINFO();
498 
499 	SdXMLAppletShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
500 		const rtl::OUString& rLocalName,
501 		const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
502 		com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
503         sal_Bool bTemporaryShape);
504 	virtual ~SdXMLAppletShapeContext();
505 
506 	virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
507 	virtual void EndElement();
508 
509 	virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName,
510 		const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList );
511 
512 	// this is called from the parent group for each unparsed attribute in the attribute list
513 	virtual void processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue );
514 };
515 
516 //////////////////////////////////////////////////////////////////////////////
517 // draw:plugin
518 
519 class SdXMLPluginShapeContext : public SdXMLShapeContext
520 {
521 private:
522 	rtl::OUString 	maMimeType;
523 	rtl::OUString 	maHref;
524 	bool			mbMedia;
525 
526 	com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > maParams;
527 
528 public:
529 	TYPEINFO();
530 
531 	SdXMLPluginShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
532 		const rtl::OUString& rLocalName,
533 		const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
534 		com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
535         sal_Bool bTemporaryShape);
536 	virtual ~SdXMLPluginShapeContext();
537 
538 	virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
539 	virtual void EndElement();
540 
541 	virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName,
542 		const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList );
543 
544 	// this is called from the parent group for each unparsed attribute in the attribute list
545 	virtual void processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue );
546 };
547 
548 //////////////////////////////////////////////////////////////////////////////
549 // draw:floating-frame
550 
551 class SdXMLFloatingFrameShapeContext : public SdXMLShapeContext
552 {
553 private:
554 	rtl::OUString maFrameName;
555 	rtl::OUString maHref;
556 
557 public:
558 	TYPEINFO();
559 
560 	SdXMLFloatingFrameShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
561 		const rtl::OUString& rLocalName,
562 		const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
563 		com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
564         sal_Bool bTemporaryShape);
565 	virtual ~SdXMLFloatingFrameShapeContext();
566 
567 	virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
568 	virtual void EndElement();
569 
570 	// this is called from the parent group for each unparsed attribute in the attribute list
571 	virtual void processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue );
572 };
573 
574 //////////////////////////////////////////////////////////////////////////////
575 // draw:-frame
576 
577 class SdXMLFrameShapeContext : public SdXMLShapeContext, public multiImageImportHelper
578 {
579 private:
580 	sal_Bool mbSupportsReplacement;
581 	SvXMLImportContextRef mxImplContext;
582 	SvXMLImportContextRef mxReplImplContext;
583 
584 protected:
585     /// helper to get the created xShape instance, needs to be overloaded
586     virtual rtl::OUString getGraphicURLFromImportContext(const SvXMLImportContext& rContext) const;
587     virtual void removeGraphicFromImportContext(const SvXMLImportContext& rContext) const;
588 
589 public:
590 	TYPEINFO();
591 
592 	SdXMLFrameShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
593 		const rtl::OUString& rLocalName,
594 		const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
595 		com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
596         sal_Bool bTemporaryShape);
597 	virtual ~SdXMLFrameShapeContext();
598 
599 	virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName,
600 		const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList );
601 
602 	virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
603 	virtual void EndElement();
604 
605 	virtual void processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue );
606 };
607 
608 class SdXMLCustomShapeContext : public SdXMLShapeContext
609 {
610 
611 protected :
612 
613 	rtl::OUString maCustomShapeEngine;
614 	rtl::OUString maCustomShapeData;
615 
616 	std::vector< com::sun::star::beans::PropertyValue > maCustomShapeGeometry;
617 
618 public:
619 
620 	TYPEINFO();
621 
622 	SdXMLCustomShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const rtl::OUString& rLocalName,
623 		const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
624 		com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
625         sal_Bool bTemporaryShape);
626 	virtual ~SdXMLCustomShapeContext();
627 
628 	virtual void StartElement( const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList );
629 	virtual void EndElement();
630 
631 	virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName,
632 		const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList );
633 
634 	// this is called from the parent group for each unparsed attribute in the attribute list
635 	virtual void processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue );
636 };
637 
638 //////////////////////////////////////////////////////////////////////////////
639 // draw:table
640 
641 class SdXMLTableShapeContext : public SdXMLShapeContext
642 {
643 public:
644 	TYPEINFO();
645 
646 	SdXMLTableShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
647 		const rtl::OUString& rLocalName,
648 		const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
649 		com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes );
650 	virtual ~SdXMLTableShapeContext();
651 
652 	virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
653 	virtual void EndElement();
654 
655 	virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList );
656 
657 	// this is called from the parent group for each unparsed attribute in the attribute list
658 	virtual void processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue );
659 
660 private:
661 	SvXMLImportContextRef mxTableImportContext;
662 	rtl::OUString msTemplateStyleName;
663 	sal_Bool maTemplateStylesUsed[6];
664 };
665 
666 #endif	//  _XIMPSHAPE_HXX
667