Revert "tdf#110987: type detection, binary Office formats > templates"
[LibreOffice.git] / sc / inc / calcconfig.hxx
blob2f840f9abdcb30c738a054a35811b9524677b1bc
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();
51 bool mbOpenCLSubsetOnly:1;
52 bool mbOpenCLAutoSelect:1;
53 OUString maOpenCLDevice;
54 sal_Int32 mnOpenCLMinimumFormulaGroupSize;
56 typedef std::shared_ptr<std::set<OpCode>> OpCodeSet;
58 OpCodeSet mpOpenCLSubsetOpCodes;
60 ScCalcConfig();
62 void setOpenCLConfigToDefault();
64 void reset();
65 void MergeDocumentSpecific( const ScCalcConfig& r );
66 void SetStringRefSyntax( formula::FormulaGrammar::AddressConvention eConv );
68 bool operator== (const ScCalcConfig& r) const;
69 bool operator!= (const ScCalcConfig& r) const;
72 SC_DLLPUBLIC OUString ScOpCodeSetToSymbolicString(const ScCalcConfig::OpCodeSet& rOpCodes);
73 SC_DLLPUBLIC ScCalcConfig::OpCodeSet ScStringToOpCodeSet(const OUString& rOpCodes);
75 #endif
77 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */