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 .
22 #include <sfx2/module.hxx>
23 #include <sfx2/app.hxx>
24 #include <vcl/vclptr.hxx>
25 #include <unotools/options.hxx>
28 namespace svtools
{ class ColorConfig
; }
30 class SfxObjectFactory
;
31 class SmSymbolManager
;
34 /*************************************************************************
36 |* This subclass of <SfxModule> (which is a subclass of <SfxShell>) is
37 |* linked to the DLL. One instance of this class exists while the DLL is
40 |* SdModule is like to be compared with the <SfxApplication>-subclass.
42 |* Remember: Don`t export this class! It uses DLL-internal symbols.
44 \************************************************************************/
50 OUString
SmResId(TranslateId aId
);
52 namespace SmLocalizedSymbolData
54 OUString
GetUiSymbolName( std::u16string_view rExportName
);
55 OUString
GetExportSymbolName( std::u16string_view rUiName
);
57 OUString
GetUiSymbolSetName( std::u16string_view rExportName
);
58 OUString
GetExportSymbolSetName( std::u16string_view rUiName
);
61 class SmModule final
: public SfxModule
, public utl::ConfigurationListener
63 std::unique_ptr
<svtools::ColorConfig
> mpColorConfig
;
64 std::unique_ptr
<SmMathConfig
> mpConfig
;
65 std::optional
<SvtSysLocale
> moSysLocale
;
66 VclPtr
<VirtualDevice
> mpVirtualDev
;
69 SFX_DECL_INTERFACE(SFX_INTERFACE_SMA_START
+ SfxInterfaceId(0))
72 /// SfxInterface initializer.
73 static void InitInterface_Impl();
76 explicit SmModule(SfxObjectFactory
* pObjFact
);
77 virtual ~SmModule() override
;
79 virtual void ConfigurationChanged( utl::ConfigurationBroadcaster
*, ConfigurationHints
) override
;
81 svtools::ColorConfig
& GetColorConfig();
83 SmMathConfig
* GetConfig();
84 SmSymbolManager
& GetSymbolManager();
86 static void GetState(SfxItemSet
&);
88 const SvtSysLocale
& GetSysLocale();
90 VirtualDevice
& GetDefaultVirtualDev();
92 //virtual methods for options dialog
93 virtual std::optional
<SfxItemSet
> CreateItemSet( sal_uInt16 nId
) override
;
94 virtual void ApplyItemSet( sal_uInt16 nId
, const SfxItemSet
& rSet
) override
;
95 virtual std::unique_ptr
<SfxTabPage
> CreateTabPage( sal_uInt16 nId
, weld::Container
* pPage
, weld::DialogController
* pController
, const SfxItemSet
& rSet
) override
;
98 #define SM_MOD() ( static_cast<SmModule*>(SfxApplication::GetModule(SfxToolsModule::Math)) )
100 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */