LCOV - code coverage report
Current view: top level - sc/source/filter/inc - excelhandlers.hxx (source / functions) Hit Total Coverage
Test: commit e02a6cb2c3e2b23b203b422e4e0680877f232636 Lines: 0 12 0.0 %
Date: 2014-04-14 Functions: 0 25 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : 
      20             : #ifndef OOX_XLS_EXCELHANDLERS_HXX
      21             : #define OOX_XLS_EXCELHANDLERS_HXX
      22             : 
      23             : #include "oox/core/fragmenthandler2.hxx"
      24             : #include "worksheethelper.hxx"
      25             : 
      26             : namespace oox {
      27             : namespace xls {
      28             : 
      29             : 
      30             : /** Context handler derived from the WorkbookHelper helper class.
      31             : 
      32             :     Used to import contexts in global workbook fragments.
      33             :  */
      34           0 : class WorkbookContextBase : public ::oox::core::ContextHandler2, public WorkbookHelper
      35             : {
      36             : public:
      37             :     template< typename ParentType >
      38           0 :     inline explicit     WorkbookContextBase( ParentType& rParent ) :
      39           0 :                             ::oox::core::ContextHandler2( rParent ), WorkbookHelper( rParent ) {}
      40             : };
      41             : 
      42             : /** Context handler derived from the WorksheetHelper helper class.
      43             : 
      44             :     Used to import contexts in sheet fragments.
      45             :  */
      46           0 : class WorksheetContextBase : public ::oox::core::ContextHandler2, public WorksheetHelper
      47             : {
      48             : public:
      49             :     template< typename ParentType >
      50           0 :     inline explicit     WorksheetContextBase( ParentType& rParent ) :
      51           0 :                             ::oox::core::ContextHandler2( rParent ), WorksheetHelper( rParent ) {}
      52             : };
      53             : 
      54             : /** Fragment handler derived from the WorkbookHelper helper class.
      55             : 
      56             :     Used to import global workbook fragments.
      57             :  */
      58           0 : class WorkbookFragmentBase : public ::oox::core::FragmentHandler2, public WorkbookHelper
      59             : {
      60             : public:
      61             :     explicit            WorkbookFragmentBase(
      62             :                             const WorkbookHelper& rHelper,
      63             :                             const OUString& rFragmentPath );
      64             : };
      65             : 
      66             : /** Fragment handler derived from the WorksheetHelper helper class.
      67             : 
      68             :     Used to import sheet fragments.
      69             :  */
      70           0 : class WorksheetFragmentBase : public ::oox::core::FragmentHandler2, public WorksheetHelper
      71             : {
      72             : public:
      73             :     explicit            WorksheetFragmentBase(
      74             :                             const WorksheetHelper& rHelper,
      75             :                             const OUString& rFragmentPath );
      76             : };
      77             : 
      78             : 
      79             : /** Base class for all BIFF context handlers.
      80             : 
      81             :     Derived handlers have to implement the importRecord() function that has to
      82             :     import the record the passed BIFF input stream currently points to.
      83             :  */
      84           0 : class BiffContextHandler
      85             : {
      86             : public:
      87             :     virtual             ~BiffContextHandler();
      88             : 
      89             :     /** Derived classes have to implement importing the current record. */
      90             :     virtual void        importRecord( BiffInputStream& rStrm ) = 0;
      91             : };
      92             : 
      93             : /** Context handler derived from the WorksheetHelper helper class.
      94             : 
      95             :     Used to import contexts in sheet fragments.
      96             :  */
      97           0 : class BiffWorksheetContextBase : public BiffContextHandler, public WorksheetHelper
      98             : {
      99             : protected:
     100             :     explicit            BiffWorksheetContextBase( const WorksheetHelper& rHelper );
     101             : };
     102             : 
     103             : /** An enumeration for all types of fragments in a BIFF workbook stream. */
     104             : enum BiffFragmentType
     105             : {
     106             :     BIFF_FRAGMENT_GLOBALS,      /// Workbook globals fragment.
     107             :     BIFF_FRAGMENT_WORKSHEET,    /// Worksheet fragment.
     108             :     BIFF_FRAGMENT_CHARTSHEET,   /// Chart sheet fragment.
     109             :     BIFF_FRAGMENT_MACROSHEET,   /// Macro sheet fragment.
     110             :     BIFF_FRAGMENT_MODULESHEET,  /// BIFF5 VB module fragment.
     111             :     BIFF_FRAGMENT_EMPTYSHEET,   /// Sheet fragment of unsupported type.
     112             :     BIFF_FRAGMENT_WORKSPACE,    /// BIFF4 workspace/workbook globals.
     113             :     BIFF_FRAGMENT_UNKNOWN       /// Unknown fragment/error.
     114             : };
     115             : 
     116             : class BiffFragmentHandler
     117             : {
     118             : public:
     119             :     /** Opens the stream with the passed full name. */
     120             :     explicit            BiffFragmentHandler(
     121             :                             const ::oox::core::FilterBase& rFilter,
     122             :                             const OUString& rStrmName );
     123             : 
     124             :     virtual             ~BiffFragmentHandler();
     125             : 
     126             :     /** Imports the fragment, returns true, if EOF record has been reached. */
     127             :     virtual bool        importFragment() = 0;
     128             : 
     129             : protected:
     130             :     /** Returns the BIFF input stream of this fragment. */
     131           0 :     inline BiffInputStream& getInputStream() { return *mxBiffStrm; }
     132             : 
     133             :     /** Skips the current fragment up to its trailing EOF record.
     134             : 
     135             :         Skips all records until next EOF record. When this function returns,
     136             :         stream points to the EOF record, and the next call of startNextRecord()
     137             :         at the stream will start the record following the EOF record.
     138             : 
     139             :         Embedded fragments enclosed in BOF/EOF records (e.g. embedded chart
     140             :         objects) are skipped correctly.
     141             : 
     142             :         @return  True = stream points to the EOF record of the current fragment.
     143             :      */
     144             :     bool                skipFragment();
     145             : 
     146             : private:
     147             :     typedef ::boost::shared_ptr< BinaryXInputStream >   XInputStreamRef;
     148             :     typedef ::boost::shared_ptr< BiffInputStream >      BiffInputStreamRef;
     149             : 
     150             :     XInputStreamRef     mxXInStrm;
     151             :     BiffInputStreamRef  mxBiffStrm;
     152             : };
     153             : 
     154             : /** Fragment handler derived from the WorkbookHelper helper class.
     155             : 
     156             :     Used to import global workbook fragments.
     157             :  */
     158           0 : class BiffWorkbookFragmentBase : public BiffFragmentHandler, public WorkbookHelper
     159             : {
     160             : protected:
     161             :     explicit            BiffWorkbookFragmentBase(
     162             :                             const WorkbookHelper& rHelper,
     163             :                             const OUString& rStrmName,
     164             :                             bool bCloneDecoder = false );
     165             : };
     166             : 
     167             : } // namespace xls
     168             : } // namespace oox
     169             : 
     170             : #endif
     171             : 
     172             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10