LibreOffice Module sc (master) 1
formulaopt.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#pragma once
11
12#include <map>
13#include <svl/poolitem.hxx>
15#include <formula/grammar.hxx>
16#include "scdllapi.h"
17#include "calcconfig.hxx"
18
20{
21private:
22 bool bUseEnglishFuncName; // use English function name even if the locale is not English.
23 formula::FormulaGrammar::Grammar eFormulaGrammar; // formula grammar used to switch different formula syntax
26
30
33
34public:
36
37 void SetDefaults();
38
39 void SetFormulaSyntax( ::formula::FormulaGrammar::Grammar eGram ) { eFormulaGrammar = eGram; }
40 ::formula::FormulaGrammar::Grammar GetFormulaSyntax() const { return eFormulaGrammar; }
41
42 ScCalcConfig& GetCalcConfig() { return aCalcConfig; }
43 const ScCalcConfig& GetCalcConfig() const { return aCalcConfig; }
44 void SetCalcConfig(const ScCalcConfig& rConfig) { aCalcConfig = rConfig; }
45
46 void SetUseEnglishFuncName( bool bVal ) { bUseEnglishFuncName = bVal; }
47 bool GetUseEnglishFuncName() const { return bUseEnglishFuncName; }
48
49 void SetWriteCalcConfig( bool bVal ) { mbWriteCalcConfig = bVal; }
50 bool GetWriteCalcConfig() const { return mbWriteCalcConfig; }
51
52 void SetFormulaSepArg(const OUString& rSep) { aFormulaSepArg = rSep; }
53 const OUString& GetFormulaSepArg() const { return aFormulaSepArg; }
54
55 void SetFormulaSepArrayRow(const OUString& rSep) { aFormulaSepArrayRow = rSep; }
56 const OUString& GetFormulaSepArrayRow() const { return aFormulaSepArrayRow; }
57
58 void SetFormulaSepArrayCol(const OUString& rSep) { aFormulaSepArrayCol = rSep; }
59 const OUString& GetFormulaSepArrayCol() const { return aFormulaSepArrayCol; }
60
61 void SetOOXMLRecalcOptions( ScRecalcOptions eOpt ) { meOOXMLRecalc = eOpt; }
62 ScRecalcOptions GetOOXMLRecalcOptions() const { return meOOXMLRecalc; }
63
64 void SetODFRecalcOptions( ScRecalcOptions eOpt ) { meODFRecalc = eOpt; }
65 ScRecalcOptions GetODFRecalcOptions() const { return meODFRecalc; }
66
67 void ResetFormulaSeparators();
68
69 static void GetDefaultFormulaSeparators(OUString& rSepArg, OUString& rSepArrayCol, OUString& rSepArrayRow);
70
71 bool operator== ( const ScFormulaOptions& rOpt ) const;
72 bool operator!= ( const ScFormulaOptions& rOpt ) const;
73};
74
75// item for the dialog / options page
76
78{
79public:
80 ScTpFormulaItem( const ScFormulaOptions& rOpt );
81 virtual ~ScTpFormulaItem() override;
82
83 ScTpFormulaItem(ScTpFormulaItem const &) = default;
85 ScTpFormulaItem & operator =(ScTpFormulaItem const &) = delete; // due to SfxPoolItem
86 ScTpFormulaItem & operator =(ScTpFormulaItem &&) = delete; // due to SfxPoolItem
87
88 virtual bool operator==( const SfxPoolItem& ) const override;
89 virtual ScTpFormulaItem* Clone( SfxItemPool *pPool = nullptr ) const override;
90
91 const ScFormulaOptions& GetFormulaOptions() const { return theOptions; }
92
93private:
95};
96
97// config item
98
99class ScFormulaCfg final : public ScFormulaOptions, public utl::ConfigItem
100{
101 typedef std::map<OUString,sal_uInt16> PropsToIds;
102 static css::uno::Sequence<OUString> GetPropertyNames();
104 void UpdateFromProperties( const css::uno::Sequence<OUString>& rNames );
105
106 virtual void ImplCommit() override;
107
108public:
109 ScFormulaCfg();
110
111 void SetOptions( const ScFormulaOptions& rNew );
112
113 virtual void Notify( const css::uno::Sequence< OUString >& aPropertyNames ) override;
114};
115
116/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ScRecalcOptions
Definition: calcconfig.hxx:24
virtual void ImplCommit() override
Definition: formulaopt.cxx:461
virtual void Notify(const css::uno::Sequence< OUString > &aPropertyNames) override
Definition: formulaopt.cxx:647
static css::uno::Sequence< OUString > GetPropertyNames()
Definition: formulaopt.cxx:167
void UpdateFromProperties(const css::uno::Sequence< OUString > &rNames)
Definition: formulaopt.cxx:221
std::map< OUString, sal_uInt16 > PropsToIds
Definition: formulaopt.hxx:101
static ScFormulaCfg::PropsToIds GetPropNamesToId()
Definition: formulaopt.cxx:186
void SetOptions(const ScFormulaOptions &rNew)
Definition: formulaopt.cxx:641
void SetFormulaSepArrayRow(const OUString &rSep)
Definition: formulaopt.hxx:55
formula::FormulaGrammar::Grammar eFormulaGrammar
Definition: formulaopt.hxx:23
const OUString & GetFormulaSepArg() const
Definition: formulaopt.hxx:53
const ScCalcConfig & GetCalcConfig() const
Definition: formulaopt.hxx:43
void SetUseEnglishFuncName(bool bVal)
Definition: formulaopt.hxx:46
OUString aFormulaSepArrayCol
Definition: formulaopt.hxx:29
void SetFormulaSepArrayCol(const OUString &rSep)
Definition: formulaopt.hxx:58
ScRecalcOptions meODFRecalc
Definition: formulaopt.hxx:32
void SetFormulaSyntax(::formula::FormulaGrammar::Grammar eGram)
Definition: formulaopt.hxx:39
ScCalcConfig aCalcConfig
Definition: formulaopt.hxx:24
OUString aFormulaSepArrayRow
Definition: formulaopt.hxx:28
ScCalcConfig & GetCalcConfig()
Definition: formulaopt.hxx:42
void SetOOXMLRecalcOptions(ScRecalcOptions eOpt)
Definition: formulaopt.hxx:61
ScRecalcOptions meOOXMLRecalc
Definition: formulaopt.hxx:31
const OUString & GetFormulaSepArrayCol() const
Definition: formulaopt.hxx:59
void SetWriteCalcConfig(bool bVal)
Definition: formulaopt.hxx:49
OUString aFormulaSepArg
Definition: formulaopt.hxx:27
bool GetWriteCalcConfig() const
Definition: formulaopt.hxx:50
bool GetUseEnglishFuncName() const
Definition: formulaopt.hxx:47
ScRecalcOptions GetOOXMLRecalcOptions() const
Definition: formulaopt.hxx:62
::formula::FormulaGrammar::Grammar GetFormulaSyntax() const
Definition: formulaopt.hxx:40
void SetCalcConfig(const ScCalcConfig &rConfig)
Definition: formulaopt.hxx:44
bool bUseEnglishFuncName
Definition: formulaopt.hxx:22
void SetFormulaSepArg(const OUString &rSep)
Definition: formulaopt.hxx:52
const OUString & GetFormulaSepArrayRow() const
Definition: formulaopt.hxx:56
ScRecalcOptions GetODFRecalcOptions() const
Definition: formulaopt.hxx:65
void SetODFRecalcOptions(ScRecalcOptions eOpt)
Definition: formulaopt.hxx:64
ScTpFormulaItem(ScTpFormulaItem const &)=default
ScTpFormulaItem(ScTpFormulaItem &&)=default
ScFormulaOptions theOptions
Definition: formulaopt.hxx:94
const ScFormulaOptions & GetFormulaOptions() const
Definition: formulaopt.hxx:91
css::uno::Reference< css::animations::XAnimationNode > Clone(const css::uno::Reference< css::animations::XAnimationNode > &xSourceNode, const SdPage *pSource=nullptr, const SdPage *pTarget=nullptr)
#define SC_DLLPUBLIC
Definition: scdllapi.h:27
Configuration options for formula interpreter.
Definition: calcconfig.hxx:44
bool operator!=(const XclExpString &rLeft, const XclExpString &rRight)
Definition: xestring.hxx:248
bool operator==(const XclFontData &rLeft, const XclFontData &rRight)
Definition: xlstyle.cxx:519