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 .
19 #ifndef INCLUDED_SFX2_MODULE_HXX
20 #define INCLUDED_SFX2_MODULE_HXX
22 #include <sal/config.h>
23 #include <sfx2/app.hxx>
24 #include <sfx2/dllapi.h>
25 #include <sfx2/shell.hxx>
26 #include <svtools/imgdef.hxx>
27 #include <sal/types.h>
28 #include <tools/fldunit.hxx>
29 #include <com/sun/star/uno/Reference.hxx>
34 class SfxObjectFactory
;
36 class SfxObjectFactory
;
38 class SfxModuleArr_Impl
;
41 struct SfxChildWinContextFactory
;
42 struct SfxChildWinFactory
;
43 struct SfxStbCtrlFactory
;
44 struct SfxTbxCtrlFactory
;
46 namespace vcl
{ class Window
; }
48 namespace com
{ namespace sun
{ namespace star
{ namespace frame
{
53 class SFX2_DLLPUBLIC SfxModule
: public SfxShell
58 SfxModule_Impl
* pImpl
;
60 SAL_DLLPRIVATE
void Construct_Impl();
63 SFX_DECL_INTERFACE(SFX_INTERFACE_SFXMODULE
)
66 /// SfxInterface initializer.
67 static void InitInterface_Impl() {}
71 SfxModule( ResMgr
* pMgrP
, bool bDummy
,
72 SfxObjectFactory
* pFactoryP
, ... );
76 SfxSlotPool
* GetSlotPool() const;
78 void RegisterToolBoxControl(const SfxTbxCtrlFactory
&);
79 void RegisterChildWindow(SfxChildWinFactory
*);
80 void RegisterStatusBarControl(const SfxStbCtrlFactory
&);
82 virtual VclPtr
<SfxTabPage
> CreateTabPage( sal_uInt16 nId
,
84 const SfxItemSet
& rSet
);
85 virtual void Invalidate(sal_uInt16 nId
= 0) override
;
87 static SfxModule
* GetActiveModule( SfxViewFrame
* pFrame
=nullptr );
88 static FieldUnit
GetCurrentFieldUnit();
89 /** retrieves the field unit of the module belonging to the document displayed in the given frame
91 Effectively, this method looks up the SfxViewFrame belonging to the given XFrame, then the SfxModule belonging to
92 the document in this frame, then this module's field unit.
94 Failures in any of those steps are reported as assertion in non-product builds, and then FUNIT_100TH_MM is returned.
96 static FieldUnit
GetModuleFieldUnit( css::uno::Reference
< css::frame::XFrame
> const & i_frame
);
97 FieldUnit
GetFieldUnit() const;
99 SAL_DLLPRIVATE
static SfxModuleArr_Impl
& GetModules_Impl();
100 SAL_DLLPRIVATE
static void DestroyModules_Impl();
101 SAL_DLLPRIVATE SfxTbxCtrlFactArr_Impl
* GetTbxCtrlFactories_Impl() const;
102 SAL_DLLPRIVATE SfxStbCtrlFactArr_Impl
* GetStbCtrlFactories_Impl() const;
103 SAL_DLLPRIVATE SfxChildWinFactArr_Impl
* GetChildWinFactories_Impl() const;
104 SAL_DLLPRIVATE ImageList
* GetImageList_Impl( bool bBig
);
109 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */