LCOV - code coverage report
Current view: top level - sc/source/ui/inc - TableFillingAndNavigationTools.hxx (source / functions) Hit Total Coverage
Test: commit e02a6cb2c3e2b23b203b422e4e0680877f232636 Lines: 0 5 0.0 %
Date: 2014-04-14 Functions: 0 7 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             :  */
      10             : 
      11             : #ifndef TABLEFILLINGANDNAVIGATIONTOOLS_HXX
      12             : #define TABLEFILLINGANDNAVIGATIONTOOLS_HXX
      13             : 
      14             : #include "address.hxx"
      15             : #include "rangelst.hxx"
      16             : 
      17             : #include "docsh.hxx"
      18             : #include "document.hxx"
      19             : #include "docfunc.hxx"
      20             : #include "formulacell.hxx"
      21             : 
      22             : #include <list>
      23             : 
      24           0 : class FormulaTemplate
      25             : {
      26             : private:
      27             :     OUString            mTemplate;
      28             :     ScDocument*         mDocument;
      29             :     ScAddress::Details  mAddressDetails;
      30             : 
      31             :     typedef std::map<OUString, ScRange>   RangeReplacementMap;
      32             :     typedef std::map<OUString, ScAddress> AddressReplacementMap;
      33             : 
      34             :     AddressReplacementMap mAddressReplacementMap;
      35             :     RangeReplacementMap   mRangeReplacementMap;
      36             : 
      37             : public:
      38             :     FormulaTemplate(ScDocument* aDocument, ScAddress::Details aAddressDetails);
      39             : 
      40             :     void      setTemplate(const OUString& aTemplate);
      41             :     void      setTemplate(const char* aTemplate);
      42             :     OUString& getTemplate();
      43             : 
      44             :     void      autoReplaceRange(const OUString& aVariable, ScRange aRange);
      45             :     void      autoReplaceAddress(const OUString& aVariable, ScAddress aAddress);
      46             : 
      47             :     void      applyRange(const OUString& aVariable, ScRange aRange);
      48             :     void      applyRangeList(const OUString& aVariable, ScRangeList aRangeList);
      49             :     void      applyAddress(const OUString& aVariable, ScAddress aAddress);
      50             :     void      applyString(const OUString& aVariable, const OUString& aValue);
      51             :     void      applyNumber(const OUString& aVariable, sal_Int32 aValue);
      52             : };
      53             : 
      54           0 : class AddressWalker
      55             : {
      56             : public:
      57             :     std::list<ScAddress> mAddressStack;
      58             : 
      59             :     ScAddress mCurrentAddress;
      60             :     ScAddress mMinimumAddress;
      61             :     ScAddress mMaximumAddress;
      62             :     bool      mTrackRange;
      63             : 
      64             :     AddressWalker(ScAddress aInitialAddress, bool aTrackRange = true);
      65             : 
      66             :     ScAddress current(SCCOL aRelativeCol = 0, SCROW aRelativeRow = 0, SCTAB aRelativeTab = 0);
      67             :     void      reset();
      68             :     void      resetColumn();
      69             :     void      resetRow();
      70             :     void      nextColumn();
      71             :     void      nextRow();
      72             :     void      push(SCCOL aRelativeCol = 0, SCROW aRelativeRow = 0, SCTAB aRelativeTab = 0);
      73             : };
      74             : 
      75           0 : class AddressWalkerWriter : public AddressWalker
      76             : {
      77             : public:
      78             :     ScDocShell*                         mpDocShell;
      79             :     ScDocument*                         mpDocument;
      80             :     formula::FormulaGrammar::Grammar    meGrammar;
      81             : 
      82             :     AddressWalkerWriter(ScAddress aInitialAddress, ScDocShell* pDocShell, ScDocument* pDocument,
      83             :             formula::FormulaGrammar::Grammar eGrammar );
      84             : 
      85             :     void writeFormula(const OUString& aFormula);
      86             :     void writeMatrixFormula(const OUString& aFormula);
      87             :     void writeString(const OUString& aString);
      88             :     void writeString(const char* aCharArray);
      89             :     void writeBoldString(const OUString& aString);
      90             :     void writeValue(double aValue);
      91             : };
      92             : 
      93             : class DataCellIterator
      94             : {
      95             : private:
      96             :     ScRange mInputRange;
      97             :     bool    mByColumn;
      98             :     SCCOL   mCol;
      99             :     SCROW   mRow;
     100             : 
     101             : public:
     102             :     DataCellIterator(ScRange aInputRange, bool aByColumn);
     103             :     virtual ~DataCellIterator();
     104             : 
     105             :     virtual bool hasNext();
     106             :     virtual ScAddress get();
     107             :     virtual void next();
     108             :     virtual ScAddress getRelative(int aDelta);
     109             : };
     110             : 
     111             : class DataRangeIterator
     112             : {
     113             : protected:
     114             :     ScRange   mInputRange;
     115             :     sal_Int32 mIndex;
     116             : 
     117             : public:
     118             :     DataRangeIterator(ScRange aInputRange);
     119             :     virtual ~DataRangeIterator();
     120             : 
     121             :     virtual bool hasNext() = 0;
     122             :     virtual ScRange get() = 0;
     123             :     virtual void next() = 0;
     124             :     virtual void reset() = 0;
     125             :     virtual sal_Int32 index();
     126             : 
     127             :     virtual DataCellIterator iterateCells() = 0;
     128             : };
     129             : 
     130           0 : class DataRangeByColumnIterator : public DataRangeIterator
     131             : {
     132             : protected:
     133             :     SCCOL mCol;
     134             : 
     135             : public:
     136             :     DataRangeByColumnIterator(ScRange aInputRange);
     137             : 
     138             :     virtual bool hasNext() SAL_OVERRIDE;
     139             :     virtual void next() SAL_OVERRIDE;
     140             :     virtual ScRange get() SAL_OVERRIDE;
     141             :     virtual void reset() SAL_OVERRIDE;
     142             :     virtual DataCellIterator iterateCells() SAL_OVERRIDE;
     143             : };
     144             : 
     145           0 : class DataRangeByRowIterator : public DataRangeIterator
     146             : {
     147             : protected:
     148             :     SCROW mRow;
     149             : 
     150             : public:
     151             :     DataRangeByRowIterator(ScRange aInputRange);
     152             : 
     153             :     virtual bool hasNext() SAL_OVERRIDE;
     154             :     virtual void next() SAL_OVERRIDE;
     155             :     virtual ScRange get() SAL_OVERRIDE;
     156             :     virtual void reset() SAL_OVERRIDE;
     157             :     virtual DataCellIterator iterateCells() SAL_OVERRIDE;
     158             : };
     159             : 
     160             : #endif
     161             : 
     162             : 
     163             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10