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