sync master with lastest vba changes
[ooovba.git] / binfilter / inc / bf_starmath / smmod.hxx
blob05228bb428427a5c2ef5fc277773e5996026c1a8
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: smmod.hxx,v $
10 * $Revision: 1.8 $
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 _SMMOD_HXX
32 #define _SMMOD_HXX
34 #ifndef _SV_RESARY_HXX
35 #include <tools/resary.hxx>
36 #endif
37 #ifndef _SFXLSTNER_HXX
38 #include <bf_svtools/lstner.hxx>
39 #endif
40 #ifndef INCLUDED_SVTOOLS_COLORCFG_HXX
41 #include <bf_svtools/colorcfg.hxx>
42 #endif
44 #ifndef _SMDLL_HXX
45 #define _SM_DLL // fuer SD_MOD()
46 #include <bf_starmath/smdll.hxx> // fuer SdModuleDummy
47 #endif
48 #ifndef _STARMATH_HRC
49 #include "starmath.hrc"
50 #endif
51 class VirtualDevice;
53 namespace binfilter {
55 class SvxErrorHandler;
56 class SvtSysLocale;
57 class SvFactory;
60 class SmConfig;
61 class SmModule;
63 /*************************************************************************
65 |* This subclass of <SfxModule> (which is a subclass of <SfxShell>) is
66 |* linked to the DLL. One instance of this class exists while the DLL is
67 |* loaded.
69 |* SdModule is like to be compared with the <SfxApplication>-subclass.
71 |* Remember: Don`t export this class! It uses DLL-internal symbols.
73 \************************************************************************/
75 class SmRectCache;
77 /////////////////////////////////////////////////////////////////
79 /*N*/ class SmNamesArray : public Resource
80 /*N*/ {
81 /*N*/ ResStringArray aNamesAry;
82 /*N*/ LanguageType nLanguage;
83 /*N*/
84 /*N*/ public:
85 /*N*/ SmNamesArray( LanguageType nLang, int nRID ) :
86 /*N*/ Resource( SmResId(RID_LOCALIZED_NAMES) ),
87 /*N*/ nLanguage (nLang),
88 /*N*/ aNamesAry (SmResId(nRID))
89 /*N*/ {
90 /*N*/ FreeResource();
91 /*N*/ }
92 /*N*/
93 /*N*/ LanguageType GetLanguage() const { return nLanguage; }
94 /*N*/ const ResStringArray& GetNamesArray() const { return aNamesAry; }
95 /*N*/ };
97 /////////////////////////////////////////////////////////////////
99 class SmLocalizedSymbolData : public Resource
101 ResStringArray aUiSymbolNamesAry;
102 ResStringArray aExportSymbolNamesAry;
103 ResStringArray aUiSymbolSetNamesAry;
104 ResStringArray aExportSymbolSetNamesAry;
105 SmNamesArray *p50NamesAry;
106 SmNamesArray *p60NamesAry;
107 LanguageType n50NamesLang;
108 LanguageType n60NamesLang;
110 public:
111 SmLocalizedSymbolData();
112 ~SmLocalizedSymbolData();
114 const ResStringArray& GetUiSymbolNamesArray() const { return aUiSymbolNamesAry; }
115 const ResStringArray& GetExportSymbolNamesArray() const { return aExportSymbolNamesAry; }
116 const String GetUiSymbolName( const String &rExportName ) const;
117 const String GetExportSymbolName( const String &rUiName ) const;
119 const ResStringArray& GetUiSymbolSetNamesArray() const { return aUiSymbolSetNamesAry; }
120 const ResStringArray& GetExportSymbolSetNamesArray() const { return aExportSymbolSetNamesAry; }
121 const String GetUiSymbolSetName( const String &rExportName ) const;
123 const ResStringArray* Get50NamesArray( LanguageType nLang );
124 const ResStringArray* Get60NamesArray( LanguageType nLang );
127 /////////////////////////////////////////////////////////////////
129 class SmModule : public SmModuleDummy, public SfxListener
131 ColorConfig *pColorConfig;
132 SmConfig *pConfig;
133 SmLocalizedSymbolData *pLocSymbolData;
134 SmRectCache *pRectCache;
135 SvtSysLocale *pSysLocale;
136 VirtualDevice *pVirtualDev;
138 void _CreateSysLocale() const;
139 void _CreateVirtualDev() const;
141 void ApplyColorConfigValues( const ColorConfig &rColorCfg );
143 public:
144 TYPEINFO();
146 SmModule(SvFactory* pObjFact);
147 virtual ~SmModule();
150 // SfxListener
151 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
153 ColorConfig & GetColorConfig();
155 SmConfig * GetConfig();
156 SmRectCache * GetRectCache() { return pRectCache; }
158 SmLocalizedSymbolData & GetLocSymbolData() const;
160 const SvtSysLocale& GetSysLocale() const
162 if( !pSysLocale )
163 _CreateSysLocale();
164 return *pSysLocale;
167 VirtualDevice & GetDefaultVirtualDev()
169 if (!pVirtualDev)
170 _CreateVirtualDev();
171 return *pVirtualDev;
174 //virtuelle Methoden fuer den Optionendialog
177 #define SM_MOD1() ( *(SmModule**) GetAppData(BF_SHL_SM) )
179 } //namespace binfilter
180 #endif // _SDMOD_HXX