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