fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / sc / source / ui / inc / TableFillingAndNavigationTools.hxx
blob2009261d51a55263558d27126cd7aa7dcc77b8c8
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 */
11 #ifndef INCLUDED_SC_SOURCE_UI_INC_TABLEFILLINGANDNAVIGATIONTOOLS_HXX
12 #define INCLUDED_SC_SOURCE_UI_INC_TABLEFILLINGANDNAVIGATIONTOOLS_HXX
14 #include "address.hxx"
15 #include "rangelst.hxx"
17 #include "docsh.hxx"
18 #include "document.hxx"
19 #include "docfunc.hxx"
20 #include "formulacell.hxx"
22 #include <list>
24 class FormulaTemplate
26 private:
27 OUString mTemplate;
28 ScDocument* mpDoc;
30 typedef std::map<OUString, ScRange> RangeReplacementMap;
31 typedef std::map<OUString, ScAddress> AddressReplacementMap;
33 AddressReplacementMap mAddressReplacementMap;
34 RangeReplacementMap mRangeReplacementMap;
36 public:
37 FormulaTemplate(ScDocument* pDoc);
39 void setTemplate(const OUString& aTemplate);
40 void setTemplate(const char* aTemplate);
41 const OUString& getTemplate();
43 void autoReplaceRange(const OUString& aVariable, const ScRange& rRange);
44 void autoReplaceAddress(const OUString& aVariable, ScAddress aAddress);
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);
53 class AddressWalker
55 public:
56 std::list<ScAddress> mAddressStack;
58 ScAddress mCurrentAddress;
59 ScAddress mMinimumAddress;
60 ScAddress mMaximumAddress;
61 bool mTrackRange;
63 AddressWalker(ScAddress aInitialAddress, bool aTrackRange = true);
65 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 newLine();
73 void push(SCCOL aRelativeCol = 0, SCROW aRelativeRow = 0, SCTAB aRelativeTab = 0);
76 class AddressWalkerWriter : public AddressWalker
78 public:
79 ScDocShell* mpDocShell;
80 ScDocument* mpDocument;
81 formula::FormulaGrammar::Grammar meGrammar;
83 AddressWalkerWriter(ScAddress aInitialAddress, ScDocShell* pDocShell, ScDocument* pDocument,
84 formula::FormulaGrammar::Grammar eGrammar );
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);
94 class DataCellIterator
96 private:
97 ScRange mInputRange;
98 bool mByColumn;
99 SCCOL mCol;
100 SCROW mRow;
102 public:
103 DataCellIterator(ScRange aInputRange, bool aByColumn);
104 virtual ~DataCellIterator();
106 bool hasNext();
107 ScAddress get();
108 void next();
109 ScAddress getRelative(int aDelta);
112 class DataRangeIterator
114 protected:
115 ScRange mInputRange;
116 sal_Int32 mIndex;
118 public:
119 DataRangeIterator(ScRange aInputRange);
120 virtual ~DataRangeIterator();
122 virtual bool hasNext() = 0;
123 virtual ScRange get() = 0;
124 virtual void next() = 0;
125 virtual void reset() = 0;
126 sal_Int32 index();
128 virtual DataCellIterator iterateCells() = 0;
131 class DataRangeByColumnIterator : public DataRangeIterator
133 protected:
134 SCCOL mCol;
136 public:
137 DataRangeByColumnIterator(ScRange aInputRange);
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;
146 class DataRangeByRowIterator : public DataRangeIterator
148 protected:
149 SCROW mRow;
151 public:
152 DataRangeByRowIterator(ScRange aInputRange);
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;
161 #endif
163 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */