LibreOffice Module sc (master)  1
calcconfig.hxx
Go to the documentation of this file.
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 #ifndef INCLUDED_SC_INC_CALCCONFIG_HXX
11 #define INCLUDED_SC_INC_CALCCONFIG_HXX
12 
13 #include "scdllapi.h"
14 
15 #include <memory>
16 #include <string_view>
17 
18 #include <o3tl/sorted_vector.hxx>
19 #include <formula/grammar.hxx>
20 #include <formula/opcode.hxx>
21 #include <rtl/ustring.hxx>
22 
23 // have to match the registry values
25 {
29 };
30 
31 // Env.var. SC_FORCE_CALCULATION can be used to force all calculation
32 // to be done using OpenCL or group threading (even for single cells).
34 {
35  ForceCalculationNone, // do not force anything
36  ForceCalculationCore, // "core", use only non-threaded normal code
37  ForceCalculationOpenCL, // "opencl", force OpenCL
38  ForceCalculationThreads // "threads", force threaded code
39 };
40 
45 {
46  // from most stringent to most relaxed
47  enum class StringConversion
48  {
49  ILLEGAL,
50  ZERO,
51  UNAMBIGUOUS,
52  LOCALE
53  };
56  bool mbEmptyStringAsZero : 1;
57  bool mbHasStringRefSyntax : 1;
58 
59  static bool isOpenCLEnabled();
60  static bool isThreadingEnabled();
61  static ForceCalculationType getForceCalculationType();
62 
63  bool mbOpenCLSubsetOnly : 1;
64  bool mbOpenCLAutoSelect : 1;
65  OUString maOpenCLDevice;
67 
68  typedef std::shared_ptr<o3tl::sorted_vector<OpCode>> OpCodeSet;
69 
71 
72  ScCalcConfig();
73 
74  void setOpenCLConfigToDefault();
75 
76  void reset();
77  void MergeDocumentSpecific(const ScCalcConfig& r);
78  void SetStringRefSyntax(formula::FormulaGrammar::AddressConvention eConv);
79 
80  bool operator==(const ScCalcConfig& r) const;
81  bool operator!=(const ScCalcConfig& r) const;
82 };
83 
85 ScCalcConfig::OpCodeSet ScStringToOpCodeSet(std::u16string_view rOpCodes);
86 
87 #endif
88 
89 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool operator==(const XclFontData &rLeft, const XclFontData &rRight)
Definition: xlstyle.cxx:517
bool operator!=(const XclExpString &rLeft, const XclExpString &rRight)
Definition: xestring.hxx:251
ScCalcConfig::OpCodeSet ScStringToOpCodeSet(std::u16string_view rOpCodes)
Definition: calcconfig.cxx:205
OUString maOpenCLDevice
Definition: calcconfig.hxx:65
std::shared_ptr< o3tl::sorted_vector< OpCode > > OpCodeSet
Definition: calcconfig.hxx:68
StringConversion meStringConversion
Definition: calcconfig.hxx:55
OpCodeSet mpOpenCLSubsetOpCodes
Definition: calcconfig.hxx:70
formula::FormulaGrammar::AddressConvention meStringRefAddressSyntax
Definition: calcconfig.hxx:54
Configuration options for formula interpreter.
Definition: calcconfig.hxx:44
sal_Int32 mnOpenCLMinimumFormulaGroupSize
Definition: calcconfig.hxx:66
#define LOCALE
Definition: vbaformat.cxx:57
ScRecalcOptions
Definition: calcconfig.hxx:24
ForceCalculationType
Definition: calcconfig.hxx:33
OUString ScOpCodeSetToSymbolicString(const ScCalcConfig::OpCodeSet &rOpCodes)
Definition: calcconfig.cxx:189
#define SC_DLLPUBLIC
Definition: scdllapi.h:28