xref: /trunk/main/sc/source/filter/inc/xeescher.hxx (revision 0de526bd)
138d50f7bSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
338d50f7bSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
438d50f7bSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
538d50f7bSAndrew Rist  * distributed with this work for additional information
638d50f7bSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
738d50f7bSAndrew Rist  * to you under the Apache License, Version 2.0 (the
838d50f7bSAndrew Rist  * "License"); you may not use this file except in compliance
938d50f7bSAndrew Rist  * with the License.  You may obtain a copy of the License at
1038d50f7bSAndrew Rist  *
1138d50f7bSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
1238d50f7bSAndrew Rist  *
1338d50f7bSAndrew Rist  * Unless required by applicable law or agreed to in writing,
1438d50f7bSAndrew Rist  * software distributed under the License is distributed on an
1538d50f7bSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1638d50f7bSAndrew Rist  * KIND, either express or implied.  See the License for the
1738d50f7bSAndrew Rist  * specific language governing permissions and limitations
1838d50f7bSAndrew Rist  * under the License.
1938d50f7bSAndrew Rist  *
2038d50f7bSAndrew Rist  *************************************************************/
2138d50f7bSAndrew Rist 
2238d50f7bSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef SC_XEESCHER_HXX
25cdf0e10cSrcweir #define SC_XEESCHER_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <vcl/graph.hxx>
28cdf0e10cSrcweir #include <filter/msfilter/escherex.hxx>
29cdf0e10cSrcweir #include "xcl97rec.hxx"
30cdf0e10cSrcweir #include "xlescher.hxx"
31cdf0e10cSrcweir 
32cdf0e10cSrcweir namespace com { namespace sun { namespace star {
33cdf0e10cSrcweir     namespace script { struct ScriptEventDescriptor; }
34cdf0e10cSrcweir } } }
35cdf0e10cSrcweir 
36cdf0e10cSrcweir // DFF client anchor ==========================================================
37cdf0e10cSrcweir 
38cdf0e10cSrcweir /** Base class for DFF client anchor atoms used in spreadsheets. */
39cdf0e10cSrcweir class XclExpDffAnchorBase : public EscherExClientAnchor_Base, protected XclExpRoot
40cdf0e10cSrcweir {
41cdf0e10cSrcweir public:
42cdf0e10cSrcweir     /** Constructs a dummy client anchor. */
43cdf0e10cSrcweir     explicit            XclExpDffAnchorBase( const XclExpRoot& rRoot, sal_uInt16 nFlags = 0 );
44cdf0e10cSrcweir 
45cdf0e10cSrcweir     /** Sets the flags according to the passed SdrObject. */
46cdf0e10cSrcweir     void                SetFlags( const SdrObject& rSdrObj );
47cdf0e10cSrcweir     /** Sets the anchor position and flags according to the passed SdrObject. */
48cdf0e10cSrcweir     void                SetSdrObject( const SdrObject& rSdrObj );
49cdf0e10cSrcweir 
50cdf0e10cSrcweir     /** Writes the DFF client anchor structure with the current anchor position. */
51cdf0e10cSrcweir     void                WriteDffData( EscherEx& rEscherEx ) const;
52cdf0e10cSrcweir 
53cdf0e10cSrcweir     /** Called from SVX DFF converter.
54cdf0e10cSrcweir         @param rRect  The object anchor rectangle to be exported (in twips). */
55cdf0e10cSrcweir     virtual void        WriteData( EscherEx& rEscherEx, const Rectangle& rRect );
56cdf0e10cSrcweir 
57cdf0e10cSrcweir private:
58cdf0e10cSrcweir     virtual void        ImplSetFlags( const SdrObject& rSdrObj );
59cdf0e10cSrcweir     virtual void        ImplCalcAnchorRect( const Rectangle& rRect, MapUnit eMapUnit );
60cdf0e10cSrcweir 
61cdf0e10cSrcweir protected:  // for access in derived classes
62cdf0e10cSrcweir     XclObjAnchor        maAnchor;       /// The client anchor data.
63cdf0e10cSrcweir     sal_uInt16          mnFlags;        /// Flags for DFF stream export.
64cdf0e10cSrcweir };
65cdf0e10cSrcweir 
66cdf0e10cSrcweir // ----------------------------------------------------------------------------
67cdf0e10cSrcweir 
68cdf0e10cSrcweir /** Represents the position (anchor) of an object in a Calc sheet. */
69cdf0e10cSrcweir class XclExpDffSheetAnchor : public XclExpDffAnchorBase
70cdf0e10cSrcweir {
71cdf0e10cSrcweir public:
72cdf0e10cSrcweir     explicit            XclExpDffSheetAnchor( const XclExpRoot& rRoot );
73cdf0e10cSrcweir 
74cdf0e10cSrcweir private:
75cdf0e10cSrcweir     virtual void        ImplSetFlags( const SdrObject& rSdrObj );
76cdf0e10cSrcweir     virtual void        ImplCalcAnchorRect( const Rectangle& rRect, MapUnit eMapUnit );
77cdf0e10cSrcweir 
78cdf0e10cSrcweir private:
79cdf0e10cSrcweir     SCTAB               mnScTab;        /// Calc sheet index.
80cdf0e10cSrcweir };
81cdf0e10cSrcweir 
82cdf0e10cSrcweir // ----------------------------------------------------------------------------
83cdf0e10cSrcweir 
84cdf0e10cSrcweir /** Represents the position (anchor) of a shape in an embedded draw page. */
85cdf0e10cSrcweir class XclExpDffEmbeddedAnchor : public XclExpDffAnchorBase
86cdf0e10cSrcweir {
87cdf0e10cSrcweir public:
88cdf0e10cSrcweir     explicit            XclExpDffEmbeddedAnchor( const XclExpRoot& rRoot,
89cdf0e10cSrcweir                             const Size& rPageSize, sal_Int32 nScaleX, sal_Int32 nScaleY );
90cdf0e10cSrcweir 
91cdf0e10cSrcweir private:
92cdf0e10cSrcweir     virtual void        ImplSetFlags( const SdrObject& rSdrObj );
93cdf0e10cSrcweir     virtual void        ImplCalcAnchorRect( const Rectangle& rRect, MapUnit eMapUnit );
94cdf0e10cSrcweir 
95cdf0e10cSrcweir private:
96cdf0e10cSrcweir     Size                maPageSize;
97cdf0e10cSrcweir     sal_Int32           mnScaleX;
98cdf0e10cSrcweir     sal_Int32           mnScaleY;
99cdf0e10cSrcweir };
100cdf0e10cSrcweir 
101cdf0e10cSrcweir // ----------------------------------------------------------------------------
102cdf0e10cSrcweir 
103cdf0e10cSrcweir /** Represents the position (anchor) of a note object. */
104cdf0e10cSrcweir class XclExpDffNoteAnchor : public XclExpDffAnchorBase
105cdf0e10cSrcweir {
106cdf0e10cSrcweir public:
107cdf0e10cSrcweir     explicit            XclExpDffNoteAnchor( const XclExpRoot& rRoot, const Rectangle& rRect );
108cdf0e10cSrcweir };
109cdf0e10cSrcweir 
110cdf0e10cSrcweir // ----------------------------------------------------------------------------
111cdf0e10cSrcweir 
112cdf0e10cSrcweir /** Represents the position (anchor) of a cell dropdown object. */
113cdf0e10cSrcweir class XclExpDffDropDownAnchor : public XclExpDffAnchorBase
114cdf0e10cSrcweir {
115cdf0e10cSrcweir public:
116cdf0e10cSrcweir     explicit            XclExpDffDropDownAnchor( const XclExpRoot& rRoot, const ScAddress& rScPos );
117cdf0e10cSrcweir };
118cdf0e10cSrcweir 
119cdf0e10cSrcweir // MSODRAWING* records ========================================================
120cdf0e10cSrcweir 
121cdf0e10cSrcweir /** Base class for records holding DFF stream fragments. */
122cdf0e10cSrcweir class XclExpMsoDrawingBase : public XclExpRecord
123cdf0e10cSrcweir {
124cdf0e10cSrcweir public:
125cdf0e10cSrcweir     explicit            XclExpMsoDrawingBase( XclEscherEx& rEscherEx, sal_uInt16 nRecId );
126cdf0e10cSrcweir 
127cdf0e10cSrcweir private:
128cdf0e10cSrcweir     virtual void        WriteBody( XclExpStream& rStrm );
129cdf0e10cSrcweir 
130cdf0e10cSrcweir protected:
131cdf0e10cSrcweir     XclEscherEx&        mrEscherEx;         /// Reference to the DFF converter containing the DFF stream.
132cdf0e10cSrcweir     sal_uInt32          mnFragmentKey;      /// The key of the DFF stream fragment to be written by this record.
133cdf0e10cSrcweir };
134cdf0e10cSrcweir 
135cdf0e10cSrcweir // ----------------------------------------------------------------------------
136cdf0e10cSrcweir 
137cdf0e10cSrcweir /** The MSODRAWINGGROUP record contains the DGGCONTAINER with global DFF data
138cdf0e10cSrcweir     such as the picture container.
139cdf0e10cSrcweir  */
140cdf0e10cSrcweir class XclExpMsoDrawingGroup : public XclExpMsoDrawingBase
141cdf0e10cSrcweir {
142cdf0e10cSrcweir public:
143cdf0e10cSrcweir     explicit            XclExpMsoDrawingGroup( XclEscherEx& rEscherEx );
144cdf0e10cSrcweir };
145cdf0e10cSrcweir 
146cdf0e10cSrcweir // ----------------------------------------------------------------------------
147cdf0e10cSrcweir 
148cdf0e10cSrcweir /** One or more MSODRAWING records contain the DFF stream data for a drawing
149cdf0e10cSrcweir     shape.
150cdf0e10cSrcweir  */
151cdf0e10cSrcweir class XclExpMsoDrawing : public XclExpMsoDrawingBase
152cdf0e10cSrcweir {
153cdf0e10cSrcweir public:
154cdf0e10cSrcweir     explicit            XclExpMsoDrawing( XclEscherEx& rEscherEx );
155cdf0e10cSrcweir };
156cdf0e10cSrcweir 
157cdf0e10cSrcweir // ============================================================================
158cdf0e10cSrcweir 
159cdf0e10cSrcweir /** Provides export of bitmap data to an IMGDATA record. */
160cdf0e10cSrcweir class XclExpImgData : public XclExpRecordBase
161cdf0e10cSrcweir {
162cdf0e10cSrcweir public:
163cdf0e10cSrcweir     explicit            XclExpImgData( const Graphic& rGraphic, sal_uInt16 nRecId );
164cdf0e10cSrcweir 
165cdf0e10cSrcweir     /** Writes the BITMAP record. */
166cdf0e10cSrcweir     virtual void        Save( XclExpStream& rStrm );
167cdf0e10cSrcweir 
168cdf0e10cSrcweir private:
169cdf0e10cSrcweir     Graphic             maGraphic;      /// The VCL graphic.
170cdf0e10cSrcweir     sal_uInt16          mnRecId;        /// Record identifier for the IMGDATA record.
171cdf0e10cSrcweir };
172cdf0e10cSrcweir 
173cdf0e10cSrcweir // ============================================================================
174cdf0e10cSrcweir 
175cdf0e10cSrcweir /** Helper class for form controils to manage spreadsheet links . */
176cdf0e10cSrcweir class XclExpControlHelper : protected XclExpRoot
177cdf0e10cSrcweir {
178cdf0e10cSrcweir public:
179cdf0e10cSrcweir     explicit            XclExpControlHelper( const XclExpRoot& rRoot );
180cdf0e10cSrcweir     virtual             ~XclExpControlHelper();
181cdf0e10cSrcweir 
182cdf0e10cSrcweir protected:
183cdf0e10cSrcweir     /** Tries to get spreadsheet cell link and source range link from the passed shape. */
184cdf0e10cSrcweir     void                ConvertSheetLinks(
185cdf0e10cSrcweir                             ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape );
186cdf0e10cSrcweir 
187cdf0e10cSrcweir 
188cdf0e10cSrcweir     /** Returns the Excel token array of the cell link, or 0, if no link present. */
GetCellLinkTokArr() const189cdf0e10cSrcweir     inline const XclTokenArray* GetCellLinkTokArr() const { return mxCellLink.get(); }
190cdf0e10cSrcweir     /** Returns the Excel token array of the source range, or 0, if no link present. */
GetSourceRangeTokArr() const191cdf0e10cSrcweir     inline const XclTokenArray* GetSourceRangeTokArr() const { return mxSrcRange.get(); }
192cdf0e10cSrcweir     /** Returns the number of entries in the source range, or 0, if no source set. */
GetSourceEntryCount() const193cdf0e10cSrcweir     inline sal_uInt16   GetSourceEntryCount() const { return mnEntryCount; }
194cdf0e10cSrcweir 
195cdf0e10cSrcweir     /** Writes a formula with special style only valid in OBJ records. */
196cdf0e10cSrcweir     void                WriteFormula( XclExpStream& rStrm, const XclTokenArray& rTokArr ) const;
197cdf0e10cSrcweir     /** Writes a formula subrecord with special style only valid in OBJ records. */
198cdf0e10cSrcweir     void                WriteFormulaSubRec( XclExpStream& rStrm, sal_uInt16 nSubRecId, const XclTokenArray& rTokArr ) const;
199cdf0e10cSrcweir 
200cdf0e10cSrcweir private:
201cdf0e10cSrcweir     XclTokenArrayRef    mxCellLink;     /// Formula for linked cell.
202cdf0e10cSrcweir     XclTokenArrayRef    mxSrcRange;     /// Formula for source data range.
203cdf0e10cSrcweir     sal_uInt16          mnEntryCount;   /// Number of entries in source range.
204cdf0e10cSrcweir };
205cdf0e10cSrcweir 
206cdf0e10cSrcweir // ----------------------------------------------------------------------------
207cdf0e10cSrcweir 
208*0de526bdSJianyuan Li //delete for exporting OCX
209*0de526bdSJianyuan Li //#if EXC_EXP_OCX_CTRL
210cdf0e10cSrcweir 
211cdf0e10cSrcweir /** Represents an OBJ record for an OCX form control. */
212cdf0e10cSrcweir class XclExpOcxControlObj : public XclObj, public XclExpControlHelper
213cdf0e10cSrcweir {
214cdf0e10cSrcweir public:
215cdf0e10cSrcweir     explicit            XclExpOcxControlObj(
216cdf0e10cSrcweir                             XclExpObjectManager& rObjMgr,
217cdf0e10cSrcweir                             ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape,
218cdf0e10cSrcweir                             const Rectangle* pChildAnchor,
219cdf0e10cSrcweir                             const String& rClassName,
220cdf0e10cSrcweir                             sal_uInt32 nStrmStart, sal_uInt32 nStrmSize );
221cdf0e10cSrcweir 
222cdf0e10cSrcweir private:
223cdf0e10cSrcweir     virtual void        WriteSubRecs( XclExpStream& rStrm );
224cdf0e10cSrcweir 
225cdf0e10cSrcweir private:
226cdf0e10cSrcweir     String              maClassName;        /// Class name of the control.
227cdf0e10cSrcweir     sal_uInt32          mnStrmStart;        /// Start position in 'Ctls' stream.
228cdf0e10cSrcweir     sal_uInt32          mnStrmSize;         /// Size in 'Ctls' stream.
229cdf0e10cSrcweir };
230cdf0e10cSrcweir 
231*0de526bdSJianyuan Li //#else
232cdf0e10cSrcweir 
233cdf0e10cSrcweir /** Represents an OBJ record for an TBX form control. */
234cdf0e10cSrcweir class XclExpTbxControlObj : public XclObj, public XclExpControlHelper
235cdf0e10cSrcweir {
236cdf0e10cSrcweir public:
237cdf0e10cSrcweir     explicit            XclExpTbxControlObj(
238cdf0e10cSrcweir                             XclExpObjectManager& rObjMgr,
239cdf0e10cSrcweir                             ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape,
240cdf0e10cSrcweir                             const Rectangle* pChildAnchor );
241cdf0e10cSrcweir 
242cdf0e10cSrcweir     /** Sets the name of a macro attached to this control.
243cdf0e10cSrcweir         @return  true = The passed event descriptor was valid, macro name has been found. */
244cdf0e10cSrcweir     bool                SetMacroLink( const ::com::sun::star::script::ScriptEventDescriptor& rEvent );
245cdf0e10cSrcweir 
246cdf0e10cSrcweir private:
247cdf0e10cSrcweir     virtual void        WriteSubRecs( XclExpStream& rStrm );
248cdf0e10cSrcweir 
249cdf0e10cSrcweir     /** Writes an ftMacro subrecord containing a macro link, or nothing, if no macro present. */
250cdf0e10cSrcweir     void                WriteMacroSubRec( XclExpStream& rStrm );
251cdf0e10cSrcweir     /** Writes a subrecord containing a cell link, or nothing, if no link present. */
252cdf0e10cSrcweir     void                WriteCellLinkSubRec( XclExpStream& rStrm, sal_uInt16 nSubRecId );
253cdf0e10cSrcweir     /** Writes the ftSbs sub structure containing scrollbar data. */
254cdf0e10cSrcweir     void                WriteSbs( XclExpStream& rStrm );
255cdf0e10cSrcweir 
256cdf0e10cSrcweir private:
257cdf0e10cSrcweir     ScfInt16Vec         maMultiSel;     /// Indexes of all selected entries in a multi selection.
258cdf0e10cSrcweir     XclTokenArrayRef    mxMacroLink;    /// Token array containing a link to an attached macro.
259cdf0e10cSrcweir     XclTbxEventType     meEventType;    /// Type of supported macro event.
260cdf0e10cSrcweir     sal_Int32           mnHeight;       /// Height of the control.
261cdf0e10cSrcweir     sal_uInt16          mnState;        /// Checked/unchecked state.
262cdf0e10cSrcweir     sal_Int16           mnLineCount;    /// Combobox dropdown line count.
263cdf0e10cSrcweir     sal_Int16           mnSelEntry;     /// Selected entry in combobox (1-based).
264cdf0e10cSrcweir     sal_uInt16          mnScrollValue;  /// Scrollbar: Current value.
265cdf0e10cSrcweir     sal_uInt16          mnScrollMin;    /// Scrollbar: Minimum value.
266cdf0e10cSrcweir     sal_uInt16          mnScrollMax;    /// Scrollbar: Maximum value.
267cdf0e10cSrcweir     sal_uInt16          mnScrollStep;   /// Scrollbar: Single step.
268cdf0e10cSrcweir     sal_uInt16          mnScrollPage;   /// Scrollbar: Page step.
269cdf0e10cSrcweir     bool                mbFlatButton;   /// False = 3D button style; True = Flat button style.
270cdf0e10cSrcweir     bool                mbFlatBorder;   /// False = 3D border style; True = Flat border style.
271cdf0e10cSrcweir     bool                mbMultiSel;     /// true = Multi selection in listbox.
272cdf0e10cSrcweir     bool                mbScrollHor;    /// Scrollbar: true = horizontal.
273cdf0e10cSrcweir };
274cdf0e10cSrcweir 
275*0de526bdSJianyuan Li //#endif
276cdf0e10cSrcweir 
277cdf0e10cSrcweir // ----------------------------------------------------------------------------
278cdf0e10cSrcweir 
279cdf0e10cSrcweir class XclExpChart;
280cdf0e10cSrcweir 
281cdf0e10cSrcweir /** A chart object. This is the drawing object wrapper for the chart data. */
282cdf0e10cSrcweir class XclExpChartObj : public XclObj, protected XclExpRoot
283cdf0e10cSrcweir {
284cdf0e10cSrcweir public:
285cdf0e10cSrcweir     explicit            XclExpChartObj(
286cdf0e10cSrcweir                             XclExpObjectManager& rObjMgr,
287cdf0e10cSrcweir                             ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape,
288cdf0e10cSrcweir                             const Rectangle* pChildAnchor );
289cdf0e10cSrcweir     virtual             ~XclExpChartObj();
290cdf0e10cSrcweir 
291cdf0e10cSrcweir     /** Writes the OBJ record and the entire chart substream. */
292cdf0e10cSrcweir     virtual void        Save( XclExpStream& rStrm );
293cdf0e10cSrcweir 
294cdf0e10cSrcweir private:
295cdf0e10cSrcweir     typedef ScfRef< XclExpChart > XclExpChartRef;
296cdf0e10cSrcweir     XclExpChartRef      mxChart;        /// The chart itself (BOF/EOF substream data).
297cdf0e10cSrcweir };
298cdf0e10cSrcweir 
299cdf0e10cSrcweir // ============================================================================
300cdf0e10cSrcweir 
301cdf0e10cSrcweir /** Represents a NOTE record containing the relevant data of a cell note.
302cdf0e10cSrcweir 
303cdf0e10cSrcweir     NOTE records differ significantly in various BIFF versions. This class
304cdf0e10cSrcweir     encapsulates all needed actions for each supported BIFF version.
305cdf0e10cSrcweir     BIFF5/BIFF7: Stores the note text and generates a single or multiple NOTE
306cdf0e10cSrcweir     records on saving.
307cdf0e10cSrcweir     BIFF8: Creates the Escher object containing the drawing information and the
308cdf0e10cSrcweir     note text.
309cdf0e10cSrcweir  */
310cdf0e10cSrcweir class XclExpNote : public XclExpRecord
311cdf0e10cSrcweir {
312cdf0e10cSrcweir public:
313cdf0e10cSrcweir     /** Constructs a NOTE record from the passed note object and/or the text.
314cdf0e10cSrcweir         @descr  The additional text will be separated from the note text with
315cdf0e10cSrcweir             an empty line.
316cdf0e10cSrcweir         @param rScPos  The Calc cell address of the note.
317cdf0e10cSrcweir         @param pScNote  The Calc note object. May be 0 to create a note from rAddText only.
318cdf0e10cSrcweir         @param rAddText  Additional text appended to the note text. */
319cdf0e10cSrcweir     explicit            XclExpNote(
320cdf0e10cSrcweir                             const XclExpRoot& rRoot,
321cdf0e10cSrcweir                             const ScAddress& rScPos,
322cdf0e10cSrcweir                             const ScPostIt* pScNote,
323cdf0e10cSrcweir                             const String& rAddText );
324cdf0e10cSrcweir 
325cdf0e10cSrcweir     /** Writes the NOTE record, if the respective Escher object is present. */
326cdf0e10cSrcweir     virtual void        Save( XclExpStream& rStrm );
327cdf0e10cSrcweir 
328cdf0e10cSrcweir     void                WriteXml( sal_Int32 nAuthorId, XclExpXmlStream& rStrm );
329cdf0e10cSrcweir 
GetAuthor() const330cdf0e10cSrcweir     const XclExpString& GetAuthor() const { return maAuthor; }
331cdf0e10cSrcweir private:
332cdf0e10cSrcweir     /** Writes the body of the NOTE record. */
333cdf0e10cSrcweir     virtual void        WriteBody( XclExpStream& rStrm );
334cdf0e10cSrcweir 
335cdf0e10cSrcweir private:
336cdf0e10cSrcweir     XclExpString        maAuthor;       /// Name of the author.
337cdf0e10cSrcweir     String              maOrigNoteText; /// Original main text of the note.
338cdf0e10cSrcweir     ByteString          maNoteText;     /// Main text of the note (<=BIFF7).
339cdf0e10cSrcweir     ScAddress           maScPos;        /// Calc cell address of the note.
340cdf0e10cSrcweir     sal_uInt16          mnObjId;        /// Escher object ID (BIFF8).
341cdf0e10cSrcweir     bool                mbVisible;      /// true = permanently visible.
342cdf0e10cSrcweir };
343cdf0e10cSrcweir 
344cdf0e10cSrcweir // ============================================================================
345cdf0e10cSrcweir 
346cdf0e10cSrcweir class XclExpComments : public XclExpRecord
347cdf0e10cSrcweir {
348cdf0e10cSrcweir public:
349cdf0e10cSrcweir     typedef XclExpRecordList< XclExpNote >
350cdf0e10cSrcweir                         XclExpNoteList;
351cdf0e10cSrcweir 
352cdf0e10cSrcweir                         XclExpComments( SCTAB nTab, XclExpNoteList& rNotes );
353cdf0e10cSrcweir 
354cdf0e10cSrcweir     virtual void        SaveXml( XclExpXmlStream& rStrm );
355cdf0e10cSrcweir 
356cdf0e10cSrcweir private:
357cdf0e10cSrcweir     SCTAB               mnTab;
358cdf0e10cSrcweir     XclExpNoteList&     mrNotes;
359cdf0e10cSrcweir };
360cdf0e10cSrcweir 
361cdf0e10cSrcweir // object manager =============================================================
362cdf0e10cSrcweir 
363cdf0e10cSrcweir class XclExpObjectManager : public XclExpRoot
364cdf0e10cSrcweir {
365cdf0e10cSrcweir public:
366cdf0e10cSrcweir     explicit            XclExpObjectManager( const XclExpRoot& rRoot );
367cdf0e10cSrcweir     virtual             ~XclExpObjectManager();
368cdf0e10cSrcweir 
369cdf0e10cSrcweir     /** Creates a new DFF client anchor object. Caller takes ownership! May be
370cdf0e10cSrcweir         overwritten in derived  classes. */
371cdf0e10cSrcweir     virtual XclExpDffAnchorBase* CreateDffAnchor() const;
372cdf0e10cSrcweir 
373cdf0e10cSrcweir     /** Creates and returns the MSODRAWINGGROUP record containing global DFF
374cdf0e10cSrcweir         data in the DGGCONTAINER. */
375cdf0e10cSrcweir     ScfRef< XclExpRecordBase > CreateDrawingGroup();
376cdf0e10cSrcweir 
377cdf0e10cSrcweir     /** Initializes the object manager for a new sheet. */
378cdf0e10cSrcweir     void                StartSheet();
379cdf0e10cSrcweir 
380cdf0e10cSrcweir     /** Processes a drawing page and returns the record block containing all
381cdf0e10cSrcweir         related records (MSODRAWING, OBJ, TXO, charts, etc.). */
382cdf0e10cSrcweir     ScfRef< XclExpRecordBase > ProcessDrawing( SdrPage* pSdrPage );
383cdf0e10cSrcweir     /** Processes a collection of UNO shapes and returns the record block
384cdf0e10cSrcweir         containing all related records (MSODRAWING, OBJ, TXO, charts, etc.). */
385cdf0e10cSrcweir     ScfRef< XclExpRecordBase > ProcessDrawing( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes );
386cdf0e10cSrcweir 
387cdf0e10cSrcweir     /** Finalizes the object manager after conversion of all sheets. */
388cdf0e10cSrcweir     void                EndDocument();
389cdf0e10cSrcweir 
GetEscherEx()390cdf0e10cSrcweir     inline XclEscherEx& GetEscherEx() { return *mxEscherEx; }
391cdf0e10cSrcweir     XclExpMsoDrawing*   GetMsodrawingPerSheet();
392cdf0e10cSrcweir     bool                HasObj() const;
393cdf0e10cSrcweir     sal_uInt16          AddObj( XclObj* pObjRec );
394cdf0e10cSrcweir     XclObj*             RemoveLastObj();
395cdf0e10cSrcweir 
396cdf0e10cSrcweir protected:
397cdf0e10cSrcweir     explicit            XclExpObjectManager( const XclExpObjectManager& rParent );
398cdf0e10cSrcweir 
399cdf0e10cSrcweir private:
400cdf0e10cSrcweir     void                InitStream( bool bTempFile );
401cdf0e10cSrcweir 
402cdf0e10cSrcweir private:
403cdf0e10cSrcweir     ScfRef< ::utl::TempFile > mxTempFile;
404cdf0e10cSrcweir     ScfRef< SvStream >  mxDffStrm;
405cdf0e10cSrcweir     ScfRef< XclEscherEx > mxEscherEx;
406cdf0e10cSrcweir     ScfRef< XclExpObjList > mxObjList;
407cdf0e10cSrcweir };
408cdf0e10cSrcweir 
409cdf0e10cSrcweir // ----------------------------------------------------------------------------
410cdf0e10cSrcweir 
411cdf0e10cSrcweir class XclExpEmbeddedObjectManager : public XclExpObjectManager
412cdf0e10cSrcweir {
413cdf0e10cSrcweir public:
414cdf0e10cSrcweir     explicit            XclExpEmbeddedObjectManager(
415cdf0e10cSrcweir                             const XclExpObjectManager& rParent,
416cdf0e10cSrcweir                             const Size& rPageSize,
417cdf0e10cSrcweir                             sal_Int32 nScaleX, sal_Int32 nScaleY );
418cdf0e10cSrcweir 
419cdf0e10cSrcweir     /** Creates a new DFF client anchor object for embedded objects according
420cdf0e10cSrcweir         to the scaling data passed to the constructor. Caller takes ownership! */
421cdf0e10cSrcweir     virtual XclExpDffAnchorBase* CreateDffAnchor() const;
422cdf0e10cSrcweir 
423cdf0e10cSrcweir private:
424cdf0e10cSrcweir     Size                maPageSize;
425cdf0e10cSrcweir     sal_Int32           mnScaleX;
426cdf0e10cSrcweir     sal_Int32           mnScaleY;
427cdf0e10cSrcweir };
428cdf0e10cSrcweir 
429cdf0e10cSrcweir // ============================================================================
430cdf0e10cSrcweir 
431cdf0e10cSrcweir #endif
432cdf0e10cSrcweir 
433