bump product version to 4.1.6.2
[LibreOffice.git] / sc / inc / formulaopt.hxx
blob75841978000a4dd7760cb6b51751ba20e48d81d6
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 SC_FORMULAOPT_HXX
11 #define SC_FORMULAOPT_HXX
13 #include <svl/poolitem.hxx>
14 #include <unotools/configitem.hxx>
15 #include <unotools/localedatawrapper.hxx>
16 #include "formula/grammar.hxx"
17 #include "scdllapi.h"
18 #include "global.hxx"
19 #include "calcconfig.hxx"
21 class SC_DLLPUBLIC ScFormulaOptions
23 private:
24 bool bUseEnglishFuncName; // use English function name even if the locale is not English.
25 formula::FormulaGrammar::Grammar eFormulaGrammar; // formula grammar used to switch different formula syntax
26 ScCalcConfig aCalcConfig;
28 OUString aFormulaSepArg;
29 OUString aFormulaSepArrayRow;
30 OUString aFormulaSepArrayCol;
32 ScRecalcOptions meOOXMLRecalc;
33 ScRecalcOptions meODFRecalc;
35 public:
36 ScFormulaOptions();
37 ScFormulaOptions( const ScFormulaOptions& rCpy );
38 ~ScFormulaOptions();
40 void SetDefaults();
42 void SetFormulaSyntax( ::formula::FormulaGrammar::Grammar eGram ) { eFormulaGrammar = eGram; }
43 ::formula::FormulaGrammar::Grammar GetFormulaSyntax() const { return eFormulaGrammar; }
45 ScCalcConfig& GetCalcConfig() { return aCalcConfig; }
46 const ScCalcConfig& GetCalcConfig() const { return aCalcConfig; }
47 void SetCalcConfig(const ScCalcConfig& rConfig) { aCalcConfig = rConfig; }
49 void SetUseEnglishFuncName( bool bVal ) { bUseEnglishFuncName = bVal; }
50 bool GetUseEnglishFuncName() const { return bUseEnglishFuncName; }
52 void SetFormulaSepArg(const OUString& rSep) { aFormulaSepArg = rSep; }
53 OUString GetFormulaSepArg() const { return aFormulaSepArg; }
55 void SetFormulaSepArrayRow(const OUString& rSep) { aFormulaSepArrayRow = rSep; }
56 OUString GetFormulaSepArrayRow() const { return aFormulaSepArrayRow; }
58 void SetFormulaSepArrayCol(const OUString& rSep) { aFormulaSepArrayCol = rSep; }
59 OUString GetFormulaSepArrayCol() const { return aFormulaSepArrayCol; }
61 void SetOOXMLRecalcOptions( ScRecalcOptions eOpt ) { meOOXMLRecalc = eOpt; }
62 ScRecalcOptions GetOOXMLRecalcOptions() const { return meOOXMLRecalc; }
64 void SetODFRecalcOptions( ScRecalcOptions eOpt ) { meODFRecalc = eOpt; }
65 ScRecalcOptions GetODFRecalcOptions() const { return meODFRecalc; }
67 void ResetFormulaSeparators();
69 static void GetDefaultFormulaSeparators(OUString& rSepArg, OUString& rSepArrayCol, OUString& rSepArrayRow);
71 static const LocaleDataWrapper& GetLocaleDataWrapper();
73 ScFormulaOptions& operator= ( const ScFormulaOptions& rCpy );
74 bool operator== ( const ScFormulaOptions& rOpt ) const;
75 bool operator!= ( const ScFormulaOptions& rOpt ) const;
78 //==================================================================
79 // item for the dialog / options page
80 //==================================================================
82 class SC_DLLPUBLIC ScTpFormulaItem : public SfxPoolItem
84 public:
85 TYPEINFO();
86 ScTpFormulaItem( sal_uInt16 nWhich,
87 const ScFormulaOptions& rOpt );
88 ScTpFormulaItem( const ScTpFormulaItem& rItem );
89 ~ScTpFormulaItem();
91 virtual String GetValueText() const;
92 virtual int operator==( const SfxPoolItem& ) const;
93 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
95 const ScFormulaOptions& GetFormulaOptions() const { return theOptions; }
97 private:
98 ScFormulaOptions theOptions;
101 //==================================================================
102 // config item
103 //==================================================================
105 class ScFormulaCfg : public ScFormulaOptions, public utl::ConfigItem
107 com::sun::star::uno::Sequence<OUString> GetPropertyNames();
108 public:
109 ScFormulaCfg();
111 void SetOptions( const ScFormulaOptions& rNew );
113 virtual void Commit();
114 virtual void Notify( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames );
117 #endif
119 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */