Bump version to 21.06.18.1
[LibreOffice.git] / sd / source / ui / app / sddll.cxx
blob1ca34749d669c282272153f5a5d14aa14827cc92
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 #include <config_features.h>
22 #include <avmedia/mediaplayer.hxx>
23 #include <avmedia/mediatoolbox.hxx>
24 #include <unotools/configmgr.hxx>
25 #include <unotools/moduleoptions.hxx>
26 #include <svx/fmobjfac.hxx>
27 #include <svx/objfac3d.hxx>
28 #include <vcl/svapp.hxx>
30 #include <registerinterfaces.hxx>
31 #include <sddll.hxx>
32 #include <app.hrc>
33 #include <AnimationChildWindow.hxx>
34 #include <BezierObjectBar.hxx>
35 #include <diactrl.hxx>
36 #include <DrawDocShell.hxx>
37 #include <FactoryIds.hxx>
38 #include <gluectrl.hxx>
39 #include <GraphicDocShell.hxx>
40 #include <GraphicObjectBar.hxx>
41 #include <GraphicViewShell.hxx>
42 #include <GraphicViewShellBase.hxx>
43 #include <ImpressViewShellBase.hxx>
44 #include <PresentationViewShell.hxx>
45 #include <PresentationViewShellBase.hxx>
46 #include <MediaObjectBar.hxx>
47 #include <NavigatorChildWindow.hxx>
48 #include <OutlineViewShell.hxx>
49 #include <OutlineViewShellBase.hxx>
50 #include <PaneChildWindows.hxx>
51 #include <SpellDialogChildWindow.hxx>
52 #include <SlideSorterViewShell.hxx>
53 #include <SlideSorterViewShellBase.hxx>
54 #include <SdShapeTypes.hxx>
55 #include <TextObjectBar.hxx>
56 #include <tmplctrl.hxx>
58 #include <svx/svxids.hrc>
59 #include <svx/bmpmask.hxx>
60 #include <svx/clipboardctl.hxx>
61 #include <svx/f3dchild.hxx>
62 #include <svx/fillctrl.hxx>
63 #include <svx/fontwork.hxx>
64 #include <svx/formatpaintbrushctrl.hxx>
65 #include <svx/ParaLineSpacingPopup.hxx>
66 #include <svx/TextCharacterSpacingPopup.hxx>
67 #include <svx/TextUnderlinePopup.hxx>
68 #include <svx/grafctrl.hxx>
69 #include <svx/hyperdlg.hxx>
70 #include <svx/imapdlg.hxx>
71 #include <svx/layctrl.hxx>
72 #include <svx/lboxctrl.hxx>
73 #include <svx/linectrl.hxx>
74 #include <svx/modctrl.hxx>
75 #include <svx/pszctrl.hxx>
76 #include <svx/srchdlg.hxx>
77 #include <svx/SvxColorChildWindow.hxx>
78 #include <svx/tbcontrl.hxx>
79 #include <svx/verttexttbxctrl.hxx>
80 #include <svx/xmlsecctrl.hxx>
81 #include <svx/zoomctrl.hxx>
82 #include <svx/zoomsliderctrl.hxx>
83 #include <svx/tbxctl.hxx>
84 #include <sfx2/emojipopup.hxx>
85 #include <sfx2/charmappopup.hxx>
86 #include <sfx2/sidebar/SidebarChildWindow.hxx>
87 #include <comphelper/lok.hxx>
88 #include <sdabstdlg.hxx>
89 #include <sdfilter.hxx>
90 #include <sdmod.hxx>
92 using namespace ::com::sun::star;
94 // Register all Factories
95 void SdDLL::RegisterFactorys()
97 if (utl::ConfigManager::IsFuzzing() || SvtModuleOptions().IsImpress())
99 ::sd::ImpressViewShellBase::RegisterFactory (
100 ::sd::IMPRESS_FACTORY_ID);
101 ::sd::SlideSorterViewShellBase::RegisterFactory (
102 ::sd::SLIDE_SORTER_FACTORY_ID);
103 ::sd::OutlineViewShellBase::RegisterFactory (
104 ::sd::OUTLINE_FACTORY_ID);
105 ::sd::PresentationViewShellBase::RegisterFactory (
106 ::sd::PRESENTATION_FACTORY_ID);
108 if (!utl::ConfigManager::IsFuzzing() && SvtModuleOptions().IsDraw())
110 ::sd::GraphicViewShellBase::RegisterFactory (::sd::DRAW_FACTORY_ID);
114 // Register all Interfaces
116 void SdDLL::RegisterInterfaces(const SdModule* pMod)
118 // Module
119 SdModule::RegisterInterface(pMod);
121 // View shell base.
122 ::sd::ViewShellBase::RegisterInterface(pMod);
124 // DocShells
125 ::sd::DrawDocShell::RegisterInterface(pMod);
126 ::sd::GraphicDocShell::RegisterInterface(pMod);
128 // Impress ViewShells
129 ::sd::DrawViewShell::RegisterInterface(pMod);
130 ::sd::OutlineViewShell::RegisterInterface(pMod);
131 ::sd::PresentationViewShell::RegisterInterface(pMod);
133 // Draw ViewShell
134 ::sd::GraphicViewShell::RegisterInterface(pMod);
136 // Impress ObjectShells
137 ::sd::BezierObjectBar::RegisterInterface(pMod);
138 ::sd::TextObjectBar::RegisterInterface(pMod);
139 ::sd::GraphicObjectBar::RegisterInterface(pMod);
141 // Media ObjectShell
142 ::sd::MediaObjectBar::RegisterInterface(pMod);
144 // Table ObjectShell
145 ::sd::ui::table::RegisterInterfaces(pMod);
147 // View shells for the side panes.
148 ::sd::slidesorter::SlideSorterViewShell::RegisterInterface (pMod);
151 // Register all Controllers
153 void SdDLL::RegisterControllers(SdModule* pMod)
155 SdTbxCtlDiaPages::RegisterControl( SID_PAGES_PER_ROW, pMod );
156 SdTbxCtlGlueEscDir::RegisterControl( SID_GLUE_ESCDIR, pMod );
158 ::sd::AnimationChildWindow::RegisterChildWindow(false, pMod);
160 Svx3DChildWindow::RegisterChildWindow(false, pMod);
161 SvxFontWorkChildWindow::RegisterChildWindow(false, pMod);
162 SvxColorChildWindow::RegisterChildWindow(false, pMod, SfxChildWindowFlags::TASK);
163 SvxSearchDialogWrapper::RegisterChildWindow(false, pMod);
164 SvxBmpMaskChildWindow::RegisterChildWindow(false, pMod);
165 SvxIMapDlgChildWindow::RegisterChildWindow(false, pMod);
166 SvxHlinkDlgWrapper::RegisterChildWindow(false, pMod);
167 ::sd::SpellDialogChildWindow::RegisterChildWindow(
168 false, pMod, comphelper::LibreOfficeKit::isActive() ? SfxChildWindowFlags::NEVERCLONE
169 : SfxChildWindowFlags::NONE);
170 #if HAVE_FEATURE_AVMEDIA
171 ::avmedia::MediaPlayer::RegisterChildWindow(false, pMod);
172 #endif
173 ::sd::LeftPaneImpressChildWindow::RegisterChildWindow(false, pMod);
174 ::sd::LeftPaneDrawChildWindow::RegisterChildWindow(false, pMod);
175 ::sfx2::sidebar::SidebarChildWindow::RegisterChildWindow(false, pMod);
177 ::sd::SdNavigatorWrapper::RegisterChildWindow(false, pMod, SfxChildWindowFlags::NEVERHIDE);
179 SvxFillToolBoxControl::RegisterControl(0, pMod);
180 SvxLineWidthToolBoxControl::RegisterControl(0, pMod);
182 SvxGrafModeToolBoxControl::RegisterControl( SID_ATTR_GRAF_MODE, pMod );
183 SvxGrafRedToolBoxControl::RegisterControl( SID_ATTR_GRAF_RED, pMod );
184 SvxGrafGreenToolBoxControl::RegisterControl( SID_ATTR_GRAF_GREEN, pMod );
185 SvxGrafBlueToolBoxControl::RegisterControl( SID_ATTR_GRAF_BLUE, pMod );
186 SvxGrafLuminanceToolBoxControl::RegisterControl( SID_ATTR_GRAF_LUMINANCE, pMod );
187 SvxGrafContrastToolBoxControl::RegisterControl( SID_ATTR_GRAF_CONTRAST, pMod );
188 SvxGrafGammaToolBoxControl::RegisterControl( SID_ATTR_GRAF_GAMMA, pMod );
189 SvxGrafTransparenceToolBoxControl::RegisterControl( SID_ATTR_GRAF_TRANSPARENCE, pMod );
191 // register StatusBarControls
192 SvxZoomPageStatusBarControl::RegisterControl( SID_ZOOM_ENTIRE_PAGE, pMod );
193 SvxZoomStatusBarControl::RegisterControl( SID_ATTR_ZOOM, pMod );
194 SvxPosSizeStatusBarControl::RegisterControl( SID_ATTR_SIZE, pMod );
195 SvxModifyControl::RegisterControl( SID_DOC_MODIFIED, pMod );
196 SvxZoomSliderControl::RegisterControl( SID_ATTR_ZOOMSLIDER, pMod );
198 svx::FormatPaintBrushToolBoxControl::RegisterControl(SID_FORMATPAINTBRUSH, pMod );
200 SvxClipBoardControl::RegisterControl( SID_PASTE, pMod );
201 SvxClipBoardControl::RegisterControl( SID_PASTE_UNFORMATTED, pMod );
203 #if HAVE_FEATURE_AVMEDIA
204 ::avmedia::MediaToolBoxControl::RegisterControl( SID_AVMEDIA_TOOLBOX, pMod );
205 #endif
206 XmlSecStatusBarControl::RegisterControl( SID_SIGNATURE, pMod );
207 SdTemplateControl::RegisterControl( SID_STATUS_LAYOUT, pMod );
208 SvxTbxCtlDraw::RegisterControl(SID_INSERT_DRAW, pMod );
211 void SdDLL::Init()
213 if ( SfxApplication::GetModule(SfxToolsModule::Draw) ) // Module already active
214 return;
216 SfxObjectFactory* pDrawFact = nullptr;
217 SfxObjectFactory* pImpressFact = nullptr;
219 if (utl::ConfigManager::IsFuzzing() || SvtModuleOptions().IsImpress())
220 pImpressFact = &::sd::DrawDocShell::Factory();
222 if (!utl::ConfigManager::IsFuzzing() && SvtModuleOptions().IsDraw())
223 pDrawFact = &::sd::GraphicDocShell::Factory();
225 auto pUniqueModule = std::make_unique<SdModule>(pImpressFact, pDrawFact);
226 SdModule* pModule = pUniqueModule.get();
227 SfxApplication::SetModule(SfxToolsModule::Draw, std::move(pUniqueModule));
229 if (!utl::ConfigManager::IsFuzzing() && SvtModuleOptions().IsImpress())
231 // Register the Impress shape types in order to make the shapes accessible.
232 ::accessibility::RegisterImpressShapeTypes ();
233 ::sd::DrawDocShell::Factory().SetDocumentServiceName( "com.sun.star.presentation.PresentationDocument" );
236 if (!utl::ConfigManager::IsFuzzing() && SvtModuleOptions().IsDraw())
238 ::sd::GraphicDocShell::Factory().SetDocumentServiceName( "com.sun.star.drawing.DrawingDocument" );
241 // register your view-factories here
242 RegisterFactorys();
244 // register your shell-interfaces here
245 RegisterInterfaces(pModule);
247 // register your controllers here
248 RegisterControllers(pModule);
250 // register 3D-object-factory
251 E3dObjFactory();
253 // register css::form::component::Form-Object-Factory
254 FmFormObjFactory();
256 // register your exotic remote controls here
257 #ifdef ENABLE_SDREMOTE
258 if (!utl::ConfigManager::IsFuzzing() && !Application::IsHeadlessModeEnabled())
259 RegisterRemotes();
260 #endif
263 #ifndef DISABLE_DYNLOADING
265 extern "C" SAL_DLLPUBLIC_EXPORT
266 void lok_preload_hook()
268 SdFilter::Preload();
269 SdAbstractDialogFactory::Create();
272 #endif
274 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */