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: smmod.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 ************************************************************************/
34 #ifndef _SV_RESARY_HXX
35 #include <tools/resary.hxx>
37 #include <svtools/lstner.hxx>
38 #include <svtools/colorcfg.hxx>
40 #include <tools/shl.hxx>
41 #include <sfx2/module.hxx>
44 #include "starmath.hrc"
47 class SvxErrorHandler
;
48 class SfxObjectFactory
;
51 class SmSymSetManager
;
53 /*************************************************************************
55 |* This subclass of <SfxModule> (which is a subclass of <SfxShell>) is
56 |* linked to the DLL. One instance of this class exists while the DLL is
59 |* SdModule is like to be compared with the <SfxApplication>-subclass.
61 |* Remember: Don`t export this class! It uses DLL-internal symbols.
63 \************************************************************************/
68 /////////////////////////////////////////////////////////////////
70 class SmResId
: public ResId
76 class SmNamesArray
: public Resource
78 ResStringArray aNamesAry
;
79 LanguageType nLanguage
;
82 SmNamesArray( LanguageType nLang
, int nRID
) :
83 Resource( SmResId(RID_LOCALIZED_NAMES
) ),
84 aNamesAry (SmResId( static_cast < USHORT
> ( nRID
))),
90 LanguageType
GetLanguage() const { return nLanguage
; }
91 const ResStringArray
& GetNamesArray() const { return aNamesAry
; }
94 /////////////////////////////////////////////////////////////////
96 class SmLocalizedSymbolData
: public Resource
98 ResStringArray aUiSymbolNamesAry
;
99 ResStringArray aExportSymbolNamesAry
;
100 ResStringArray aUiSymbolSetNamesAry
;
101 ResStringArray aExportSymbolSetNamesAry
;
102 SmNamesArray
*p50NamesAry
;
103 SmNamesArray
*p60NamesAry
;
104 LanguageType n50NamesLang
;
105 LanguageType n60NamesLang
;
108 SmLocalizedSymbolData();
109 ~SmLocalizedSymbolData();
111 const ResStringArray
& GetUiSymbolNamesArray() const { return aUiSymbolNamesAry
; }
112 const ResStringArray
& GetExportSymbolNamesArray() const { return aExportSymbolNamesAry
; }
113 const String
GetUiSymbolName( const String
&rExportName
) const;
114 const String
GetExportSymbolName( const String
&rUiName
) const;
116 const ResStringArray
& GetUiSymbolSetNamesArray() const { return aUiSymbolSetNamesAry
; }
117 const ResStringArray
& GetExportSymbolSetNamesArray() const { return aExportSymbolSetNamesAry
; }
118 const String
GetUiSymbolSetName( const String
&rExportName
) const;
119 const String
GetExportSymbolSetName( const String
&rUiName
) const;
121 const ResStringArray
* Get50NamesArray( LanguageType nLang
);
122 const ResStringArray
* Get60NamesArray( LanguageType nLang
);
125 /////////////////////////////////////////////////////////////////
127 class SmModule
: public SfxModule
, public SfxListener
129 svtools::ColorConfig
*pColorConfig
;
131 SmLocalizedSymbolData
*pLocSymbolData
;
132 SvtSysLocale
*pSysLocale
;
133 VirtualDevice
*pVirtualDev
;
135 virtual void FillStatusBar(StatusBar
&rBar
);
136 void _CreateSysLocale() const;
137 void _CreateVirtualDev() const;
139 void ApplyColorConfigValues( const svtools::ColorConfig
&rColorCfg
);
143 SFX_DECL_INTERFACE(SFX_INTERFACE_SMA_START
+ 0)
145 SmModule(SfxObjectFactory
* pObjFact
);
149 virtual void Notify( SfxBroadcaster
& rBC
, const SfxHint
& rHint
);
151 svtools::ColorConfig
& GetColorConfig();
153 SmConfig
* GetConfig();
154 SmSymSetManager
& GetSymSetManager();
156 SmLocalizedSymbolData
& GetLocSymbolData() const;
158 void GetState(SfxItemSet
&);
160 const SvtSysLocale
& GetSysLocale() const
167 VirtualDevice
& GetDefaultVirtualDev()
174 //virtuelle Methoden fuer den Optionendialog
175 virtual SfxItemSet
* CreateItemSet( USHORT nId
);
176 virtual void ApplyItemSet( USHORT nId
, const SfxItemSet
& rSet
);
177 virtual SfxTabPage
* CreateTabPage( USHORT nId
, Window
* pParent
, const SfxItemSet
& rSet
);
180 #define SM_MOD() ( *(SmModule**) GetAppData(SHL_SM) )
181 #define SM_MOD1() ( *(SmModule**) GetAppData(SHL_SM) )