LibreOffice Module sfx2 (master) 1
module.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#ifndef INCLUDED_SFX2_MODULE_HXX
20#define INCLUDED_SFX2_MODULE_HXX
21
22#include <memory>
23#include <optional>
24#include <sal/config.h>
25#include <sfx2/dllapi.h>
26#include <sfx2/shell.hxx>
27#include <sfx2/styfitem.hxx>
28#include <sal/types.h>
29#include <tools/fldunit.hxx>
30#include <com/sun/star/uno/Reference.hxx>
31
33class SfxModule_Impl;
34class SfxSlotPool;
38class SfxTabPage;
39
40namespace com::sun::star::frame {
41 class XFrame;
42}
43
44namespace weld {
45 class Container;
46 class DialogController;
47}
48
50{
51private:
52 // Warning this cannot be turned into a unique_ptr.
53 // SfxInterface destruction in the SfxSlotPool refers again to pImpl after deletion of pImpl has commenced. See tdf#100270
55
56 SAL_DLLPRIVATE void Construct_Impl(const OString& rResName);
57
58public:
60
61private:
63 static void InitInterface_Impl() {}
64
65public:
66
67 SfxModule(const OString& rResName, std::initializer_list<SfxObjectFactory*> pFactoryList);
68 virtual ~SfxModule() override;
69
70 std::locale GetResLocale() const;
71 SfxSlotPool* GetSlotPool() const;
72
73 void RegisterToolBoxControl(const SfxTbxCtrlFactory&);
74 void RegisterChildWindow(const SfxChildWinFactory&);
75 void RegisterStatusBarControl(const SfxStbCtrlFactory&);
76
77 virtual std::unique_ptr<SfxTabPage> CreateTabPage( sal_uInt16 nId,
78 weld::Container* pPage, weld::DialogController* pController,
79 const SfxItemSet& rSet );
80 virtual void Invalidate(sal_uInt16 nId = 0) override;
81
82 virtual std::optional<SfxStyleFamilies> CreateStyleFamilies() { return {}; }
83
84 static SfxModule* GetActiveModule( SfxViewFrame* pFrame=nullptr );
85 static FieldUnit GetCurrentFieldUnit();
93 static FieldUnit GetModuleFieldUnit( css::uno::Reference< css::frame::XFrame > const & i_frame );
94 FieldUnit GetFieldUnit() const;
95
96 SAL_DLLPRIVATE SfxTbxCtrlFactory* GetTbxCtrlFactory(const std::type_info& rSlotType, sal_uInt16 nSlotID) const;
97 SAL_DLLPRIVATE SfxStbCtrlFactory* GetStbCtrlFactory(const std::type_info& rSlotType, sal_uInt16 nSlotID) const;
98 SAL_DLLPRIVATE SfxChildWinFactory* GetChildWinFactoryById(sal_uInt16 nId) const;
99};
100
101#endif
102
103/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static void InitInterface_Impl()
SfxInterface initializer.
Definition: module.hxx:63
SfxModule_Impl * pImpl
Definition: module.hxx:54
virtual std::optional< SfxStyleFamilies > CreateStyleFamilies()
Definition: module.hxx:82
The class SfxShell is the base class for all classes, which provide the functionality of the form <Sl...
Definition: shell.hxx:128
virtual void Invalidate(sal_uInt16 nId=0)
With this method can the slots of the subclasses be invalidated through the slot Id or alternatively ...
Definition: shell.cxx:235
SVXCORE_DLLPUBLIC FieldUnit GetModuleFieldUnit(const SfxItemSet &)
#define SFX2_DLLPUBLIC
Definition: dllapi.h:29
FieldUnit
static SfxItemSet & rSet
Definition: shell.cxx:534
constexpr auto SFX_INTERFACE_SFXMODULE
Definition: shell.hxx:65
#define SFX_DECL_INTERFACE(nId)
Definition: shell.hxx:532
std::unique_ptr< SfxTabPage >(* CreateTabPage)(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
Definition: tabdlg.hxx:39