Version 6.4.0.0.beta1, tag libreoffice-6.4.0.0.beta1
[LibreOffice.git] / starmath / inc / smmod.hxx
blob3dcbbcfe50b2e32f1fa74cbd39c87ecb8cf0333d
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 INCLUDED_STARMATH_INC_SMMOD_HXX
21 #define INCLUDED_STARMATH_INC_SMMOD_HXX
23 #include <sfx2/module.hxx>
24 #include <sfx2/app.hxx>
26 #include <unotools/options.hxx>
27 #include <memory>
29 namespace svtools { class ColorConfig; }
31 class SfxObjectFactory;
32 class SmSymbolManager;
33 class SmMathConfig;
35 /*************************************************************************
37 |* This subclass of <SfxModule> (which is a subclass of <SfxShell>) is
38 |* linked to the DLL. One instance of this class exists while the DLL is
39 |* loaded.
41 |* SdModule is like to be compared with the <SfxApplication>-subclass.
43 |* Remember: Don`t export this class! It uses DLL-internal symbols.
45 \************************************************************************/
47 class SvtSysLocale;
48 class VirtualDevice;
51 OUString SmResId(const char* pId);
53 class SmLocalizedSymbolData
55 public:
56 SmLocalizedSymbolData() = delete;
58 static OUString GetUiSymbolName( const OUString &rExportName );
59 static OUString GetExportSymbolName( const OUString &rUiName );
61 static OUString GetUiSymbolSetName( const OUString &rExportName );
62 static OUString GetExportSymbolSetName( const OUString &rUiName );
65 class SmModule : public SfxModule, public utl::ConfigurationListener
67 std::unique_ptr<svtools::ColorConfig> mpColorConfig;
68 std::unique_ptr<SmMathConfig> mpConfig;
69 std::unique_ptr<SmLocalizedSymbolData> mpLocSymbolData;
70 std::unique_ptr<SvtSysLocale> mpSysLocale;
71 VclPtr<VirtualDevice> mpVirtualDev;
73 public:
74 SFX_DECL_INTERFACE(SFX_INTERFACE_SMA_START + SfxInterfaceId(0))
76 private:
77 /// SfxInterface initializer.
78 static void InitInterface_Impl();
80 public:
81 explicit SmModule(SfxObjectFactory* pObjFact);
82 virtual ~SmModule() override;
84 virtual void ConfigurationChanged( utl::ConfigurationBroadcaster*, ConfigurationHints ) override;
86 svtools::ColorConfig & GetColorConfig();
88 SmMathConfig * GetConfig();
89 SmSymbolManager & GetSymbolManager();
91 static void GetState(SfxItemSet&);
93 const SvtSysLocale& GetSysLocale();
95 VirtualDevice & GetDefaultVirtualDev();
97 //virtual methods for options dialog
98 virtual std::unique_ptr<SfxItemSet> CreateItemSet( sal_uInt16 nId ) override;
99 virtual void ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet ) override;
100 virtual std::unique_ptr<SfxTabPage> CreateTabPage( sal_uInt16 nId, weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet ) override;
103 #define SM_MOD() ( static_cast<SmModule*>(SfxApplication::GetModule(SfxToolsModule::Math)) )
105 #endif // INCLUDED_STARMATH_INC_SMMOD_HXX
107 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */