Version 6.1.0.2, tag libreoffice-6.1.0.2
[LibreOffice.git] / sc / inc / calcconfig.hxx
blob3ef920857fd0d849217681d6779df6116d87ad7b
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/.
8 */
10 #ifndef INCLUDED_SC_INC_CALCCONFIG_HXX
11 #define INCLUDED_SC_INC_CALCCONFIG_HXX
13 #include "scdllapi.h"
15 #include <memory>
16 #include <set>
18 #include <formula/grammar.hxx>
19 #include <formula/opcode.hxx>
20 #include <rtl/ustring.hxx>
22 // have to match the registry values
23 enum ScRecalcOptions
25 RECALC_ALWAYS = 0,
26 RECALC_NEVER,
27 RECALC_ASK,
30 /**
31 * Configuration options for formula interpreter.
33 struct SC_DLLPUBLIC ScCalcConfig
35 // from most stringent to most relaxed
36 enum class StringConversion
38 ILLEGAL, ///< =1+"1" or =1+"x" give #VALUE!
39 ZERO, ///< =1+"1" or =1+"x" give 1
40 UNAMBIGUOUS, ///< =1+"1" gives 2, but =1+"1.000" or =1+"x" give #VALUE!
41 LOCALE ///< =1+"1.000" may be 2 or 1001 ... =1+"x" gives #VALUE!
43 formula::FormulaGrammar::AddressConvention meStringRefAddressSyntax;
44 StringConversion meStringConversion;
45 bool mbEmptyStringAsZero:1;
46 bool mbHasStringRefSyntax:1;
48 static bool isOpenCLEnabled();
49 static bool isThreadingEnabled();
50 static bool isSwInterpreterEnabled();
52 bool mbOpenCLSubsetOnly:1;
53 bool mbOpenCLAutoSelect:1;
54 OUString maOpenCLDevice;
55 sal_Int32 mnOpenCLMinimumFormulaGroupSize;
57 typedef std::shared_ptr<std::set<OpCode>> OpCodeSet;
59 OpCodeSet mpOpenCLSubsetOpCodes;
60 OpCodeSet mpSwInterpreterSubsetOpCodes;
62 ScCalcConfig();
64 void setOpenCLConfigToDefault();
66 void reset();
67 void MergeDocumentSpecific( const ScCalcConfig& r );
68 void SetStringRefSyntax( formula::FormulaGrammar::AddressConvention eConv );
70 bool operator== (const ScCalcConfig& r) const;
71 bool operator!= (const ScCalcConfig& r) const;
74 SC_DLLPUBLIC OUString ScOpCodeSetToSymbolicString(const ScCalcConfig::OpCodeSet& rOpCodes);
75 SC_DLLPUBLIC ScCalcConfig::OpCodeSet ScStringToOpCodeSet(const OUString& rOpCodes);
77 #endif
79 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */