1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: docoptio.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef SC_DOCOPTIO_HXX
32 #define SC_DOCOPTIO_HXX
36 #ifndef _SFXPOOLITEM_HXX //autogen
37 #include <bf_svtools/poolitem.hxx>
40 #ifndef SC_OPTUTIL_HXX
41 #include "optutil.hxx"
49 double fIterEps
; // Epsilon-Wert dazu
50 USHORT nIterCount
; // Anzahl
51 USHORT nPrecStandardFormat
; // Nachkommastellen Standard
52 USHORT nDay
; // Nulldatum:
55 USHORT nYear2000
; // bis zu welcher zweistelligen Jahreszahl 20xx angenommen wird
56 USHORT nTabDistance
; // Abstand Standardtabulatoren
57 BOOL bIsIgnoreCase
; // Gross-/Kleinschr. bei Vergleichen
58 BOOL bIsIter
; // Iteration bei cirk. Ref
59 BOOL bCalcAsShown
; // berechnen wie angezeigt (Precision)
60 BOOL bMatchWholeCell
; // Suchkriterien muessen ganze Zelle matchen
61 BOOL bDoAutoSpell
; // Auto-Spelling
62 BOOL bLookUpColRowNames
; // Spalten-/Zeilenbeschriftungen automagisch suchen
63 BOOL bFormulaRegexEnabled
; // regular expressions in formulas enabled
67 ScDocOptions( const ScDocOptions
& rCpy
);
70 BOOL
IsLookUpColRowNames() const { return bLookUpColRowNames
; }
71 void SetLookUpColRowNames( BOOL bVal
) { bLookUpColRowNames
= bVal
; }
72 BOOL
IsAutoSpell() const { return bDoAutoSpell
; }
73 void SetAutoSpell( BOOL bVal
) { bDoAutoSpell
= bVal
; }
74 BOOL
IsMatchWholeCell() const { return bMatchWholeCell
; }
75 void SetMatchWholeCell( BOOL bVal
){ bMatchWholeCell
= bVal
; }
76 BOOL
IsIgnoreCase() const { return bIsIgnoreCase
; }
77 void SetIgnoreCase( BOOL bVal
) { bIsIgnoreCase
= bVal
; }
78 BOOL
IsIter() const { return bIsIter
; }
79 void SetIter( BOOL bVal
) { bIsIter
= bVal
; }
80 USHORT
GetIterCount() const { return nIterCount
; }
81 void SetIterCount( USHORT nCount
) { nIterCount
= nCount
; }
82 double GetIterEps() const { return fIterEps
; }
83 void SetIterEps( double fEps
) { fIterEps
= fEps
; }
85 void GetDate( USHORT
& rD
, USHORT
& rM
, USHORT
& rY
) const
86 { rD
= nDay
; rM
= nMonth
; rY
= nYear
;}
87 void SetDate (USHORT nD
, USHORT nM
, USHORT nY
)
88 { nDay
= nD
; nMonth
= nM
; nYear
= nY
; }
89 USHORT
GetTabDistance() const { return nTabDistance
;}
90 void SetTabDistance( USHORT nTabDist
) {nTabDistance
= nTabDist
;}
92 void ResetDocOptions();
93 inline void CopyTo(ScDocOptions
& rOpt
);
94 void Load(SvStream
& rStream
);
95 void Save(SvStream
& rStream
, BOOL bConfig
= FALSE
) const;
97 inline const ScDocOptions
& operator=( const ScDocOptions
& rOpt
);
98 inline int operator==( const ScDocOptions
& rOpt
) const;
99 inline int operator!=( const ScDocOptions
& rOpt
) const;
101 USHORT
GetStdPrecision() const { return nPrecStandardFormat
; }
102 void SetStdPrecision( USHORT n
) { nPrecStandardFormat
= n
; }
104 BOOL
IsCalcAsShown() const { return bCalcAsShown
; }
105 void SetCalcAsShown( BOOL bVal
) { bCalcAsShown
= bVal
; }
107 void SetYear2000( USHORT nVal
) { nYear2000
= nVal
; }
108 USHORT
GetYear2000() const { return nYear2000
; }
110 void SetFormulaRegexEnabled( BOOL bVal
) { bFormulaRegexEnabled
= bVal
; }
111 BOOL
IsFormulaRegexEnabled() const { return bFormulaRegexEnabled
; }
115 inline void ScDocOptions::CopyTo(ScDocOptions
& rOpt
)
117 rOpt
.bIsIgnoreCase
= bIsIgnoreCase
;
118 rOpt
.bIsIter
= bIsIter
;
119 rOpt
.nIterCount
= nIterCount
;
120 rOpt
.fIterEps
= fIterEps
;
121 rOpt
.nPrecStandardFormat
= nPrecStandardFormat
;
123 rOpt
.nMonth
= nMonth
;
124 rOpt
.nYear2000
= nYear2000
;
126 rOpt
.nTabDistance
= nTabDistance
;
127 rOpt
.bCalcAsShown
= bCalcAsShown
;
128 rOpt
.bMatchWholeCell
= bMatchWholeCell
;
129 rOpt
.bDoAutoSpell
= bDoAutoSpell
;
130 rOpt
.bLookUpColRowNames
= bLookUpColRowNames
;
131 rOpt
.bFormulaRegexEnabled
= bFormulaRegexEnabled
;
134 inline const ScDocOptions
& ScDocOptions::operator=( const ScDocOptions
& rCpy
)
136 bIsIgnoreCase
= rCpy
.bIsIgnoreCase
;
137 bIsIter
= rCpy
.bIsIter
;
138 nIterCount
= rCpy
.nIterCount
;
139 fIterEps
= rCpy
.fIterEps
;
140 nPrecStandardFormat
= rCpy
.nPrecStandardFormat
;
142 nMonth
= rCpy
.nMonth
;
144 nYear2000
= rCpy
.nYear2000
;
145 nTabDistance
= rCpy
.nTabDistance
;
146 bCalcAsShown
= rCpy
.bCalcAsShown
;
147 bMatchWholeCell
= rCpy
.bMatchWholeCell
;
148 bDoAutoSpell
= rCpy
.bDoAutoSpell
;
149 bLookUpColRowNames
= rCpy
.bLookUpColRowNames
;
150 bFormulaRegexEnabled
= rCpy
.bFormulaRegexEnabled
;
155 inline int ScDocOptions::operator==( const ScDocOptions
& rOpt
) const
158 rOpt
.bIsIgnoreCase
== bIsIgnoreCase
159 && rOpt
.bIsIter
== bIsIter
160 && rOpt
.nIterCount
== nIterCount
161 && rOpt
.fIterEps
== fIterEps
162 && rOpt
.nPrecStandardFormat
== nPrecStandardFormat
164 && rOpt
.nMonth
== nMonth
165 && rOpt
.nYear
== nYear
166 && rOpt
.nYear2000
== nYear2000
167 && rOpt
.nTabDistance
== nTabDistance
168 && rOpt
.bCalcAsShown
== bCalcAsShown
169 && rOpt
.bMatchWholeCell
== bMatchWholeCell
170 && rOpt
.bDoAutoSpell
== bDoAutoSpell
171 && rOpt
.bLookUpColRowNames
== bLookUpColRowNames
172 && rOpt
.bFormulaRegexEnabled
== bFormulaRegexEnabled
176 inline int ScDocOptions::operator!=( const ScDocOptions
& rOpt
) const
178 return !(operator==(rOpt
));
181 //==================================================================
182 // Item fuer Einstellungsdialog - Berechnen
183 //==================================================================
186 //==================================================================
187 // Config Item containing document options
188 //==================================================================
190 class ScDocCfg
: public ScDocOptions
192 ScLinkConfigItem aCalcItem
;
193 ScLinkConfigItem aLayoutItem
;
195 DECL_LINK( CalcCommitHdl
, void* );
196 DECL_LINK( LayoutCommitHdl
, void* );
198 ::com::sun::star::uno::Sequence
<rtl::OUString
> GetCalcPropertyNames();
199 ::com::sun::star::uno::Sequence
<rtl::OUString
> GetLayoutPropertyNames();
207 } //namespace binfilter