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: cfgitem.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 ************************************************************************/
35 #ifndef _MATH_CFGITEM_HXX_
36 #define _MATH_CFGITEM_HXX_
38 #include <com/sun/star/beans/PropertyValues.hpp>
39 #include <com/sun/star/uno/Sequence.hxx>
41 #ifndef _COM_SUN_STAR_UNO_ANY_H_
42 #include <com/sun/star/uno/Any.h>
45 #include <tools/solar.h>
47 #ifndef _RTL_USTRING_HXX_
48 #include <rtl/ustring.hxx>
50 #ifndef _UTL_CONFIGITEM_HXX_
51 #include <unotools/configitem.hxx>
54 #include <bf_svtools/svarray.hxx>
57 #include <vcl/timer.hxx>
65 using namespace ::com::sun::star
;
72 /////////////////////////////////////////////////////////////////
74 class SmMathConfigItem
: public ::utl::ConfigItem
76 // disallow copy-constructor and assignment-operator for now
77 SmMathConfigItem( const SmMathConfigItem
& );
78 SmMathConfigItem
& operator = ( const SmMathConfigItem
& );
81 inline SmMathConfigItem( const ::rtl::OUString
&rPath
,
82 sal_Int16 nMode
= CONFIG_MODE_IMMEDIATE_UPDATE
);
84 uno::Sequence
< ::rtl::OUString
> GetFormatPropertyNames();
85 uno::Sequence
< ::rtl::OUString
> GetOtherPropertyNames();
87 uno::Sequence
< uno::Any
>
88 GetProperties( const uno::Sequence
< ::rtl::OUString
> &rNames
)
90 return ConfigItem::GetProperties(rNames
);
94 PutProperties( const uno::Sequence
< ::rtl::OUString
> &rNames
,
95 const uno::Sequence
< uno::Any
> &rValues
)
97 return ConfigItem::PutProperties( rNames
, rValues
);
101 SetSetProperties( const ::rtl::OUString
&rNode
,
102 uno::Sequence
< beans::PropertyValue
> rValues
)
104 return ConfigItem::SetSetProperties( rNode
, rValues
);
107 uno::Sequence
< ::rtl::OUString
>
108 GetNodeNames( const ::rtl::OUString
&rNode
)
110 return ConfigItem::GetNodeNames( rNode
);
114 ReplaceSetProperties( const ::rtl::OUString
& rNode
,
115 uno::Sequence
< beans::PropertyValue
> rValues
)
117 return ConfigItem::ReplaceSetProperties( rNode
, rValues
);
122 inline SmMathConfigItem::SmMathConfigItem(
123 const ::rtl::OUString
&rPath
,
125 ConfigItem( rPath
, nMode
)
130 /////////////////////////////////////////////////////////////////
143 // SmFontFormat( const Font &rFont );
145 const Font
GetFont() const;
149 struct SmFntFmtListEntry
152 SmFontFormat aFntFmt
;
154 SmFntFmtListEntry( const String
&rId
, const SmFontFormat
&rFntFmt
);
158 SV_DECL_OBJARR( SmFntFmtListEntryArr
, SmFntFmtListEntry
, 8, 8 )//STRIP008 ;
161 class SmFontFormatList
163 SmFntFmtListEntryArr aEntries
;
166 // disallow copy-constructor and assignment-operator for now
167 SmFontFormatList( const SmFontFormatList
& );
168 SmFontFormatList
& operator = ( const SmFontFormatList
& );
173 void AddFontFormat( const String
&rFntFmtId
, const SmFontFormat
&rFntFmt
);
175 const SmFontFormat
* GetFontFormat( const String
&rFntFmtId
) const;
176 // const SmFontFormat * GetFontFormat( USHORT nPos ) const;
177 USHORT
GetCount() const { return aEntries
.Count(); }
179 BOOL
IsModified() const { return bModified
; }
180 void SetModified( BOOL bVal
) { bModified
= bVal
; }
184 /////////////////////////////////////////////////////////////////
191 SmFontFormatList
* pFontFormatList
;
194 BOOL bIsOtherModified
;
195 BOOL bIsFormatModified
;
197 // disallow copy-constructor and assignment-operator for now
198 SmMathConfig( const SmMathConfig
& );
199 SmMathConfig
& operator = ( const SmMathConfig
& );
207 void LoadFontFormatList();
208 void SaveFontFormatList();
214 SmSym
ReadSymbol( SmMathConfigItem
&rCfg
,
215 const ::rtl::OUString
&rSymbolName
,
216 const ::rtl::OUString
&rBaseNode
) const;
217 SmFontFormat
ReadFontFormat( SmMathConfigItem
&rCfg
,
218 const ::rtl::OUString
&rSymbolName
,
219 const ::rtl::OUString
&rBaseNode
) const;
222 DECL_LINK( TimeOut
, Timer
* );
225 void SetOtherModified( BOOL bVal
);
226 inline BOOL
IsOtherModified() const { return bIsOtherModified
; }
227 void SetFormatModified( BOOL bVal
);
228 inline BOOL
IsFormatModified() const { return bIsFormatModified
; }
230 SmFontFormatList
& GetFontFormatList();
231 const SmFontFormatList
& GetFontFormatList() const
233 return ((SmMathConfig
*) this)->GetFontFormatList();
240 USHORT
GetSymbolCount() const;
241 const SmSym
* GetSymbol( USHORT nIndex
) const;
243 const SmFormat
& GetStandardFormat() const;
245 BOOL
IsPrintTitle() const;
246 BOOL
IsPrintFormulaText() const;
247 BOOL
IsPrintFrame() const;
248 SmPrintSize
GetPrintSize() const;
249 USHORT
GetPrintZoomFactor() const;
251 BOOL
IsIgnoreSpacesRight() const;
252 BOOL
IsAutoRedraw() const;
255 /////////////////////////////////////////////////////////////////
257 } //namespace binfilter