LibreOffice Module starmath (master) 1
smmod.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#pragma once
21
22#include <sfx2/module.hxx>
23#include <sfx2/app.hxx>
24#include <vcl/vclptr.hxx>
25#include <unotools/options.hxx>
26#include <optional>
27
28namespace svtools { class ColorConfig; }
29
31class SmSymbolManager;
32class SmMathConfig;
33
34/*************************************************************************
35|*
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
38|* loaded.
39|*
40|* SdModule is like to be compared with the <SfxApplication>-subclass.
41|*
42|* Remember: Don`t export this class! It uses DLL-internal symbols.
43|*
44\************************************************************************/
45
46class SvtSysLocale;
47class VirtualDevice;
48
49
50OUString SmResId(TranslateId aId);
51
53{
54 OUString GetUiSymbolName( std::u16string_view rExportName );
55 OUString GetExportSymbolName( std::u16string_view rUiName );
56
57 OUString GetUiSymbolSetName( std::u16string_view rExportName );
58 OUString GetExportSymbolSetName( std::u16string_view rUiName );
59};
60
61class SmModule final : public SfxModule, public utl::ConfigurationListener
62{
63 std::unique_ptr<svtools::ColorConfig> mpColorConfig;
64 std::unique_ptr<SmMathConfig> mpConfig;
65 std::optional<SvtSysLocale> moSysLocale;
67
68public:
69 SFX_DECL_INTERFACE(SFX_INTERFACE_SMA_START + SfxInterfaceId(0))
70
71private:
73 static void InitInterface_Impl();
74
75public:
76 explicit SmModule(SfxObjectFactory* pObjFact);
77 virtual ~SmModule() override;
78
79 virtual void ConfigurationChanged( utl::ConfigurationBroadcaster*, ConfigurationHints ) override;
80
81 svtools::ColorConfig & GetColorConfig();
82
85
86 static void GetState(SfxItemSet&);
87
89
91
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;
96};
97
98#define SM_MOD() ( static_cast<SmModule*>(SfxApplication::GetModule(SfxToolsModule::Math)) )
99
100/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static void InitInterface_Impl()
SfxInterface initializer.
Definition: smmod.cxx:115
virtual std::unique_ptr< SfxTabPage > CreateTabPage(sal_uInt16 nId, weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet) override
Definition: smmod.cxx:229
SmMathConfig * GetConfig()
Definition: smmod.cxx:162
virtual void ConfigurationChanged(utl::ConfigurationBroadcaster *, ConfigurationHints) override
Definition: smmod.cxx:145
VirtualDevice & GetDefaultVirtualDev()
Definition: smmod.cxx:181
virtual void ApplyItemSet(sal_uInt16 nId, const SfxItemSet &rSet) override
Definition: smmod.cxx:221
svtools::ColorConfig & GetColorConfig()
Definition: smmod.cxx:135
std::unique_ptr< SmMathConfig > mpConfig
Definition: smmod.hxx:64
virtual std::optional< SfxItemSet > CreateItemSet(sal_uInt16 nId) override
Definition: smmod.cxx:204
const SvtSysLocale & GetSysLocale()
Definition: smmod.cxx:174
std::optional< SvtSysLocale > moSysLocale
Definition: smmod.hxx:65
VclPtr< VirtualDevice > mpVirtualDev
Definition: smmod.hxx:66
SmSymbolManager & GetSymbolManager()
Definition: smmod.cxx:169
static void GetState(SfxItemSet &)
Definition: smmod.cxx:191
std::unique_ptr< svtools::ColorConfig > mpColorConfig
Definition: smmod.hxx:63
@ ColorConfig
OUString GetExportSymbolSetName(std::u16string_view rUiName)
Definition: smmod.cxx:96
OUString GetExportSymbolName(std::u16string_view rUiName)
Definition: smmod.cxx:63
OUString GetUiSymbolName(std::u16string_view rExportName)
Definition: smmod.cxx:47
OUString GetUiSymbolSetName(std::u16string_view rExportName)
Definition: smmod.cxx:80
ConfigurationHints
#define SFX_DECL_INTERFACE(nId)
OUString SmResId(TranslateId aId)
Definition: smmod.cxx:42