1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/.
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"
19 #include "calcconfig.hxx"
21 class SC_DLLPUBLIC ScFormulaOptions
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
;
37 ScFormulaOptions( const ScFormulaOptions
& rCpy
);
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
86 ScTpFormulaItem( sal_uInt16 nWhich
,
87 const ScFormulaOptions
& rOpt
);
88 ScTpFormulaItem( const ScTpFormulaItem
& rItem
);
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
; }
98 ScFormulaOptions theOptions
;
101 //==================================================================
103 //==================================================================
105 class ScFormulaCfg
: public ScFormulaOptions
, public utl::ConfigItem
107 com::sun::star::uno::Sequence
<OUString
> GetPropertyNames();
111 void SetOptions( const ScFormulaOptions
& rNew
);
113 virtual void Commit();
114 virtual void Notify( const ::com::sun::star::uno::Sequence
< OUString
>& aPropertyNames
);
119 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */