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/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
24 #ifndef _MATH_CFGITEM_HXX_
25 #define _MATH_CFGITEM_HXX_
30 #include <com/sun/star/beans/PropertyValues.hpp>
31 #include <com/sun/star/uno/Sequence.hxx>
32 #include <com/sun/star/uno/Any.h>
34 #include <tools/solar.h>
35 #include <rtl/ustring.hxx>
36 #include <unotools/configitem.hxx>
37 #include <vcl/timer.hxx>
47 /////////////////////////////////////////////////////////////////
60 SmFontFormat( const Font
&rFont
);
62 const Font
GetFont() const;
63 bool operator == ( const SmFontFormat
&rFntFmt
) const;
67 struct SmFntFmtListEntry
72 SmFntFmtListEntry( const String
&rId
, const SmFontFormat
&rFntFmt
);
75 class SmFontFormatList
77 std::deque
<SmFntFmtListEntry
> aEntries
;
80 // disallow copy-constructor and assignment-operator for now
81 SmFontFormatList( const SmFontFormatList
& );
82 SmFontFormatList
& operator = ( const SmFontFormatList
& );
88 void AddFontFormat( const String
&rFntFmtId
, const SmFontFormat
&rFntFmt
);
89 void RemoveFontFormat( const String
&rFntFmtId
);
91 const SmFontFormat
* GetFontFormat( const String
&rFntFmtId
) const;
92 const SmFontFormat
* GetFontFormat( size_t nPos
) const;
93 const String
GetFontFormatId( const SmFontFormat
&rFntFmt
) const;
94 const String
GetFontFormatId( const SmFontFormat
&rFntFmt
, bool bAdd
);
95 const String
GetFontFormatId( size_t nPos
) const;
96 const OUString
GetNewFontFormatId() const;
97 size_t GetCount() const { return aEntries
.size(); }
99 bool IsModified() const { return bModified
; }
100 void SetModified( bool bVal
) { bModified
= bVal
; }
104 /////////////////////////////////////////////////////////////////
106 class SmMathConfig
: public utl::ConfigItem
110 SmFontFormatList
* pFontFormatList
;
111 SmSymbolManager
* pSymbolMgr
;
112 bool bIsOtherModified
;
113 bool bIsFormatModified
;
115 // disallow copy-constructor and assignment-operator for now
116 SmMathConfig( const SmMathConfig
& );
117 SmMathConfig
& operator = ( const SmMathConfig
& );
120 void StripFontFormatList( const std::vector
< SmSym
> &rSymbols
);
125 void ReadSymbol( SmSym
&rSymbol
,
126 const OUString
&rSymbolName
,
127 const OUString
&rBaseNode
) const;
128 void ReadFontFormat( SmFontFormat
&rFontFormat
,
129 const OUString
&rSymbolName
,
130 const OUString
&rBaseNode
) const;
132 void SetOtherIfNotEqual( bool &rbItem
, bool bNewVal
);
139 void LoadFontFormatList();
140 void SaveFontFormatList();
142 void SetOtherModified( bool bVal
);
143 inline bool IsOtherModified() const { return bIsOtherModified
; }
144 void SetFormatModified( bool bVal
);
145 inline bool IsFormatModified() const { return bIsFormatModified
; }
146 void SetFontFormatListModified( bool bVal
);
147 inline bool IsFontFormatListModified() const { return pFontFormatList
? pFontFormatList
->IsModified(): false; }
149 SmFontFormatList
& GetFontFormatList();
150 const SmFontFormatList
& GetFontFormatList() const
152 return ((SmMathConfig
*) this)->GetFontFormatList();
157 virtual ~SmMathConfig();
160 virtual void Notify( const com::sun::star::uno::Sequence
< OUString
> &rPropertyNames
);
161 virtual void Commit();
163 SmSymbolManager
& GetSymbolManager();
164 void GetSymbols( std::vector
< SmSym
> &rSymbols
) const;
165 void SetSymbols( const std::vector
< SmSym
> &rNewSymbols
);
167 const SmFormat
& GetStandardFormat() const;
168 void SetStandardFormat( const SmFormat
&rFormat
, bool bSaveFontFormatList
= false );
170 bool IsPrintTitle() const;
171 void SetPrintTitle( bool bVal
);
172 bool IsPrintFormulaText() const;
173 void SetPrintFormulaText( bool bVal
);
174 bool IsPrintFrame() const;
175 void SetPrintFrame( bool bVal
);
176 SmPrintSize
GetPrintSize() const;
177 void SetPrintSize( SmPrintSize eSize
);
178 sal_uInt16
GetPrintZoomFactor() const;
179 void SetPrintZoomFactor( sal_uInt16 nVal
);
181 bool IsSaveOnlyUsedSymbols() const;
182 void SetSaveOnlyUsedSymbols( bool bVal
);
183 bool IsIgnoreSpacesRight() const;
184 void SetIgnoreSpacesRight( bool bVal
);
185 bool IsAutoRedraw() const;
186 void SetAutoRedraw( bool bVal
);
187 bool IsShowFormulaCursor() const;
188 void SetShowFormulaCursor( bool bVal
);
189 void SetAutoRedraw( sal_Bool bVal
);
192 /////////////////////////////////////////////////////////////////
196 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */