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