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 .
20 #ifndef INCLUDED_STARMATH_INC_SMMOD_HXX
21 #define INCLUDED_STARMATH_INC_SMMOD_HXX
23 #include <tools/resary.hxx>
24 #include <svl/lstner.hxx>
25 #include <svtools/colorcfg.hxx>
27 #include <tools/shl.hxx>
28 #include "tools/rc.hxx"
29 #include <sfx2/module.hxx>
31 #include "starmath.hrc"
33 #include <unotools/options.hxx>
36 class SfxObjectFactory
;
39 class SmSymbolManager
;
41 /*************************************************************************
43 |* This subclass of <SfxModule> (which is a subclass of <SfxShell>) is
44 |* linked to the DLL. One instance of this class exists while the DLL is
47 |* SdModule is like to be compared with the <SfxApplication>-subclass.
49 |* Remember: Don`t export this class! It uses DLL-internal symbols.
51 \************************************************************************/
58 class SmResId
: public ResId
61 SmResId(sal_uInt16 nId
);
64 #define SM_RESSTR(x) SmResId(x).toString()
66 class SmLocalizedSymbolData
: public Resource
68 ResStringArray aUiSymbolNamesAry
;
69 ResStringArray aExportSymbolNamesAry
;
70 ResStringArray aUiSymbolSetNamesAry
;
71 ResStringArray aExportSymbolSetNamesAry
;
74 SmLocalizedSymbolData();
75 ~SmLocalizedSymbolData();
77 const ResStringArray
& GetUiSymbolNamesArray() const { return aUiSymbolNamesAry
; }
78 const ResStringArray
& GetExportSymbolNamesArray() const { return aExportSymbolNamesAry
; }
79 static const OUString
GetUiSymbolName( const OUString
&rExportName
);
80 static const OUString
GetExportSymbolName( const OUString
&rUiName
);
82 const ResStringArray
& GetUiSymbolSetNamesArray() const { return aUiSymbolSetNamesAry
; }
83 const ResStringArray
& GetExportSymbolSetNamesArray() const { return aExportSymbolSetNamesAry
; }
84 static const OUString
GetUiSymbolSetName( const OUString
&rExportName
);
85 static const OUString
GetExportSymbolSetName( const OUString
&rUiName
);
88 class SmModule
: public SfxModule
, utl::ConfigurationListener
90 std::unique_ptr
<svtools::ColorConfig
> mpColorConfig
;
91 std::unique_ptr
<SmConfig
> mpConfig
;
92 std::unique_ptr
<SmLocalizedSymbolData
> mpLocSymbolData
;
93 std::unique_ptr
<SvtSysLocale
> mpSysLocale
;
94 VclPtr
<VirtualDevice
> mpVirtualDev
;
96 static void ApplyColorConfigValues( const svtools::ColorConfig
&rColorCfg
);
100 SFX_DECL_INTERFACE(SFX_INTERFACE_SMA_START
+ 0)
103 /// SfxInterface initializer.
104 static void InitInterface_Impl();
107 SmModule(SfxObjectFactory
* pObjFact
);
110 virtual void ConfigurationChanged( utl::ConfigurationBroadcaster
*, sal_uInt32
) SAL_OVERRIDE
;
112 svtools::ColorConfig
& GetColorConfig();
114 SmConfig
* GetConfig();
115 SmSymbolManager
& GetSymbolManager();
117 SmLocalizedSymbolData
& GetLocSymbolData();
119 static void GetState(SfxItemSet
&);
121 const SvtSysLocale
& GetSysLocale();
123 VirtualDevice
& GetDefaultVirtualDev();
125 //virtual methods for options dialog
126 virtual SfxItemSet
* CreateItemSet( sal_uInt16 nId
) SAL_OVERRIDE
;
127 virtual void ApplyItemSet( sal_uInt16 nId
, const SfxItemSet
& rSet
) SAL_OVERRIDE
;
128 virtual VclPtr
<SfxTabPage
> CreateTabPage( sal_uInt16 nId
, vcl::Window
* pParent
, const SfxItemSet
& rSet
) SAL_OVERRIDE
;
131 #define SM_MOD() ( *reinterpret_cast<SmModule**>(GetAppData(SHL_SM)) )
133 #endif // INCLUDED_STARMATH_INC_SMMOD_HXX
135 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */