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

Generated by: LCOV version 1.11