/src/libreoffice/sc/inc/simpleformulacalc.hxx
Line | Count | Source |
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 | | #pragma once |
11 | | |
12 | | #include <memory> |
13 | | #include <formula/grammar.hxx> |
14 | | |
15 | | #include "address.hxx" |
16 | | #include "formularesult.hxx" |
17 | | |
18 | | class ScDocument; |
19 | | class ScTokenArray; |
20 | | |
21 | | class ScSimpleFormulaCalculator |
22 | | { |
23 | | private: |
24 | | SvNumFormatType mnFormatType; |
25 | | |
26 | | bool mbCalculated; |
27 | | std::unique_ptr<ScTokenArray> mpCode; |
28 | | ScAddress maAddr; |
29 | | ScDocument& mrDoc; |
30 | | ScFormulaResult maResult; |
31 | | formula::FormulaGrammar::Grammar maGram; |
32 | | bool mbMatrixResult; |
33 | | OUString maMatrixFormulaResult; |
34 | | bool mbLimitString; |
35 | | bool mbMatrixFormula; |
36 | | |
37 | | public: |
38 | | ScSimpleFormulaCalculator(ScDocument& rDoc, const ScAddress& rAddr, |
39 | | const OUString& rFormula, bool bMatrixFormula, |
40 | | formula::FormulaGrammar::Grammar eGram = formula::FormulaGrammar::GRAM_DEFAULT); |
41 | | ScSimpleFormulaCalculator(ScDocument& rDoc, const ScAddress& rAddr, |
42 | | std::unique_ptr<ScTokenArray> pArray, bool bMatrixFormula, |
43 | | formula::FormulaGrammar::Grammar eGram = formula::FormulaGrammar::GRAM_DEFAULT); |
44 | | ~ScSimpleFormulaCalculator(); |
45 | | |
46 | | void Calculate(); |
47 | | bool IsValue(); |
48 | | bool IsMatrix(); |
49 | | FormulaError GetErrCode(); |
50 | | double GetValue(); |
51 | | svl::SharedString GetString(); |
52 | 0 | SvNumFormatType GetFormatType() const { return mnFormatType; } |
53 | | |
54 | | bool HasColRowName() const; |
55 | | |
56 | | ScTokenArray* GetCode(); |
57 | | |
58 | | void SetLimitString(bool bLimitString); |
59 | | }; |
60 | | |
61 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |