Version 6.1.0.2, tag libreoffice-6.1.0.2
[LibreOffice.git] / sd / source / ui / app / sddll.cxx
blob072702db97d7457e643cd690452cccbda110895b
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 <editeng/eeitem.hxx>
25 #include <editeng/editeng.hxx>
26 #include <svx/svdobj.hxx>
27 #include <unotools/configmgr.hxx>
28 #include <unotools/moduleoptions.hxx>
29 #include <svx/fmobjfac.hxx>
30 #include <svx/objfac3d.hxx>
31 #include <vcl/svapp.hxx>
33 #include <registerinterfaces.hxx>
34 #include <sddll.hxx>
35 #include <app.hrc>
36 #include <AnimationChildWindow.hxx>
37 #include <BezierObjectBar.hxx>
38 #include <diactrl.hxx>
39 #include <DrawDocShell.hxx>
40 #include <FactoryIds.hxx>
41 #include <gluectrl.hxx>
42 #include <GraphicDocShell.hxx>
43 #include <GraphicObjectBar.hxx>
44 #include <GraphicViewShell.hxx>
45 #include <GraphicViewShellBase.hxx>
46 #include <ImpressViewShellBase.hxx>
47 #include <PresentationViewShell.hxx>
48 #include <PresentationViewShellBase.hxx>
49 #include <MediaObjectBar.hxx>
50 #include <NavigatorChildWindow.hxx>
51 #include <OutlineViewShell.hxx>
52 #include <OutlineViewShellBase.hxx>
53 #include <PaneChildWindows.hxx>
54 #include <SpellDialogChildWindow.hxx>
55 #include <SlideSorterViewShell.hxx>
56 #include <SlideSorterViewShellBase.hxx>
57 #include <strmname.h>
58 #include <SdShapeTypes.hxx>
59 #include <TextObjectBar.hxx>
60 #include <tmplctrl.hxx>
62 #include <svx/svxids.hrc>
63 #include <svx/bmpmask.hxx>
64 #include <svx/clipboardctl.hxx>
65 #include <svx/f3dchild.hxx>
66 #include <svx/fillctrl.hxx>
67 #include <svx/fontwork.hxx>
68 #include <svx/formatpaintbrushctrl.hxx>
69 #include <svx/ParaLineSpacingPopup.hxx>
70 #include <svx/TextCharacterSpacingPopup.hxx>
71 #include <svx/TextUnderlinePopup.hxx>
72 #include <svx/grafctrl.hxx>
73 #include <svx/hyperdlg.hxx>
74 #include <svx/imapdlg.hxx>
75 #include <svx/layctrl.hxx>
76 #include <svx/lboxctrl.hxx>
77 #include <svx/linectrl.hxx>
78 #include <svx/modctrl.hxx>
79 #include <svx/pszctrl.hxx>
80 #include <svx/srchdlg.hxx>
81 #include <svx/SvxColorChildWindow.hxx>
82 #include <svx/SvxShapeTypes.hxx>
83 #include <svx/tbcontrl.hxx>
84 #include <svx/verttexttbxctrl.hxx>
85 #include <svx/xmlsecctrl.hxx>
86 #include <svx/zoomctrl.hxx>
87 #include <svx/zoomsliderctrl.hxx>
88 #include <svx/tbxctl.hxx>
89 #include <sfx2/docfilt.hxx>
90 #include <sfx2/docfile.hxx>
91 #include <sfx2/fcontnr.hxx>
92 #include <sfx2/emojipopup.hxx>
93 #include <sfx2/charmappopup.hxx>
94 #include <sfx2/sidebar/SidebarChildWindow.hxx>
95 #include <vcl/FilterConfigItem.hxx>
96 #include <o3tl/make_unique.hxx>
97 #include <sdabstdlg.hxx>
99 using namespace ::com::sun::star;
101 // Register all Factories
102 void SdDLL::RegisterFactorys()
104 if (utl::ConfigManager::IsFuzzing() || SvtModuleOptions().IsImpress())
106 ::sd::ImpressViewShellBase::RegisterFactory (
107 ::sd::IMPRESS_FACTORY_ID);
108 ::sd::SlideSorterViewShellBase::RegisterFactory (
109 ::sd::SLIDE_SORTER_FACTORY_ID);
110 ::sd::OutlineViewShellBase::RegisterFactory (
111 ::sd::OUTLINE_FACTORY_ID);
112 ::sd::PresentationViewShellBase::RegisterFactory (
113 ::sd::PRESENTATION_FACTORY_ID);
115 if (!utl::ConfigManager::IsFuzzing() && SvtModuleOptions().IsDraw())
117 ::sd::GraphicViewShellBase::RegisterFactory (::sd::DRAW_FACTORY_ID);
121 // Register all Interfaces
123 void SdDLL::RegisterInterfaces(SdModule* pMod)
125 // Module
126 SdModule::RegisterInterface(pMod);
128 // View shell base.
129 ::sd::ViewShellBase::RegisterInterface(pMod);
131 // DocShells
132 ::sd::DrawDocShell::RegisterInterface(pMod);
133 ::sd::GraphicDocShell::RegisterInterface(pMod);
135 // Impress ViewShells
136 ::sd::DrawViewShell::RegisterInterface(pMod);
137 ::sd::OutlineViewShell::RegisterInterface(pMod);
138 ::sd::PresentationViewShell::RegisterInterface(pMod);
140 // Draw ViewShell
141 ::sd::GraphicViewShell::RegisterInterface(pMod);
143 // Impress ObjectShells
144 ::sd::BezierObjectBar::RegisterInterface(pMod);
145 ::sd::TextObjectBar::RegisterInterface(pMod);
146 ::sd::GraphicObjectBar::RegisterInterface(pMod);
148 // Media ObjectShell
149 ::sd::MediaObjectBar::RegisterInterface(pMod);
151 // Table ObjectShell
152 ::sd::ui::table::RegisterInterfaces(pMod);
154 // View shells for the side panes.
155 ::sd::slidesorter::SlideSorterViewShell::RegisterInterface (pMod);
158 // Register all Controllers
160 void SdDLL::RegisterControllers(SdModule* pMod)
162 SdTbxCtlDiaPages::RegisterControl( SID_PAGES_PER_ROW, pMod );
163 SdTbxCtlGlueEscDir::RegisterControl( SID_GLUE_ESCDIR, pMod );
165 ::sd::AnimationChildWindow::RegisterChildWindow(false, pMod);
166 ::sd::NavigatorChildWindow::RegisterChildWindowContext( static_cast<sal_uInt16>(::sd::DrawViewShell::GetInterfaceId()), pMod );
167 ::sd::NavigatorChildWindow::RegisterChildWindowContext( static_cast<sal_uInt16>(::sd::GraphicViewShell::GetInterfaceId()), pMod );
169 Svx3DChildWindow::RegisterChildWindow(false, pMod);
170 SvxFontWorkChildWindow::RegisterChildWindow(false, pMod);
171 SvxColorChildWindow::RegisterChildWindow(false, pMod, SfxChildWindowFlags::TASK);
172 SvxSearchDialogWrapper::RegisterChildWindow(false, pMod);
173 SvxBmpMaskChildWindow::RegisterChildWindow(false, pMod);
174 SvxIMapDlgChildWindow::RegisterChildWindow(false, pMod);
175 SvxHlinkDlgWrapper::RegisterChildWindow(false, pMod);
176 ::sd::SpellDialogChildWindow::RegisterChildWindow(false, pMod);
177 #if HAVE_FEATURE_AVMEDIA
178 ::avmedia::MediaPlayer::RegisterChildWindow(false, pMod);
179 #endif
180 ::sd::LeftPaneImpressChildWindow::RegisterChildWindow(false, pMod);
181 ::sd::LeftPaneDrawChildWindow::RegisterChildWindow(false, pMod);
182 ::sfx2::sidebar::SidebarChildWindow::RegisterChildWindow(false, pMod);
184 SvxFillToolBoxControl::RegisterControl(0, pMod);
185 SvxLineStyleToolBoxControl::RegisterControl(0, pMod);
186 SvxLineWidthToolBoxControl::RegisterControl(0, pMod);
188 SvxStyleToolBoxControl::RegisterControl(0, pMod);
190 SvxGrafModeToolBoxControl::RegisterControl( SID_ATTR_GRAF_MODE, pMod );
191 SvxGrafRedToolBoxControl::RegisterControl( SID_ATTR_GRAF_RED, pMod );
192 SvxGrafGreenToolBoxControl::RegisterControl( SID_ATTR_GRAF_GREEN, pMod );
193 SvxGrafBlueToolBoxControl::RegisterControl( SID_ATTR_GRAF_BLUE, pMod );
194 SvxGrafLuminanceToolBoxControl::RegisterControl( SID_ATTR_GRAF_LUMINANCE, pMod );
195 SvxGrafContrastToolBoxControl::RegisterControl( SID_ATTR_GRAF_CONTRAST, pMod );
196 SvxGrafGammaToolBoxControl::RegisterControl( SID_ATTR_GRAF_GAMMA, pMod );
197 SvxGrafTransparenceToolBoxControl::RegisterControl( SID_ATTR_GRAF_TRANSPARENCE, pMod );
198 SvxVertTextTbxCtrl::RegisterControl(SID_TEXTDIRECTION_TOP_TO_BOTTOM, pMod);
199 SvxVertTextTbxCtrl::RegisterControl(SID_TEXTDIRECTION_LEFT_TO_RIGHT, pMod);
200 SvxVertTextTbxCtrl::RegisterControl(SID_DRAW_CAPTION_VERTICAL, pMod);
201 SvxVertTextTbxCtrl::RegisterControl(SID_DRAW_FONTWORK_VERTICAL, pMod);
202 SvxVertTextTbxCtrl::RegisterControl(SID_DRAW_TEXT_VERTICAL, pMod);
203 SvxVertTextTbxCtrl::RegisterControl(SID_TEXT_FITTOSIZE_VERTICAL, pMod);
204 SvxCTLTextTbxCtrl::RegisterControl(SID_ATTR_PARA_LEFT_TO_RIGHT, pMod);
205 SvxCTLTextTbxCtrl::RegisterControl(SID_ATTR_PARA_RIGHT_TO_LEFT, pMod);
207 // register StatusBarControls
208 SvxZoomPageStatusBarControl::RegisterControl( SID_ZOOM_ENTIRE_PAGE, pMod );
209 SvxZoomStatusBarControl::RegisterControl( SID_ATTR_ZOOM, pMod );
210 SvxPosSizeStatusBarControl::RegisterControl( SID_ATTR_SIZE, pMod );
211 SvxModifyControl::RegisterControl( SID_DOC_MODIFIED, pMod );
212 SvxZoomSliderControl::RegisterControl( SID_ATTR_ZOOMSLIDER, pMod );
214 // #UndoRedo#
215 SvxUndoRedoControl::RegisterControl( SID_UNDO , pMod );
216 SvxUndoRedoControl::RegisterControl( SID_REDO , pMod );
218 svx::FormatPaintBrushToolBoxControl::RegisterControl(SID_FORMATPAINTBRUSH, pMod );
220 SvxClipBoardControl::RegisterControl( SID_PASTE, pMod );
221 SvxClipBoardControl::RegisterControl( SID_PASTE_UNFORMATTED, pMod );
223 svx::ParaLineSpacingPopup::RegisterControl(SID_ATTR_PARA_LINESPACE, pMod);
224 svx::TextCharacterSpacingPopup::RegisterControl(SID_ATTR_CHAR_KERNING, pMod);
225 svx::TextUnderlinePopup::RegisterControl(SID_ATTR_CHAR_UNDERLINE, pMod);
227 #if HAVE_FEATURE_AVMEDIA
228 ::avmedia::MediaToolBoxControl::RegisterControl( SID_AVMEDIA_TOOLBOX, pMod );
229 #endif
230 XmlSecStatusBarControl::RegisterControl( SID_SIGNATURE, pMod );
231 SdTemplateControl::RegisterControl( SID_STATUS_LAYOUT, pMod );
232 SvxTableToolBoxControl::RegisterControl(SID_INSERT_TABLE, pMod );
233 SvxTbxCtlDraw::RegisterControl(SID_INSERT_DRAW, pMod );
235 EmojiPopup::RegisterControl(SID_EMOJI_CONTROL, pMod );
236 CharmapPopup::RegisterControl(SID_CHARMAP_CONTROL, pMod );
239 void SdDLL::Init()
241 if ( SfxApplication::GetModule(SfxToolsModule::Draw) ) // Module already active
242 return;
244 SfxObjectFactory* pDrawFact = nullptr;
245 SfxObjectFactory* pImpressFact = nullptr;
247 if (utl::ConfigManager::IsFuzzing() || SvtModuleOptions().IsImpress())
248 pImpressFact = &::sd::DrawDocShell::Factory();
250 if (!utl::ConfigManager::IsFuzzing() && SvtModuleOptions().IsDraw())
251 pDrawFact = &::sd::GraphicDocShell::Factory();
253 auto pUniqueModule = o3tl::make_unique<SdModule>(pImpressFact, pDrawFact);
254 SdModule* pModule = pUniqueModule.get();
255 SfxApplication::SetModule(SfxToolsModule::Draw, std::move(pUniqueModule));
257 if (!utl::ConfigManager::IsFuzzing() && SvtModuleOptions().IsImpress())
259 // Register the Impress shape types in order to make the shapes accessible.
260 ::accessibility::RegisterImpressShapeTypes ();
261 ::sd::DrawDocShell::Factory().SetDocumentServiceName( "com.sun.star.presentation.PresentationDocument" );
264 if (!utl::ConfigManager::IsFuzzing() && SvtModuleOptions().IsDraw())
266 ::sd::GraphicDocShell::Factory().SetDocumentServiceName( "com.sun.star.drawing.DrawingDocument" );
269 // register your view-factories here
270 RegisterFactorys();
272 // register your shell-interfaces here
273 RegisterInterfaces(pModule);
275 // register your controllers here
276 RegisterControllers(pModule);
278 // register 3D-object-factory
279 E3dObjFactory();
281 // register css::form::component::Form-Object-Factory
282 FmFormObjFactory();
284 // register your exotic remote controls here
285 #ifdef ENABLE_SDREMOTE
286 if (!utl::ConfigManager::IsFuzzing() && !Application::IsHeadlessModeEnabled())
287 RegisterRemotes();
288 #endif
291 #ifndef DISABLE_DYNLOADING
293 extern "C" SAL_DLLPUBLIC_EXPORT
294 void lok_preload_hook()
296 SdAbstractDialogFactory::Create();
299 #endif
301 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */