00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 #ifdef _MSC_VER
00037 #pragma hdrstop
00038 #endif
00039
00040 #ifndef _MATH_CFGITEM_HXX_
00041 #define _MATH_CFGITEM_HXX_
00042
00043 #include <vector>
00044
00045 #include <com/sun/star/beans/PropertyValues.hpp>
00046 #include <com/sun/star/uno/Sequence.hxx>
00047
00048 #ifndef _COM_SUN_STAR_UNO_ANY_H_
00049 #include <com/sun/star/uno/Any.h>
00050 #endif
00051
00052 #include <tools/solar.h>
00053
00054 #ifndef _RTL_USTRING_HXX_
00055 #include <rtl/ustring.hxx>
00056 #endif
00057 #ifndef _UTL_CONFIGITEM_HXX_
00058 #include <unotools/configitem.hxx>
00059 #endif
00060 #ifndef _SVARRAY_HXX
00061 #include <svtools/svarray.hxx>
00062 #endif
00063 #ifndef _SV_TIMER_HXX
00064 #include <vcl/timer.hxx>
00065 #endif
00066
00067 #include <symbol.hxx>
00068 #include <types.hxx>
00069
00070 using namespace com::sun::star;
00071
00072 class SmSym;
00073 class SmFormat;
00074 class Font;
00075 struct SmCfgOther;
00076
00078
00079
00080 struct SmFontFormat
00081 {
00082 String aName;
00083 INT16 nCharSet;
00084 INT16 nFamily;
00085 INT16 nPitch;
00086 INT16 nWeight;
00087 INT16 nItalic;
00088
00089 SmFontFormat();
00090 SmFontFormat( const Font &rFont );
00091
00092 const Font GetFont() const;
00093 BOOL operator == ( const SmFontFormat &rFntFmt ) const;
00094 };
00095
00096
00097 struct SmFntFmtListEntry
00098 {
00099 String aId;
00100 SmFontFormat aFntFmt;
00101
00102 SmFntFmtListEntry( const String &rId, const SmFontFormat &rFntFmt );
00103 };
00104
00105
00106 SV_DECL_OBJARR( SmFntFmtListEntryArr, SmFntFmtListEntry, 8, 8 )
00107
00108
00109 class SmFontFormatList
00110 {
00111 SmFntFmtListEntryArr aEntries;
00112 BOOL bModified;
00113
00114
00115 SmFontFormatList( const SmFontFormatList & );
00116 SmFontFormatList & operator = ( const SmFontFormatList & );
00117
00118 public:
00119 SmFontFormatList();
00120
00121 void Clear();
00122 void AddFontFormat( const String &rFntFmtId, const SmFontFormat &rFntFmt );
00123 void RemoveFontFormat( const String &rFntFmtId );
00124
00125 const SmFontFormat * GetFontFormat( const String &rFntFmtId ) const;
00126 const SmFontFormat * GetFontFormat( USHORT nPos ) const;
00127 const String GetFontFormatId( const SmFontFormat &rFntFmt ) const;
00128 const String GetFontFormatId( const SmFontFormat &rFntFmt, BOOL bAdd );
00129 const String GetFontFormatId( USHORT nPos ) const;
00130 const String GetNewFontFormatId() const;
00131 USHORT GetCount() const { return aEntries.Count(); }
00132
00133 BOOL IsModified() const { return bModified; }
00134 void SetModified( BOOL bVal ) { bModified = bVal; }
00135 };
00136
00137
00139
00140 class SmMathConfig : public utl::ConfigItem
00141 {
00142 SmFormat * pFormat;
00143 SmCfgOther * pOther;
00144 SmFontFormatList * pFontFormatList;
00145 SmSymSetManager * pSymSetMgr;
00146 BOOL bIsOtherModified;
00147 BOOL bIsFormatModified;
00148
00149
00150 SmMathConfig( const SmMathConfig & );
00151 SmMathConfig & operator = ( const SmMathConfig & );
00152
00153
00154 void StripFontFormatList( const std::vector< SmSym > &rSymbols );
00155
00156
00157 void Save();
00158
00159 void ReadSymbol( SmSym &rSymbol,
00160 const rtl::OUString &rSymbolName,
00161 const rtl::OUString &rBaseNode ) const;
00162 void ReadFontFormat( SmFontFormat &rFontFormat,
00163 const rtl::OUString &rSymbolName,
00164 const rtl::OUString &rBaseNode ) const;
00165
00166 void SetOtherIfNotEqual( BOOL &rbItem, BOOL bNewVal );
00167
00168 protected:
00169 void LoadOther();
00170 void SaveOther();
00171 void LoadFormat();
00172 void SaveFormat();
00173 void LoadFontFormatList();
00174 void SaveFontFormatList();
00175
00176 void SetOtherModified( BOOL bVal );
00177 inline BOOL IsOtherModified() const { return bIsOtherModified; }
00178 void SetFormatModified( BOOL bVal );
00179 inline BOOL IsFormatModified() const { return bIsFormatModified; }
00180
00181 SmFontFormatList & GetFontFormatList();
00182 const SmFontFormatList & GetFontFormatList() const
00183 {
00184 return ((SmMathConfig *) this)->GetFontFormatList();
00185 }
00186
00187 public:
00188 SmMathConfig();
00189 virtual ~SmMathConfig();
00190
00191
00192
00193 virtual void Commit();
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203 SmSymSetManager & GetSymSetManager();
00204 void GetSymbols( std::vector< SmSym > &rSymbols ) const;
00205 void SetSymbols( const std::vector< SmSym > &rNewSymbols );
00206 USHORT GetSymbolCount() const;
00207 const SmSym * GetSymbol( USHORT nIndex ) const;
00208
00209 const SmFormat & GetStandardFormat() const;
00210 void SetStandardFormat( const SmFormat &rFormat );
00211
00212 BOOL IsPrintTitle() const;
00213 void SetPrintTitle( BOOL bVal );
00214 BOOL IsPrintFormulaText() const;
00215 void SetPrintFormulaText( BOOL bVal );
00216 BOOL IsPrintFrame() const;
00217 void SetPrintFrame( BOOL bVal );
00218 SmPrintSize GetPrintSize() const;
00219 void SetPrintSize( SmPrintSize eSize );
00220 USHORT GetPrintZoomFactor() const;
00221 void SetPrintZoomFactor( USHORT nVal );
00222
00223 BOOL IsIgnoreSpacesRight() const;
00224 void SetIgnoreSpacesRight( BOOL bVal );
00225 BOOL IsToolboxVisible() const;
00226 void SetToolboxVisible( BOOL bVal );
00227 BOOL IsAutoRedraw() const;
00228 void SetAutoRedraw( BOOL bVal );
00229 BOOL IsShowFormulaCursor() const;
00230 void SetShowFormulaCursor( BOOL bVal );
00231 };
00232
00234
00235 #endif
00236