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