xref: /aoo42x/main/oox/inc/oox/xls/drawingmanager.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef OOX_XLS_DRAWINGMANAGER_HXX
29 #define OOX_XLS_DRAWINGMANAGER_HXX
30 
31 #include "oox/xls/drawingbase.hxx"
32 
33 namespace com { namespace sun { namespace star {
34     namespace drawing { class XDrawPage; }
35     namespace drawing { class XShape; }
36     namespace drawing { class XShapes; }
37 } } }
38 
39 namespace oox { namespace drawingml { class ShapePropertyMap; } }
40 
41 namespace oox {
42 namespace xls {
43 
44 // ============================================================================
45 
46 const sal_uInt16 BIFF_OBJ_INVALID_ID        = 0;
47 
48 // ============================================================================
49 // Model structures for BIFF OBJ record data
50 // ============================================================================
51 
52 /** This structure contains line formatting attributes from an OBJ record. */
53 struct BiffObjLineModel
54 {
55     sal_uInt8           mnColorIdx;         /// Index into color palette.
56     sal_uInt8           mnStyle;            /// Line dash style.
57     sal_uInt8           mnWidth;            /// Line width.
58     bool                mbAuto;             /// True = automatic line format.
59 
60     explicit            BiffObjLineModel();
61 
62     /** Returns true, if the line formatting is visible (automatic or explicit). */
63     bool                isVisible() const;
64 };
65 
66 // ============================================================================
67 
68 /** This structure contains fill formatting attributes from an OBJ record. */
69 struct BiffObjFillModel
70 {
71     sal_uInt8           mnBackColorIdx;     /// Index to color palette for background color.
72     sal_uInt8           mnPattColorIdx;     /// Index to color palette for pattern foreground color.
73     sal_uInt8           mnPattern;          /// Fill pattern.
74     bool                mbAuto;             /// True = automatic fill format.
75 
76     explicit            BiffObjFillModel();
77 
78     /** Returns true, if the fill formatting is visible (automatic or explicit). */
79     bool                isFilled() const;
80 };
81 
82 // ============================================================================
83 
84 /** This structure contains text formatting attributes from an OBJ record. */
85 struct BiffObjTextModel
86 {
87     sal_uInt16          mnTextLen;          /// Length of the text (characters).
88     sal_uInt16          mnFormatSize;       /// Size of the formatting array (bytes).
89     sal_uInt16          mnLinkSize;         /// Size of the linked text formula (bytes).
90     sal_uInt16          mnDefFontId;        /// Font index for default font formatting.
91     sal_uInt16          mnFlags;            /// Additional flags.
92     sal_uInt16          mnOrientation;      /// Text orientation.
93     sal_uInt16          mnButtonFlags;      /// Additional flags for push buttons.
94     sal_uInt16          mnShortcut;         /// Shortcut character.
95     sal_uInt16          mnShortcutEA;       /// East-asian shortcut character.
96 
97     explicit            BiffObjTextModel();
98 
99     /** Reads text data from a BIFF3/BIFF4 OBJ record. */
100     void                readObj3( BiffInputStream& rStrm );
101     /** Reads text data from a BIFF5 OBJ record. */
102     void                readObj5( BiffInputStream& rStrm );
103     /** Reads text data from a BIFF8 TXO record. */
104     void                readTxo8( BiffInputStream& rStrm );
105 
106     /** Returns the horizontal alignment of the text. */
107     sal_uInt8           getHorAlign() const;
108     /** Returns the vertical alignment of the text. */
109     sal_uInt8           getVerAlign() const;
110 };
111 
112 // ============================================================================
113 // BIFF drawing objects
114 // ============================================================================
115 
116 class BiffDrawingBase;
117 class BiffDrawingObjectBase;
118 typedef ::boost::shared_ptr< BiffDrawingObjectBase > BiffDrawingObjectRef;
119 
120 // ----------------------------------------------------------------------------
121 
122 class BiffDrawingObjectContainer
123 {
124 public:
125     explicit            BiffDrawingObjectContainer();
126 
127     /** Returns true, if the object list is empty. */
128     inline bool         empty() const { return maObjects.empty(); }
129 
130     /** Appends the passed object to the list of objects. */
131     void                append( const BiffDrawingObjectRef& rxDrawingObj );
132     /** Tries to insert the passed object into the last group or appends it. */
133     void                insertGrouped( const BiffDrawingObjectRef& rxDrawingObj );
134 
135     /** Creates and inserts all UNO shapes into the passed shape container. */
136     void                convertAndInsert( BiffDrawingBase& rDrawing,
137                             const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
138                             const ::com::sun::star::awt::Rectangle* pParentRect = 0 ) const;
139 
140 private:
141     typedef RefVector< BiffDrawingObjectBase > BiffDrawingObjectVector;
142     BiffDrawingObjectVector maObjects;
143 };
144 
145 // ============================================================================
146 
147 /** Base class for all BIFF drawing objects (OBJ records). */
148 class BiffDrawingObjectBase : public WorksheetHelper
149 {
150 public:
151     explicit            BiffDrawingObjectBase( const WorksheetHelper& rHelper );
152     virtual             ~BiffDrawingObjectBase();
153 
154     /** Reads the BIFF3 OBJ record, returns a new drawing object. */
155     static BiffDrawingObjectRef importObjBiff3( const WorksheetHelper& rHelper, BiffInputStream& rStrm );
156     /** Reads the BIFF4 OBJ record, returns a new drawing object. */
157     static BiffDrawingObjectRef importObjBiff4( const WorksheetHelper& rHelper, BiffInputStream& rStrm );
158     /** Reads the BIFF5 OBJ record, returns a new drawing object. */
159     static BiffDrawingObjectRef importObjBiff5( const WorksheetHelper& rHelper, BiffInputStream& rStrm );
160     /** Reads the BIFF8 OBJ record, returns a new drawing object. */
161     static BiffDrawingObjectRef importObjBiff8( const WorksheetHelper& rHelper, BiffInputStream& rStrm );
162 
163     /** Sets whether this is an area object (then its width and height must be greater than 0). */
164     inline void         setAreaObj( bool bAreaObj ) { mbAreaObj = bAreaObj; }
165     /** If set to true, the object supports a simple on-click macro and/or hyperlink. */
166     inline void         setSimpleMacro( bool bMacro ) { mbSimpleMacro = bMacro; }
167 
168     /** If set to false, the UNO shape will not be created, processed, or inserted into the draw page. */
169     inline void         setProcessShape( bool bProcess ) { mbProcessShape = bProcess; }
170     /** If set to false, the UNO shape will be created or processed, but not be inserted into the draw page. */
171     inline void         setInsertShape( bool bInsert ) { mbInsertShape = bInsert; }
172     /** If set to true, a new custom UNO shape will be created while in DFF import (BIFF8 only). */
173     inline void         setCustomDffObj( bool bCustom ) { mbCustomDff = bCustom; }
174 
175     /** Returns the object identifier from the OBJ record. */
176     inline sal_uInt16   getObjId() const { return mnObjId; }
177     /** Returns the object type from the OBJ record. */
178     inline sal_uInt16   getObjType() const { return mnObjType; }
179 
180     /** Returns true, if the object is hidden. */
181     inline bool         isHidden() const { return mbHidden; }
182     /** Returns true, if the object is visible. */
183     inline bool         isVisible() const { return mbVisible; }
184     /** Returns true, if the object is printable. */
185     inline bool         isPrintable() const { return mbPrintable; }
186 
187     /** Creates the UNO shape and inserts it into the passed shape container. */
188     ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
189                         convertAndInsert( BiffDrawingBase& rDrawing,
190                             const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
191                             const ::com::sun::star::awt::Rectangle* pParentRect = 0 ) const;
192 
193 protected:
194     /** Reads the object name in a BIFF5 OBJ record. */
195     void                readNameBiff5( BiffInputStream& rStrm, sal_uInt16 nNameLen );
196     /** Reads the macro link in a BIFF3 OBJ record. */
197     void                readMacroBiff3( BiffInputStream& rStrm, sal_uInt16 nMacroSize );
198     /** Reads the macro link in a BIFF4 OBJ record. */
199     void                readMacroBiff4( BiffInputStream& rStrm, sal_uInt16 nMacroSize );
200     /** Reads the macro link in a BIFF5 OBJ record. */
201     void                readMacroBiff5( BiffInputStream& rStrm, sal_uInt16 nMacroSize );
202     /** Reads the contents of the ftMacro sub structure in an OBJ record. */
203     void                readMacroBiff8( BiffInputStream& rStrm );
204 
205     /** Converts the passed line formatting to the passed property map. */
206     void                convertLineProperties( ::oox::drawingml::ShapePropertyMap& rPropMap, const BiffObjLineModel& rLineModel, sal_uInt16 nArrows = 0 ) const;
207     /** Converts the passed fill formatting to the passed property map. */
208     void                convertFillProperties( ::oox::drawingml::ShapePropertyMap& rPropMap, const BiffObjFillModel& rFillModel ) const;
209     /** Converts the passed frame flags to the passed property map. */
210     void                convertFrameProperties( ::oox::drawingml::ShapePropertyMap& rPropMap, sal_uInt16 nFrameFlags ) const;
211 
212     /** Derived classes read the contents of the a BIFF3 OBJ record from the passed stream. */
213     virtual void        implReadObjBiff3( BiffInputStream& rStrm, sal_uInt16 nMacroSize );
214     /** Derived classes read the contents of the a BIFF4 OBJ record from the passed stream. */
215     virtual void        implReadObjBiff4( BiffInputStream& rStrm, sal_uInt16 nMacroSize );
216     /** Derived classes read the contents of the a BIFF5 OBJ record from the passed stream. */
217     virtual void        implReadObjBiff5( BiffInputStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 nMacroSize );
218     /** Derived classes read the contents of the specified subrecord of a BIFF8 OBJ record from stream. */
219     virtual void        implReadObjBiff8SubRec( BiffInputStream& rStrm, sal_uInt16 nSubRecId, sal_uInt16 nSubRecSize );
220 
221     /** Derived classes create the corresponding XShape and insert it into the passed container. */
222     virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
223                         implConvertAndInsert( BiffDrawingBase& rDrawing,
224                             const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
225                             const ::com::sun::star::awt::Rectangle& rShapeRect ) const = 0;
226 
227 private:
228     /** Reads the contents of a BIFF3 OBJ record. */
229     void                importObjBiff3( BiffInputStream& rStrm );
230     /** Reads the contents of a BIFF4 OBJ record. */
231     void                importObjBiff4( BiffInputStream& rStrm );
232     /** Reads the contents of a BIFF5 OBJ record. */
233     void                importObjBiff5( BiffInputStream& rStrm );
234     /** Reads the contents of a BIFF8 OBJ record. */
235     void                importObjBiff8( BiffInputStream& rStrm );
236 
237 private:
238     ShapeAnchor         maAnchor;       /// Position of the drawing object.
239     ::rtl::OUString     maObjName;      /// Name of the object.
240     ::rtl::OUString     maMacroName;    /// Name of an attached macro.
241     ::rtl::OUString     maHyperlink;    /// On-click hyperlink URL.
242     sal_uInt32          mnDffShapeId;   /// Shape identifier from DFF stream (BIFF8 only).
243     sal_uInt32          mnDffFlags;     /// Shape flags from DFF stream.
244     sal_uInt16          mnObjId;        /// The object identifier (unique per drawing).
245     sal_uInt16          mnObjType;      /// The object type from OBJ record.
246     bool                mbHasAnchor;    /// True = anchor has been initialized.
247     bool                mbHidden;       /// True = object is hidden.
248     bool                mbVisible;      /// True = object is visible (form controls).
249     bool                mbPrintable;    /// True = object is printable.
250     bool                mbAreaObj;      /// True = width and height must be greater than 0.
251     bool                mbAutoMargin;   /// True = set automatic text margin.
252     bool                mbSimpleMacro;  /// True = create simple macro link and hyperlink.
253     bool                mbProcessShape; /// True = object is valid, do processing and insertion.
254     bool                mbInsertShape;  /// True = insert the UNO shape into the draw page.
255     bool                mbCustomDff;    /// True = recreate UNO shape in DFF import (BIFF8 only).
256 };
257 
258 // ============================================================================
259 
260 /** A placeholder object for unknown/unsupported object types. */
261 class BiffPlaceholderObject : public BiffDrawingObjectBase
262 {
263 public:
264     explicit            BiffPlaceholderObject( const WorksheetHelper& rHelper );
265 
266 protected:
267     /** Creates the corresponding XShape and insert it into the passed container. */
268     virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
269                         implConvertAndInsert( BiffDrawingBase& rDrawing,
270                             const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
271                             const ::com::sun::star::awt::Rectangle& rShapeRect ) const;
272 };
273 
274 // ============================================================================
275 
276 /** A group object that is able to contain other child objects. */
277 class BiffGroupObject : public BiffDrawingObjectBase
278 {
279 public:
280     explicit            BiffGroupObject( const WorksheetHelper& rHelper );
281 
282     /** Tries to insert the passed drawing object into this or a nested group. */
283     bool                tryInsert( const BiffDrawingObjectRef& rxDrawingObj );
284 
285 protected:
286     /** Reads the contents of the a BIFF3 OBJ record from the passed stream. */
287     virtual void        implReadObjBiff3( BiffInputStream& rStrm, sal_uInt16 nMacroSize );
288     /** Reads the contents of the a BIFF4 OBJ record from the passed stream. */
289     virtual void        implReadObjBiff4( BiffInputStream& rStrm, sal_uInt16 nMacroSize );
290     /** Reads the contents of the a BIFF5 OBJ record from the passed stream. */
291     virtual void        implReadObjBiff5( BiffInputStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 nMacroSize );
292 
293     /** Creates the corresponding XShape and insert it into the passed container. */
294     virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
295                         implConvertAndInsert( BiffDrawingBase& rDrawing,
296                             const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
297                             const ::com::sun::star::awt::Rectangle& rShapeRect ) const;
298 
299 protected:
300     BiffDrawingObjectContainer maChildren;     /// All child objects contained in this group object.
301     sal_uInt16          mnFirstUngrouped;   /// Object identfier of first object not grouped into this group.
302 };
303 
304 // ============================================================================
305 
306 /** A simple line object. */
307 class BiffLineObject : public BiffDrawingObjectBase
308 {
309 public:
310     explicit            BiffLineObject( const WorksheetHelper& rHelper );
311 
312 protected:
313     /** Reads the contents of the a BIFF3 OBJ record from the passed stream. */
314     virtual void        implReadObjBiff3( BiffInputStream& rStrm, sal_uInt16 nMacroSize );
315     /** Reads the contents of the a BIFF4 OBJ record from the passed stream. */
316     virtual void        implReadObjBiff4( BiffInputStream& rStrm, sal_uInt16 nMacroSize );
317     /** Reads the contents of the a BIFF5 OBJ record from the passed stream. */
318     virtual void        implReadObjBiff5( BiffInputStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 nMacroSize );
319 
320     /** Creates the corresponding XShape and insert it into the passed container. */
321     virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
322                         implConvertAndInsert( BiffDrawingBase& rDrawing,
323                             const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
324                             const ::com::sun::star::awt::Rectangle& rShapeRect ) const;
325 
326 protected:
327     BiffObjLineModel    maLineModel;    /// Line formatting.
328     sal_uInt16          mnArrows;       /// Line arrows.
329     sal_uInt8           mnStartPoint;   /// Starting point.
330 };
331 
332 // ============================================================================
333 
334 /** A simple rectangle object (used as base class for oval objects). */
335 class BiffRectObject : public BiffDrawingObjectBase
336 {
337 public:
338     explicit            BiffRectObject( const WorksheetHelper& rHelper );
339 
340 protected:
341     /** Reads the fill model, the line model, and frame flags. */
342     void                readFrameData( BiffInputStream& rStrm );
343 
344     /** Converts fill formatting, line formatting, and frame style. */
345     void                convertRectProperties( ::oox::drawingml::ShapePropertyMap& rPropMap ) const;
346 
347     /** Reads the contents of the a BIFF3 OBJ record from the passed stream. */
348     virtual void        implReadObjBiff3( BiffInputStream& rStrm, sal_uInt16 nMacroSize );
349     /** Reads the contents of the a BIFF4 OBJ record from the passed stream. */
350     virtual void        implReadObjBiff4( BiffInputStream& rStrm, sal_uInt16 nMacroSize );
351     /** Reads the contents of the a BIFF5 OBJ record from the passed stream. */
352     virtual void        implReadObjBiff5( BiffInputStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 nMacroSize );
353 
354     /** Creates the corresponding XShape and insert it into the passed container. */
355     virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
356                         implConvertAndInsert( BiffDrawingBase& rDrawing,
357                             const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
358                             const ::com::sun::star::awt::Rectangle& rShapeRect ) const;
359 
360 protected:
361     BiffObjFillModel    maFillModel;    /// Fill formatting.
362     BiffObjLineModel    maLineModel;    /// Line formatting.
363     sal_uInt16          mnFrameFlags;   /// Additional flags.
364 };
365 
366 // ============================================================================
367 
368 /** A simple oval object. */
369 class BiffOvalObject : public BiffRectObject
370 {
371 public:
372     explicit            BiffOvalObject( const WorksheetHelper& rHelper );
373 
374 protected:
375     /** Creates the corresponding XShape and insert it into the passed container. */
376     virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
377                         implConvertAndInsert( BiffDrawingBase& rDrawing,
378                             const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
379                             const ::com::sun::star::awt::Rectangle& rShapeRect ) const;
380 };
381 
382 // ============================================================================
383 
384 /** A simple arc object. */
385 class BiffArcObject : public BiffDrawingObjectBase
386 {
387 public:
388     explicit            BiffArcObject( const WorksheetHelper& rHelper );
389 
390 protected:
391     /** Reads the contents of the a BIFF3 OBJ record from the passed stream. */
392     virtual void        implReadObjBiff3( BiffInputStream& rStrm, sal_uInt16 nMacroSize );
393     /** Reads the contents of the a BIFF4 OBJ record from the passed stream. */
394     virtual void        implReadObjBiff4( BiffInputStream& rStrm, sal_uInt16 nMacroSize );
395     /** Reads the contents of the a BIFF5 OBJ record from the passed stream. */
396     virtual void        implReadObjBiff5( BiffInputStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 nMacroSize );
397 
398     /** Creates the corresponding XShape and insert it into the passed container. */
399     virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
400                         implConvertAndInsert( BiffDrawingBase& rDrawing,
401                             const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
402                             const ::com::sun::star::awt::Rectangle& rShapeRect ) const;
403 
404 protected:
405     BiffObjFillModel    maFillModel;    /// Fill formatting.
406     BiffObjLineModel    maLineModel;    /// Line formatting.
407     sal_uInt8           mnQuadrant;     /// Visible quadrant of the circle.
408 };
409 
410 // ============================================================================
411 
412 /** A simple polygon object. */
413 class BiffPolygonObject : public BiffRectObject
414 {
415 public:
416     explicit            BiffPolygonObject( const WorksheetHelper& rHelper );
417 
418 protected:
419     /** Reads the contents of the a BIFF4 OBJ record from the passed stream. */
420     virtual void        implReadObjBiff4( BiffInputStream& rStrm, sal_uInt16 nMacroSize );
421     /** Reads the contents of the a BIFF5 OBJ record from the passed stream. */
422     virtual void        implReadObjBiff5( BiffInputStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 nMacroSize );
423 
424     /** Creates the corresponding XShape and insert it into the passed container. */
425     virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
426                         implConvertAndInsert( BiffDrawingBase& rDrawing,
427                             const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
428                             const ::com::sun::star::awt::Rectangle& rShapeRect ) const;
429 
430 private:
431     /** Reads the COORDLIST record following the OBJ record. */
432     void                importCoordList( BiffInputStream& rStrm );
433 
434 protected:
435     typedef ::std::vector< ::com::sun::star::awt::Point > PointVector;
436     PointVector         maCoords;       /// Coordinates relative to bounding rectangle.
437     sal_uInt16          mnPolyFlags;    /// Additional flags.
438     sal_uInt16          mnPointCount;   /// Polygon point count.
439 };
440 
441 // ============================================================================
442 // BIFF drawing page
443 // ============================================================================
444 
445 /** Base class for a container for all objects on a drawing page (in a
446     spreadsheet or in an embedded chart object).
447 
448     For BIFF import, it is needed to load all drawing objects before converting
449     them to UNO shapes. There might be some dummy drawing objects (e.g. the
450     dropdown buttons of autofilters) which have to be skipped. The information,
451     that a drawing object is a dummy object, may be located after the drawing
452     objects themselves.
453 
454     The BIFF8 format stores drawing objects in the DFF stream (stored
455     fragmented in MSODRAWING records), and in the OBJ records. The DFF stream
456     fragments are collected in a single stream, and the complete stream will be
457     processed afterwards.
458  */
459 class BiffDrawingBase : public WorksheetHelper
460 {
461 public:
462     explicit            BiffDrawingBase( const WorksheetHelper& rHelper,
463                             const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& rxDrawPage );
464 
465     /** Imports a plain OBJ record (without leading DFF data). */
466     void                importObj( BiffInputStream& rStrm );
467     /** Sets the object with the passed identifier to be skipped on import. */
468     void                setSkipObj( sal_uInt16 nObjId );
469 
470     /** Final processing after import of the all drawing objects. */
471     void                finalizeImport();
472 
473     /** Creates a new UNO shape object, inserts it into the passed UNO shape
474         container, and sets the shape position and size. */
475     ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
476                         createAndInsertXShape(
477                             const ::rtl::OUString& rService,
478                             const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
479                             const ::com::sun::star::awt::Rectangle& rShapeRect ) const;
480 
481     /** Derived classes may want to know that a shape has been inserted. Will
482         be called from the convertAndInsert() implementation. */
483     virtual void        notifyShapeInserted(
484                             const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rxShape,
485                             const ::com::sun::star::awt::Rectangle& rShapeRect ) = 0;
486 
487 protected:
488     /** Appends a new drawing object to the list of raw objects (without DFF data). */
489     void                appendRawObject( const BiffDrawingObjectRef& rxDrawingObj );
490 
491 private:
492     typedef RefMap< sal_uInt16, BiffDrawingObjectBase > BiffDrawingObjectMapById;
493     typedef ::std::vector< sal_uInt16 >                 BiffObjIdVector;
494 
495     ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >
496                         mxDrawPage;         /// UNO draw page used to insert the shapes.
497     BiffDrawingObjectContainer maRawObjs;   /// Drawing objects without DFF data.
498     BiffDrawingObjectMapById maObjMapId;    /// Maps drawing objects by their object identifiers.
499     BiffObjIdVector     maSkipObjs;         /// Identifiers of all objects to be skipped.
500 };
501 
502 // ----------------------------------------------------------------------------
503 
504 /** Drawing manager of a single sheet. */
505 class BiffSheetDrawing : public BiffDrawingBase
506 {
507 public:
508     explicit            BiffSheetDrawing( const WorksheetHelper& rHelper );
509 
510     /** Called when a new UNO shape has been inserted into the draw page. */
511     virtual void        notifyShapeInserted(
512                             const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rxShape,
513                             const ::com::sun::star::awt::Rectangle& rShapeRect );
514 };
515 
516 // ============================================================================
517 
518 } // namespace xls
519 } // namespace oox
520 
521 #endif
522