LCOV - code coverage report
Current view: top level - sc/source/filter/inc - xiroot.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 4 4 100.0 %
Date: 2012-08-25 Functions: 5 6 83.3 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 1 4 25.0 %

           Branch data     Line data    Source code
       1                 :            : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2                 :            : /*************************************************************************
       3                 :            :  *
       4                 :            :  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       5                 :            :  *
       6                 :            :  * Copyright 2000, 2010 Oracle and/or its affiliates.
       7                 :            :  *
       8                 :            :  * OpenOffice.org - a multi-platform office productivity suite
       9                 :            :  *
      10                 :            :  * This file is part of OpenOffice.org.
      11                 :            :  *
      12                 :            :  * OpenOffice.org is free software: you can redistribute it and/or modify
      13                 :            :  * it under the terms of the GNU Lesser General Public License version 3
      14                 :            :  * only, as published by the Free Software Foundation.
      15                 :            :  *
      16                 :            :  * OpenOffice.org is distributed in the hope that it will be useful,
      17                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      18                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      19                 :            :  * GNU Lesser General Public License version 3 for more details
      20                 :            :  * (a copy is included in the LICENSE file that accompanied this code).
      21                 :            :  *
      22                 :            :  * You should have received a copy of the GNU Lesser General Public License
      23                 :            :  * version 3 along with OpenOffice.org.  If not, see
      24                 :            :  * <http://www.openoffice.org/license.html>
      25                 :            :  * for a copy of the LGPLv3 License.
      26                 :            :  *
      27                 :            :  ************************************************************************/
      28                 :            : 
      29                 :            : #ifndef SC_XIROOT_HXX
      30                 :            : #define SC_XIROOT_HXX
      31                 :            : 
      32                 :            : #include "xlroot.hxx"
      33                 :            : #include <boost/shared_ptr.hpp>
      34                 :            : 
      35                 :            : // Forward declarations of objects in public use ==============================
      36                 :            : 
      37                 :            : class XclImpStream;
      38                 :            : class XclImpString;
      39                 :            : 
      40                 :            : typedef boost::shared_ptr< XclImpString > XclImpStringRef;
      41                 :            : 
      42                 :            : // Global data ================================================================
      43                 :            : 
      44                 :            : class XclImpAddressConverter;
      45                 :            : class XclImpFormulaCompiler;
      46                 :            : class XclImpSst;
      47                 :            : class XclImpPalette;
      48                 :            : class XclImpFontBuffer;
      49                 :            : class XclImpNumFmtBuffer;
      50                 :            : class XclImpXFBuffer;
      51                 :            : class XclImpXFRangeBuffer;
      52                 :            : class XclImpTabInfo;
      53                 :            : class XclImpNameManager;
      54                 :            : class XclImpLinkManager;
      55                 :            : class XclImpObjectManager;
      56                 :            : class XclImpSheetDrawing;
      57                 :            : class XclImpCondFormatManager;
      58                 :            : class XclImpValidationManager;
      59                 :            : class XclImpAutoFilterBuffer;
      60                 :            : class XclImpWebQueryBuffer;
      61                 :            : class XclImpPivotTableManager;
      62                 :            : class XclImpPageSettings;
      63                 :            : class XclImpDocViewSettings;
      64                 :            : class XclImpTabViewSettings;
      65                 :            : class XclImpSheetProtectBuffer;
      66                 :            : class XclImpDocProtectBuffer;
      67                 :            : 
      68                 :            : class _ScRangeListTabs;
      69                 :            : class ExcelToSc;
      70                 :            : 
      71                 :            : /** Stores global buffers and data needed for Excel import filter. */
      72                 :            : struct XclImpRootData : public XclRootData
      73                 :            : {
      74                 :            :     typedef boost::shared_ptr< XclImpAddressConverter >    XclImpAddrConvRef;
      75                 :            :     typedef boost::shared_ptr< XclImpFormulaCompiler >     XclImpFmlaCompRef;
      76                 :            : 
      77                 :            :     typedef boost::shared_ptr< XclImpSst >                 XclImpSstRef;
      78                 :            :     typedef boost::shared_ptr< XclImpPalette >             XclImpPaletteRef;
      79                 :            :     typedef boost::shared_ptr< XclImpFontBuffer >          XclImpFontBfrRef;
      80                 :            :     typedef boost::shared_ptr< XclImpNumFmtBuffer >        XclImpNumFmtBfrRef;
      81                 :            :     typedef boost::shared_ptr< XclImpXFBuffer >            XclImpXFBfrRef;
      82                 :            :     typedef boost::shared_ptr< XclImpXFRangeBuffer >       XclImpXFRangeBfrRef;
      83                 :            :     typedef boost::shared_ptr< XclImpTabInfo >             XclImpTabInfoRef;
      84                 :            :     typedef boost::shared_ptr< XclImpNameManager >         XclImpNameMgrRef;
      85                 :            :     typedef boost::shared_ptr< XclImpLinkManager >         XclImpLinkMgrRef;
      86                 :            :     typedef boost::shared_ptr< XclImpObjectManager >       XclImpObjectMgrRef;
      87                 :            :     typedef boost::shared_ptr< XclImpCondFormatManager >   XclImpCondFmtMgrRef;
      88                 :            :     typedef boost::shared_ptr< XclImpValidationManager >   XclImpValidationMgrRef;
      89                 :            :     typedef boost::shared_ptr< XclImpWebQueryBuffer >      XclImpWebQueryBfrRef;
      90                 :            :     typedef boost::shared_ptr< XclImpPivotTableManager >   XclImpPTableMgrRef;
      91                 :            :     typedef boost::shared_ptr< XclImpPageSettings >        XclImpPageSettRef;
      92                 :            :     typedef boost::shared_ptr< XclImpDocViewSettings >     XclImpDocViewSettRef;
      93                 :            :     typedef boost::shared_ptr< XclImpTabViewSettings >     XclImpTabViewSettRef;
      94                 :            :     typedef boost::shared_ptr< XclImpSheetProtectBuffer >  XclImpTabProtectRef;
      95                 :            :     typedef boost::shared_ptr< XclImpDocProtectBuffer >    XclImpDocProtectRef;
      96                 :            : 
      97                 :            :     XclImpAddrConvRef   mxAddrConv;         /// The address converter.
      98                 :            :     XclImpFmlaCompRef   mxFmlaComp;         /// The formula compiler.
      99                 :            : 
     100                 :            :     XclImpSstRef        mxSst;              /// The shared string table.
     101                 :            :     XclImpPaletteRef    mxPalette;          /// The color buffer.
     102                 :            :     XclImpFontBfrRef    mxFontBfr;          /// All fonts in the file.
     103                 :            :     XclImpNumFmtBfrRef  mxNumFmtBfr;        /// All number formats in the file.
     104                 :            :     XclImpXFBfrRef      mpXFBfr;            /// All XF record data in the file.
     105                 :            :     XclImpXFRangeBfrRef mxXFRangeBfr;       /// Buffer of XF index ranges in a sheet.
     106                 :            : 
     107                 :            :     XclImpTabInfoRef    mxTabInfo;          /// Sheet creation order list.
     108                 :            :     XclImpNameMgrRef    mxNameMgr;          /// Internal defined names.
     109                 :            :     XclImpLinkMgrRef    mxLinkMgr;          /// Manager for internal/external links.
     110                 :            : 
     111                 :            :     XclImpObjectMgrRef  mxObjMgr;           /// All drawing objects.
     112                 :            :     XclImpCondFmtMgrRef mxCondFmtMgr;       /// Conditional formatting.
     113                 :            :     XclImpValidationMgrRef mxValidMgr;      /// Data validation
     114                 :            :     XclImpWebQueryBfrRef mxWebQueryBfr;     /// All web queries.
     115                 :            :     XclImpPTableMgrRef  mxPTableMgr;        /// All pivot tables and pivot caches.
     116                 :            : 
     117                 :            :     XclImpPageSettRef   mxPageSett;         /// Page settings for current sheet.
     118                 :            :     XclImpDocViewSettRef mxDocViewSett;     /// View settings for entire document.
     119                 :            :     XclImpTabViewSettRef mxTabViewSett;     /// View settings for current sheet.
     120                 :            :     XclImpTabProtectRef mxTabProtect;       /// Sheet protection options for current sheet.
     121                 :            :     XclImpDocProtectRef mxDocProtect;       /// Document protection options.
     122                 :            : 
     123                 :            :     bool                mbHasCodePage;      /// true = CODEPAGE record exists.
     124                 :            :     bool                mbHasBasic;         /// true = document contains VB project.
     125                 :            : 
     126                 :            :     explicit            XclImpRootData( XclBiff eBiff, SfxMedium& rMedium,
     127                 :            :                             SotStorageRef xRootStrg, ScDocument& rDoc, rtl_TextEncoding eTextEnc );
     128                 :            :     virtual             ~XclImpRootData();
     129                 :            : };
     130                 :            : 
     131                 :            : // ----------------------------------------------------------------------------
     132                 :            : 
     133                 :            : /** Access to global data from other classes. */
     134 [ -  + ][ #  # ]:      12277 : class XclImpRoot : public XclRoot
     135                 :            : {
     136                 :            : public:
     137                 :            :     explicit            XclImpRoot( XclImpRootData& rImpRootData );
     138                 :            : 
     139                 :            :     /** Returns this root instance - for code readability in derived classes. */
     140                 :       6320 :     inline const XclImpRoot& GetRoot() const { return *this; }
     141                 :            : 
     142                 :            :     /** Sets a code page read from a CODEPAGE record for byte string import. */
     143                 :            :     void                SetCodePage( sal_uInt16 nCodePage );
     144                 :            :     /** Sets text encoding from the default application font (in case of missing CODEPAGE record). */
     145                 :            :     void                SetAppFontEncoding( rtl_TextEncoding eAppFontEnc );
     146                 :            : 
     147                 :            :     /** Is called when import filter starts importing a single sheet (all BIFF versions). */
     148                 :            :     void                InitializeTable( SCTAB nScTab );
     149                 :            :     /** Is called when import filter stops importing a single sheet (all BIFF versions). */
     150                 :            :     void                FinalizeTable();
     151                 :            : 
     152                 :            :     /** Returns the address converter. */
     153                 :            :     XclImpAddressConverter& GetAddressConverter() const;
     154                 :            :     /** Returns the formula converter. */
     155                 :            :     XclImpFormulaCompiler& GetFormulaCompiler() const;
     156                 :            :     /** Returns the old formula converter. */
     157                 :            :     ExcelToSc&          GetOldFmlaConverter() const;
     158                 :            : 
     159                 :            :     /** Returns the shared string table. */
     160                 :            :     XclImpSst&          GetSst() const;
     161                 :            :     /** Returns the color buffer. */
     162                 :            :     XclImpPalette&      GetPalette() const;
     163                 :            :     /** Returns the font buffer. */
     164                 :            :     XclImpFontBuffer&   GetFontBuffer() const;
     165                 :            :     /** Returns the number format buffer. */
     166                 :            :     XclImpNumFmtBuffer& GetNumFmtBuffer() const;
     167                 :            :     /** Returns the cell formatting attributes buffer. */
     168                 :            :     XclImpXFBuffer&     GetXFBuffer() const;
     169                 :            :     /** Returns the buffer of XF index ranges for a sheet. */
     170                 :            :     XclImpXFRangeBuffer& GetXFRangeBuffer() const;
     171                 :            : 
     172                 :            :     /** Returns the buffer that contains all print areas in the document. */
     173                 :            :     _ScRangeListTabs&   GetPrintAreaBuffer() const;
     174                 :            :     /** Returns the buffer that contains all print titles in the document. */
     175                 :            :     _ScRangeListTabs&   GetTitleAreaBuffer() const;
     176                 :            : 
     177                 :            :     /** Returns the buffer that contains the sheet creation order. */
     178                 :            :     XclImpTabInfo&      GetTabInfo() const;
     179                 :            :     /** Returns the buffer that contains internal defined names. */
     180                 :            :     XclImpNameManager&  GetNameManager() const;
     181                 :            :     /** Returns the link manager. */
     182                 :            :     XclImpLinkManager&  GetLinkManager() const;
     183                 :            : 
     184                 :            :     /** Returns the drawing object manager. */
     185                 :            :     XclImpObjectManager& GetObjectManager() const;
     186                 :            :     /** Returns the drawing container of the current sheet. */
     187                 :            :     XclImpSheetDrawing& GetCurrSheetDrawing() const;
     188                 :            :     /** Returns the conditional formatting manager. */
     189                 :            :     XclImpCondFormatManager& GetCondFormatManager() const;
     190                 :            : 
     191                 :            :     XclImpValidationManager& GetValidationManager() const;
     192                 :            :     /** Returns the filter manager. */
     193                 :            :     XclImpAutoFilterBuffer& GetFilterManager() const;
     194                 :            :     /** Returns the web query buffer. */
     195                 :            :     XclImpWebQueryBuffer& GetWebQueryBuffer() const;
     196                 :            :     /** Returns the pivot table manager. */
     197                 :            :     XclImpPivotTableManager& GetPivotTableManager() const;
     198                 :            :     /** Returns the sheet protection options of the current sheet. */
     199                 :            :     XclImpSheetProtectBuffer& GetSheetProtectBuffer() const;
     200                 :            :     /** Returns the document protection options. */
     201                 :            :     XclImpDocProtectBuffer& GetDocProtectBuffer() const;
     202                 :            : 
     203                 :            :     /** Returns the page settings of the current sheet. */
     204                 :            :     XclImpPageSettings& GetPageSettings() const;
     205                 :            :     /** Returns the view settings of the entire document. */
     206                 :            :     XclImpDocViewSettings& GetDocViewSettings() const;
     207                 :            :     /** Returns the view settings of the current sheet. */
     208                 :            :     XclImpTabViewSettings& GetTabViewSettings() const;
     209                 :            : 
     210                 :            :     /** Returns the Calc add-in function name for an Excel function name. */
     211                 :            :     String              GetScAddInName( const String& rXclName ) const;
     212                 :            : 
     213                 :            :     /** Returns true, if the document contains a VB project. */
     214                 :         55 :     inline bool         HasBasic() const { return mrImpData.mbHasBasic; }
     215                 :            :     /** Called to indicate that the document contains a VB project. */
     216                 :         13 :     inline void         SetHasBasic() { mrImpData.mbHasBasic = true; }
     217                 :            :     /** Reads the CODENAME record and inserts the codename into the document. */
     218                 :            :     void                ReadCodeName( XclImpStream& rStrm, bool bGlobals );
     219                 :            : 
     220                 :            : private:
     221                 :            :     XclImpRootData& mrImpData;      /// Reference to the global import data struct.
     222                 :            : };
     223                 :            : 
     224                 :            : // ============================================================================
     225                 :            : 
     226                 :            : #endif
     227                 :            : 
     228                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10