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 .
23 #include <tools/resary.hxx>
24 #include <svl/lstner.hxx>
25 #include <svtools/colorcfg.hxx>
27 #include <tools/shl.hxx>
28 #include <sfx2/module.hxx>
30 #include "starmath.hrc"
32 #include <unotools/options.hxx>
34 class SfxObjectFactory
;
37 class SmSymbolManager
;
39 /*************************************************************************
41 |* This subclass of <SfxModule> (which is a subclass of <SfxShell>) is
42 |* linked to the DLL. One instance of this class exists while the DLL is
45 |* SdModule is like to be compared with the <SfxApplication>-subclass.
47 |* Remember: Don`t export this class! It uses DLL-internal symbols.
49 \************************************************************************/
54 /////////////////////////////////////////////////////////////////
56 class SmResId
: public ResId
59 SmResId(sal_uInt16 nId
);
62 #define SM_RESSTR(x) SmResId(x).toString()
64 class SmNamesArray
: public Resource
66 ResStringArray aNamesAry
;
67 LanguageType nLanguage
;
70 SmNamesArray( LanguageType nLang
, int nRID
) :
71 Resource( SmResId(RID_LOCALIZED_NAMES
) ),
72 aNamesAry (SmResId( static_cast < sal_uInt16
> ( nRID
))),
78 LanguageType
GetLanguage() const { return nLanguage
; }
79 const ResStringArray
& GetNamesArray() const { return aNamesAry
; }
82 /////////////////////////////////////////////////////////////////
84 class SmLocalizedSymbolData
: public Resource
86 ResStringArray aUiSymbolNamesAry
;
87 ResStringArray aExportSymbolNamesAry
;
88 ResStringArray aUiSymbolSetNamesAry
;
89 ResStringArray aExportSymbolSetNamesAry
;
90 SmNamesArray
*p50NamesAry
;
91 SmNamesArray
*p60NamesAry
;
92 LanguageType n50NamesLang
;
93 LanguageType n60NamesLang
;
96 SmLocalizedSymbolData();
97 ~SmLocalizedSymbolData();
99 const ResStringArray
& GetUiSymbolNamesArray() const { return aUiSymbolNamesAry
; }
100 const ResStringArray
& GetExportSymbolNamesArray() const { return aExportSymbolNamesAry
; }
101 const String
GetUiSymbolName( const String
&rExportName
) const;
102 const String
GetExportSymbolName( const String
&rUiName
) const;
104 const ResStringArray
& GetUiSymbolSetNamesArray() const { return aUiSymbolSetNamesAry
; }
105 const ResStringArray
& GetExportSymbolSetNamesArray() const { return aExportSymbolSetNamesAry
; }
106 const String
GetUiSymbolSetName( const String
&rExportName
) const;
107 const String
GetExportSymbolSetName( const String
&rUiName
) const;
109 const ResStringArray
* Get50NamesArray( LanguageType nLang
);
110 const ResStringArray
* Get60NamesArray( LanguageType nLang
);
113 /////////////////////////////////////////////////////////////////
115 class SmModule
: public SfxModule
, utl::ConfigurationListener
117 svtools::ColorConfig
*pColorConfig
;
119 SmLocalizedSymbolData
*pLocSymbolData
;
120 SvtSysLocale
*pSysLocale
;
121 VirtualDevice
*pVirtualDev
;
123 void _CreateSysLocale() const;
124 void _CreateVirtualDev() const;
126 void ApplyColorConfigValues( const svtools::ColorConfig
&rColorCfg
);
130 SFX_DECL_INTERFACE(SFX_INTERFACE_SMA_START
+ 0)
132 SmModule(SfxObjectFactory
* pObjFact
);
135 virtual void ConfigurationChanged( utl::ConfigurationBroadcaster
*, sal_uInt32
);
137 svtools::ColorConfig
& GetColorConfig();
139 SmConfig
* GetConfig();
140 SmSymbolManager
& GetSymbolManager();
142 SmLocalizedSymbolData
& GetLocSymbolData() const;
144 void GetState(SfxItemSet
&);
146 const SvtSysLocale
& GetSysLocale() const
153 VirtualDevice
& GetDefaultVirtualDev()
160 //virtual methods for options dialog
161 virtual SfxItemSet
* CreateItemSet( sal_uInt16 nId
);
162 virtual void ApplyItemSet( sal_uInt16 nId
, const SfxItemSet
& rSet
);
163 virtual SfxTabPage
* CreateTabPage( sal_uInt16 nId
, Window
* pParent
, const SfxItemSet
& rSet
);
166 #define SM_MOD() ( *(SmModule**) GetAppData(SHL_SM) )
170 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */