bump product version to 5.0.4.1
[LibreOffice.git] / xmloff / source / draw / ximpshap.hxx
blobac95e7d66cab99fb963f9aa6f1e497042db6518a
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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_XIMPSHAP_HXX
21 #define INCLUDED_XMLOFF_SOURCE_DRAW_XIMPSHAP_HXX
23 #include <com/sun/star/io/XOutputStream.hpp>
24 #include <com/sun/star/document/XActionLockable.hpp>
25 #include <com/sun/star/container/XIdentifierContainer.hpp>
26 #include <xmloff/xmlictxt.hxx>
27 #include "sdxmlimp_impl.hxx"
28 #include <xmloff/nmspmap.hxx>
29 #include <com/sun/star/drawing/XShapes.hpp>
30 #include <com/sun/star/text/XTextCursor.hpp>
31 #include <com/sun/star/awt/Point.hpp>
32 #include <tools/rtti.hxx>
33 #include "xexptran.hxx"
34 #include <vector>
35 #include <xmloff/shapeimport.hxx>
36 #include <xmloff/xmlmultiimagehelper.hxx>
37 #include <basegfx/matrix/b2dhommatrix.hxx>
39 // common shape context
41 class SdXMLShapeContext : public SvXMLShapeContext
43 protected:
44 // the shape group this object should be created inside
45 com::sun::star::uno::Reference< com::sun::star::drawing::XShapes > mxShapes;
46 com::sun::star::uno::Reference< com::sun::star::text::XTextCursor > mxCursor;
47 com::sun::star::uno::Reference< com::sun::star::text::XTextCursor > mxOldCursor;
48 com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList> mxAttrList;
49 com::sun::star::uno::Reference< com::sun::star::container::XIdentifierContainer > mxGluePoints;
50 com::sun::star::uno::Reference< com::sun::star::document::XActionLockable > mxLockable;
52 OUString maDrawStyleName;
53 OUString maTextStyleName;
54 OUString maPresentationClass;
55 OUString maShapeName;
56 OUString maThumbnailURL;
58 /// whether to restore list context (#91964#)
59 bool mbListContextPushed;
61 sal_uInt16 mnStyleFamily;
62 sal_uInt16 mnClass;
63 bool mbIsPlaceholder;
64 bool mbClearDefaultAttributes;
65 bool mbIsUserTransformed;
66 sal_Int32 mnZOrder;
67 OUString maShapeId;
68 OUString maLayerName;
70 // #i68101#
71 OUString maShapeTitle;
72 OUString maShapeDescription;
74 SdXMLImExTransform2D mnTransform;
75 com::sun::star::awt::Size maSize;
76 sal_Int16 mnRelWidth;
77 sal_Int16 mnRelHeight;
78 com::sun::star::awt::Point maPosition;
79 basegfx::B2DHomMatrix maUsedTransformation;
81 bool mbVisible;
82 bool mbPrintable;
83 bool mbHaveXmlId;
84 bool mbTextBox; ///< If the text of this shape is handled by a Writer TextFrame.
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();
91 void AddShape(com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape);
92 void AddShape(OUString const & serviceName);
93 void SetTransformation();
95 SvXMLImport& GetImport() { return SvXMLImportContext::GetImport(); }
96 const SvXMLImport& GetImport() const { return SvXMLImportContext::GetImport(); }
98 void addGluePoint( const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList );
100 bool isPresentationShape() const;
102 public:
103 TYPEINFO_OVERRIDE();
105 SdXMLShapeContext( SvXMLImport& rImport,
106 sal_uInt16 nPrfx,
107 const 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 bool bTemporaryShape);
111 virtual ~SdXMLShapeContext();
113 virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList) SAL_OVERRIDE;
114 virtual void EndElement() SAL_OVERRIDE;
116 virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName,
117 const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList ) SAL_OVERRIDE;
119 // this is called from the parent group for each unparsed attribute in the attribute list
120 virtual void processAttribute( sal_uInt16 nPrefix, const OUString& rLocalName, const OUString& rValue );
122 // allow to copy evtl. useful data from another temporary import context, e.g. used to
123 // support multiple images
124 virtual void onDemandRescueUsefulDataFromTemporary( const SvXMLImportContext& rCandidate ) SAL_OVERRIDE;
127 // draw:rect context
129 class SdXMLRectShapeContext : public SdXMLShapeContext
131 sal_Int32 mnRadius;
133 public:
134 TYPEINFO_OVERRIDE();
136 SdXMLRectShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
137 const OUString& rLocalName,
138 const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
139 com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
140 bool bTemporaryShape);
141 virtual ~SdXMLRectShapeContext();
142 virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList) SAL_OVERRIDE;
144 // this is called from the parent group for each unparsed attribute in the attribute list
145 virtual void processAttribute( sal_uInt16 nPrefix, const OUString& rLocalName, const OUString& rValue ) SAL_OVERRIDE;
148 // draw:line context
150 class SdXMLLineShapeContext : public SdXMLShapeContext
152 sal_Int32 mnX1;
153 sal_Int32 mnY1;
154 sal_Int32 mnX2;
155 sal_Int32 mnY2;
157 public:
158 TYPEINFO_OVERRIDE();
160 SdXMLLineShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
161 const OUString& rLocalName,
162 const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
163 com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
164 bool bTemporaryShape);
165 virtual ~SdXMLLineShapeContext();
166 virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList) SAL_OVERRIDE;
168 // this is called from the parent group for each unparsed attribute in the attribute list
169 virtual void processAttribute( sal_uInt16 nPrefix, const OUString& rLocalName, const OUString& rValue ) SAL_OVERRIDE;
172 // draw:ellipse and draw:circle context
174 class SdXMLEllipseShapeContext : public SdXMLShapeContext
176 sal_Int32 mnCX;
177 sal_Int32 mnCY;
178 sal_Int32 mnRX;
179 sal_Int32 mnRY;
181 sal_uInt16 meKind;
182 sal_Int32 mnStartAngle;
183 sal_Int32 mnEndAngle;
184 public:
185 TYPEINFO_OVERRIDE();
187 SdXMLEllipseShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
188 const OUString& rLocalName,
189 const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
190 com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
191 bool bTemporaryShape);
192 virtual ~SdXMLEllipseShapeContext();
193 virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList) SAL_OVERRIDE;
195 // this is called from the parent group for each unparsed attribute in the attribute list
196 virtual void processAttribute( sal_uInt16 nPrefix, const OUString& rLocalName, const OUString& rValue ) SAL_OVERRIDE;
199 // draw:polyline and draw:polygon context
201 class SdXMLPolygonShapeContext : public SdXMLShapeContext
203 OUString maPoints;
204 OUString maViewBox;
205 bool mbClosed;
207 public:
208 TYPEINFO_OVERRIDE();
210 SdXMLPolygonShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
211 const 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, bool bClosed, bool bTemporaryShape);
214 virtual ~SdXMLPolygonShapeContext();
215 virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList) SAL_OVERRIDE;
217 // this is called from the parent group for each unparsed attribute in the attribute list
218 virtual void processAttribute( sal_uInt16 nPrefix, const OUString& rLocalName, const OUString& rValue ) SAL_OVERRIDE;
221 // draw:path context
223 class SdXMLPathShapeContext : public SdXMLShapeContext
225 OUString maD;
226 OUString maViewBox;
228 public:
229 TYPEINFO_OVERRIDE();
231 SdXMLPathShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
232 const OUString& rLocalName,
233 const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
234 com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
235 bool bTemporaryShape);
236 virtual ~SdXMLPathShapeContext();
237 virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList) SAL_OVERRIDE;
239 // this is called from the parent group for each unparsed attribute in the attribute list
240 virtual void processAttribute( sal_uInt16 nPrefix, const OUString& rLocalName, const OUString& rValue ) SAL_OVERRIDE;
243 // draw:text-box context
245 class SdXMLTextBoxShapeContext : public SdXMLShapeContext
247 sal_Int32 mnRadius;
249 public:
250 TYPEINFO_OVERRIDE();
252 SdXMLTextBoxShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
253 const OUString& rLocalName,
254 const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
255 com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
256 bool bTemporaryShape);
257 virtual ~SdXMLTextBoxShapeContext();
258 virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList) SAL_OVERRIDE;
260 // this is called from the parent group for each unparsed attribute in the attribute list
261 virtual void processAttribute( sal_uInt16 nPrefix, const OUString& rLocalName, const OUString& rValue ) SAL_OVERRIDE;
264 // draw:control context
266 class SdXMLControlShapeContext : public SdXMLShapeContext
268 private:
269 OUString maFormId;
271 public:
272 TYPEINFO_OVERRIDE();
274 SdXMLControlShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
275 const OUString& rLocalName,
276 const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
277 com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
278 bool bTemporaryShape);
279 virtual ~SdXMLControlShapeContext();
280 virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList) SAL_OVERRIDE;
282 // this is called from the parent group for each unparsed attribute in the attribute list
283 virtual void processAttribute( sal_uInt16 nPrefix, const OUString& rLocalName, const OUString& rValue ) SAL_OVERRIDE;
286 // draw:connector context
288 class SdXMLConnectorShapeContext : public SdXMLShapeContext
290 private:
291 ::com::sun::star::awt::Point maStart;
292 ::com::sun::star::awt::Point maEnd;
294 sal_uInt16 mnType;
296 OUString maStartShapeId;
297 sal_Int32 mnStartGlueId;
298 OUString maEndShapeId;
299 sal_Int32 mnEndGlueId;
301 sal_Int32 mnDelta1;
302 sal_Int32 mnDelta2;
303 sal_Int32 mnDelta3;
305 com::sun::star::uno::Any maPath;
307 public:
308 TYPEINFO_OVERRIDE();
310 SdXMLConnectorShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
311 const OUString& rLocalName,
312 const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
313 com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
314 bool bTemporaryShape);
315 virtual ~SdXMLConnectorShapeContext();
316 virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList) SAL_OVERRIDE;
318 // this is called from the parent group for each unparsed attribute in the attribute list
319 virtual void processAttribute( sal_uInt16 nPrefix, const OUString& rLocalName, const OUString& rValue ) SAL_OVERRIDE;
322 // draw:measure context
324 class SdXMLMeasureShapeContext : public SdXMLShapeContext
326 private:
327 ::com::sun::star::awt::Point maStart;
328 ::com::sun::star::awt::Point maEnd;
330 public:
331 TYPEINFO_OVERRIDE();
333 SdXMLMeasureShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
334 const OUString& rLocalName,
335 const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
336 com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
337 bool bTemporaryShape);
338 virtual ~SdXMLMeasureShapeContext();
339 virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList) SAL_OVERRIDE;
340 virtual void EndElement() SAL_OVERRIDE;
342 // this is called from the parent group for each unparsed attribute in the attribute list
343 virtual void processAttribute( sal_uInt16 nPrefix, const OUString& rLocalName, const OUString& rValue ) SAL_OVERRIDE;
346 // draw:page context
348 class SdXMLPageShapeContext : public SdXMLShapeContext
350 private:
351 sal_Int32 mnPageNumber;
352 public:
353 TYPEINFO_OVERRIDE();
355 SdXMLPageShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
356 const OUString& rLocalName,
357 const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
358 com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
359 bool bTemporaryShape);
360 virtual ~SdXMLPageShapeContext();
361 virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList) SAL_OVERRIDE;
363 // this is called from the parent group for each unparsed attribute in the attribute list
364 virtual void processAttribute( sal_uInt16 nPrefix, const OUString& rLocalName, const OUString& rValue ) SAL_OVERRIDE;
367 // draw:caption context
369 class SdXMLCaptionShapeContext : public SdXMLShapeContext
371 private:
372 com::sun::star::awt::Point maCaptionPoint;
373 sal_Int32 mnRadius;
375 public:
376 TYPEINFO_OVERRIDE();
378 SdXMLCaptionShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
379 const OUString& rLocalName,
380 const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
381 com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
382 bool bTemporaryShape);
383 virtual ~SdXMLCaptionShapeContext();
384 virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList) SAL_OVERRIDE;
386 // this is called from the parent group for each unparsed attribute in the attribute list
387 virtual void processAttribute( sal_uInt16 nPrefix, const OUString& rLocalName, const OUString& rValue ) SAL_OVERRIDE;
390 // office:image context
392 class SdXMLGraphicObjectShapeContext : public SdXMLShapeContext
394 private:
395 OUString maURL;
396 ::com::sun::star::uno::Reference < ::com::sun::star::io::XOutputStream > mxBase64Stream;
398 public:
399 TYPEINFO_OVERRIDE();
401 SdXMLGraphicObjectShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
402 const OUString& rLocalName,
403 const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
404 com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
405 bool bTemporaryShape);
406 virtual ~SdXMLGraphicObjectShapeContext();
408 virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ) SAL_OVERRIDE;
409 virtual void EndElement() SAL_OVERRIDE;
410 virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName,
411 const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList ) SAL_OVERRIDE;
413 // this is called from the parent group for each unparsed attribute in the attribute list
414 virtual void processAttribute( sal_uInt16 nPrefix, const OUString& rLocalName, const OUString& rValue ) SAL_OVERRIDE;
417 // chart:chart context
419 class SdXMLChartShapeContext : public SdXMLShapeContext
421 SvXMLImportContext* mpChartContext;
423 public:
424 TYPEINFO_OVERRIDE();
426 SdXMLChartShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
427 const OUString& rLocalName,
428 const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
429 com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
430 bool bTemporaryShape);
431 virtual ~SdXMLChartShapeContext();
433 virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ) SAL_OVERRIDE;
434 virtual void EndElement() SAL_OVERRIDE;
435 virtual void Characters( const OUString& rChars ) SAL_OVERRIDE;
436 virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName,
437 const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList ) SAL_OVERRIDE;
440 // draw:object and draw:object_ole context
442 class SdXMLObjectShapeContext : public SdXMLShapeContext
444 private:
445 OUString maCLSID;
446 OUString maHref;
448 // #100592#
449 ::com::sun::star::uno::Reference < ::com::sun::star::io::XOutputStream > mxBase64Stream;
451 public:
452 TYPEINFO_OVERRIDE();
454 SdXMLObjectShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
455 const OUString& rLocalName,
456 const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
457 com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
458 bool bTemporaryShape);
459 virtual ~SdXMLObjectShapeContext();
461 virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ) SAL_OVERRIDE;
462 virtual void EndElement() SAL_OVERRIDE;
464 // #100592#
465 virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName,
466 const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList ) SAL_OVERRIDE;
468 // this is called from the parent group for each unparsed attribute in the attribute list
469 virtual void processAttribute( sal_uInt16 nPrefix, const OUString& rLocalName, const OUString& rValue ) SAL_OVERRIDE;
472 // draw:applet
474 class SdXMLAppletShapeContext : public SdXMLShapeContext
476 private:
477 OUString maAppletName;
478 OUString maAppletCode;
479 OUString maHref;
480 bool mbIsScript;
482 com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > maParams;
484 public:
485 TYPEINFO_OVERRIDE();
487 SdXMLAppletShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
488 const OUString& rLocalName,
489 const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
490 com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
491 bool bTemporaryShape);
492 virtual ~SdXMLAppletShapeContext();
494 virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ) SAL_OVERRIDE;
495 virtual void EndElement() SAL_OVERRIDE;
497 virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName,
498 const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList ) SAL_OVERRIDE;
500 // this is called from the parent group for each unparsed attribute in the attribute list
501 virtual void processAttribute( sal_uInt16 nPrefix, const OUString& rLocalName, const OUString& rValue ) SAL_OVERRIDE;
504 // draw:plugin
506 class SdXMLPluginShapeContext : public SdXMLShapeContext
508 private:
509 OUString maMimeType;
510 OUString maHref;
511 bool mbMedia;
513 com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > maParams;
515 public:
516 TYPEINFO_OVERRIDE();
518 SdXMLPluginShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
519 const OUString& rLocalName,
520 const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
521 com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
522 bool bTemporaryShape);
523 virtual ~SdXMLPluginShapeContext();
525 virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ) SAL_OVERRIDE;
526 virtual void EndElement() SAL_OVERRIDE;
528 virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName,
529 const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList ) SAL_OVERRIDE;
531 // this is called from the parent group for each unparsed attribute in the attribute list
532 virtual void processAttribute( sal_uInt16 nPrefix, const OUString& rLocalName, const OUString& rValue ) SAL_OVERRIDE;
534 const OUString& getMimeType() const { return maMimeType; }
537 // draw:floating-frame
539 class SdXMLFloatingFrameShapeContext : public SdXMLShapeContext
541 private:
542 OUString maFrameName;
543 OUString maHref;
545 public:
546 TYPEINFO_OVERRIDE();
548 SdXMLFloatingFrameShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
549 const OUString& rLocalName,
550 const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
551 com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
552 bool bTemporaryShape);
553 virtual ~SdXMLFloatingFrameShapeContext();
555 virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ) SAL_OVERRIDE;
556 virtual void EndElement() SAL_OVERRIDE;
558 // this is called from the parent group for each unparsed attribute in the attribute list
559 virtual void processAttribute( sal_uInt16 nPrefix, const OUString& rLocalName, const OUString& rValue ) SAL_OVERRIDE;
562 // draw:-frame
564 class SdXMLFrameShapeContext : public SdXMLShapeContext, public MultiImageImportHelper
566 private:
567 bool mbSupportsReplacement;
568 SvXMLImportContextRef mxImplContext;
569 SvXMLImportContextRef mxReplImplContext;
571 protected:
572 /// helper to get the created xShape instance, needs to be overridden
573 virtual OUString getGraphicURLFromImportContext(const SvXMLImportContext& rContext) const SAL_OVERRIDE;
574 virtual void removeGraphicFromImportContext(const SvXMLImportContext& rContext) const SAL_OVERRIDE;
576 public:
577 TYPEINFO_OVERRIDE();
579 SdXMLFrameShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
580 const OUString& rLocalName,
581 const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
582 com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
583 bool bTemporaryShape);
584 virtual ~SdXMLFrameShapeContext();
586 virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName,
587 const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList ) SAL_OVERRIDE;
589 virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ) SAL_OVERRIDE;
590 virtual void EndElement() SAL_OVERRIDE;
592 virtual void processAttribute( sal_uInt16 nPrefix, const OUString& rLocalName, const OUString& rValue ) SAL_OVERRIDE;
595 class SdXMLCustomShapeContext : public SdXMLShapeContext
598 protected :
600 OUString maCustomShapeEngine;
601 OUString maCustomShapeData;
603 std::vector< com::sun::star::beans::PropertyValue > maCustomShapeGeometry;
605 public:
607 TYPEINFO_OVERRIDE();
609 SdXMLCustomShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLocalName,
610 const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
611 com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
612 bool bTemporaryShape);
613 virtual ~SdXMLCustomShapeContext();
615 virtual void StartElement( const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList ) SAL_OVERRIDE;
616 virtual void EndElement() SAL_OVERRIDE;
618 virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName,
619 const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList ) SAL_OVERRIDE;
621 // this is called from the parent group for each unparsed attribute in the attribute list
622 virtual void processAttribute( sal_uInt16 nPrefix, const OUString& rLocalName, const OUString& rValue ) SAL_OVERRIDE;
625 // draw:table
627 class SdXMLTableShapeContext : public SdXMLShapeContext
629 public:
630 TYPEINFO_OVERRIDE();
632 SdXMLTableShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
633 const OUString& rLocalName,
634 const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
635 com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes );
636 virtual ~SdXMLTableShapeContext();
638 virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ) SAL_OVERRIDE;
639 virtual void EndElement() SAL_OVERRIDE;
641 virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList ) SAL_OVERRIDE;
643 // this is called from the parent group for each unparsed attribute in the attribute list
644 virtual void processAttribute( sal_uInt16 nPrefix, const OUString& rLocalName, const OUString& rValue ) SAL_OVERRIDE;
646 private:
647 SvXMLImportContextRef mxTableImportContext;
648 OUString msTemplateStyleName;
649 sal_Bool maTemplateStylesUsed[6];
652 #endif // INCLUDED_XMLOFF_SOURCE_DRAW_XIMPSHAP_HXX
654 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */