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/rc.hxx"
28 #include <sfx2/module.hxx>
30 #include "starmath.hrc"
32 #include <unotools/options.hxx>
35 class SfxObjectFactory
;
36 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 \************************************************************************/
55 class SmResId
: public ResId
58 explicit SmResId(sal_uInt16 nId
);
61 #define SM_RESSTR(x) SmResId(x).toString()
63 class SmLocalizedSymbolData
65 ResStringArray aUiSymbolNamesAry
;
66 ResStringArray aExportSymbolNamesAry
;
67 ResStringArray aUiSymbolSetNamesAry
;
68 ResStringArray aExportSymbolSetNamesAry
;
71 SmLocalizedSymbolData();
72 ~SmLocalizedSymbolData();
74 const ResStringArray
& GetUiSymbolNamesArray() const { return aUiSymbolNamesAry
; }
75 const ResStringArray
& GetExportSymbolNamesArray() const { return aExportSymbolNamesAry
; }
76 static const OUString
GetUiSymbolName( const OUString
&rExportName
);
77 static const OUString
GetExportSymbolName( const OUString
&rUiName
);
79 const ResStringArray
& GetUiSymbolSetNamesArray() const { return aUiSymbolSetNamesAry
; }
80 const ResStringArray
& GetExportSymbolSetNamesArray() const { return aExportSymbolSetNamesAry
; }
81 static const OUString
GetUiSymbolSetName( const OUString
&rExportName
);
82 static const OUString
GetExportSymbolSetName( const OUString
&rUiName
);
85 class SmModule
: public SfxModule
, public utl::ConfigurationListener
87 std::unique_ptr
<svtools::ColorConfig
> mpColorConfig
;
88 std::unique_ptr
<SmMathConfig
> mpConfig
;
89 std::unique_ptr
<SmLocalizedSymbolData
> mpLocSymbolData
;
90 std::unique_ptr
<SvtSysLocale
> mpSysLocale
;
91 VclPtr
<VirtualDevice
> mpVirtualDev
;
93 static void ApplyColorConfigValues( const svtools::ColorConfig
&rColorCfg
);
96 SFX_DECL_INTERFACE(SFX_INTERFACE_SMA_START
+ 0)
99 /// SfxInterface initializer.
100 static void InitInterface_Impl();
103 explicit SmModule(SfxObjectFactory
* pObjFact
);
104 virtual ~SmModule() override
;
106 virtual void ConfigurationChanged( utl::ConfigurationBroadcaster
*, ConfigurationHints
) override
;
108 svtools::ColorConfig
& GetColorConfig();
110 SmMathConfig
* GetConfig();
111 SmSymbolManager
& GetSymbolManager();
113 SmLocalizedSymbolData
& GetLocSymbolData();
115 static void GetState(SfxItemSet
&);
117 const SvtSysLocale
& GetSysLocale();
119 VirtualDevice
& GetDefaultVirtualDev();
121 //virtual methods for options dialog
122 virtual SfxItemSet
* CreateItemSet( sal_uInt16 nId
) override
;
123 virtual void ApplyItemSet( sal_uInt16 nId
, const SfxItemSet
& rSet
) override
;
124 virtual VclPtr
<SfxTabPage
> CreateTabPage( sal_uInt16 nId
, vcl::Window
* pParent
, const SfxItemSet
& rSet
) override
;
127 #define SM_MOD() ( static_cast<SmModule*>(SfxApplication::GetModule(SfxToolsModule::Math)) )
129 #endif // INCLUDED_STARMATH_INC_SMMOD_HXX
131 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */