bump product version to 4.1.6.2
[LibreOffice.git] / starmath / inc / smmod.hxx
blobf05c6a52e5c38a3dda4be0b6d2982cd0605b8613
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
20 #ifndef _SMMOD_HXX
21 #define _SMMOD_HXX
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;
35 class SmConfig;
36 class SmModule;
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
43 |* loaded.
45 |* SdModule is like to be compared with the <SfxApplication>-subclass.
47 |* Remember: Don`t export this class! It uses DLL-internal symbols.
49 \************************************************************************/
51 class SvtSysLocale;
52 class VirtualDevice;
54 /////////////////////////////////////////////////////////////////
56 class SmResId : public ResId
58 public:
59 SmResId(sal_uInt16 nId);
62 #define SM_RESSTR(x) SmResId(x).toString()
64 class SmNamesArray : public Resource
66 ResStringArray aNamesAry;
67 LanguageType nLanguage;
69 public:
70 SmNamesArray( LanguageType nLang, int nRID ) :
71 Resource( SmResId(RID_LOCALIZED_NAMES) ),
72 aNamesAry (SmResId( static_cast < sal_uInt16 > ( nRID ))),
73 nLanguage (nLang)
75 FreeResource();
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;
95 public:
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;
118 SmConfig *pConfig;
119 SmLocalizedSymbolData *pLocSymbolData;
120 SvtSysLocale *pSysLocale;
121 VirtualDevice *pVirtualDev;
123 void _CreateSysLocale() const;
124 void _CreateVirtualDev() const;
126 void ApplyColorConfigValues( const svtools::ColorConfig &rColorCfg );
128 public:
129 TYPEINFO();
130 SFX_DECL_INTERFACE(SFX_INTERFACE_SMA_START + 0)
132 SmModule(SfxObjectFactory* pObjFact);
133 virtual ~SmModule();
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
148 if( !pSysLocale )
149 _CreateSysLocale();
150 return *pSysLocale;
153 VirtualDevice & GetDefaultVirtualDev()
155 if (!pVirtualDev)
156 _CreateVirtualDev();
157 return *pVirtualDev;
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) )
168 #endif // _SDMOD_HXX
170 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */