android: Update app-specific/MIME type icons
[LibreOffice.git] / sd / source / ui / app / sddll.cxx
blobc195869b790e03f015841e073e66a38538014d87
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>
57 #include <scalectrl.hxx>
59 #include <svx/svxids.hrc>
60 #include <svx/bmpmask.hxx>
61 #include <svx/clipboardctl.hxx>
62 #include <svx/f3dchild.hxx>
63 #include <svx/fillctrl.hxx>
64 #include <svx/fontwork.hxx>
65 #include <svx/formatpaintbrushctrl.hxx>
66 #include <svx/grafctrl.hxx>
67 #include <svx/hyperdlg.hxx>
68 #include <svx/imapdlg.hxx>
69 #include <svx/linectrl.hxx>
70 #include <svx/modctrl.hxx>
71 #include <svx/pszctrl.hxx>
72 #include <svx/srchdlg.hxx>
73 #include <svx/SvxColorChildWindow.hxx>
74 #include <svx/xmlsecctrl.hxx>
75 #include <svx/zoomctrl.hxx>
76 #include <svx/zoomsliderctrl.hxx>
77 #include <svx/tbxctl.hxx>
78 #include <sfx2/sidebar/SidebarChildWindow.hxx>
79 #include <sfx2/devtools/DevelopmentToolChildWindow.hxx>
80 #include <comphelper/lok.hxx>
81 #include <sdabstdlg.hxx>
82 #include <sdfilter.hxx>
83 #include <sdmod.hxx>
85 using namespace ::com::sun::star;
87 // Register all Factories
88 void SdDLL::RegisterFactorys()
90 if (utl::ConfigManager::IsFuzzing() || SvtModuleOptions().IsImpress())
92 ::sd::ImpressViewShellBase::RegisterFactory (
93 ::sd::IMPRESS_FACTORY_ID);
94 ::sd::SlideSorterViewShellBase::RegisterFactory (
95 ::sd::SLIDE_SORTER_FACTORY_ID);
96 ::sd::OutlineViewShellBase::RegisterFactory (
97 ::sd::OUTLINE_FACTORY_ID);
98 ::sd::PresentationViewShellBase::RegisterFactory (
99 ::sd::PRESENTATION_FACTORY_ID);
101 if (!utl::ConfigManager::IsFuzzing() && SvtModuleOptions().IsDraw())
103 ::sd::GraphicViewShellBase::RegisterFactory (::sd::DRAW_FACTORY_ID);
107 // Register all Interfaces
109 void SdDLL::RegisterInterfaces(const SdModule* pMod)
111 // Module
112 SdModule::RegisterInterface(pMod);
114 // View shell base.
115 ::sd::ViewShellBase::RegisterInterface(pMod);
117 // DocShells
118 ::sd::DrawDocShell::RegisterInterface(pMod);
119 ::sd::GraphicDocShell::RegisterInterface(pMod);
121 // Impress ViewShells
122 ::sd::DrawViewShell::RegisterInterface(pMod);
123 ::sd::OutlineViewShell::RegisterInterface(pMod);
124 ::sd::PresentationViewShell::RegisterInterface(pMod);
126 // Draw ViewShell
127 ::sd::GraphicViewShell::RegisterInterface(pMod);
129 // Impress ObjectShells
130 ::sd::BezierObjectBar::RegisterInterface(pMod);
131 ::sd::TextObjectBar::RegisterInterface(pMod);
132 ::sd::GraphicObjectBar::RegisterInterface(pMod);
134 // Media ObjectShell
135 ::sd::MediaObjectBar::RegisterInterface(pMod);
137 // Table ObjectShell
138 ::sd::ui::table::RegisterInterfaces(pMod);
140 // View shells for the side panes.
141 ::sd::slidesorter::SlideSorterViewShell::RegisterInterface (pMod);
144 // Register all Controllers
146 void SdDLL::RegisterControllers(SdModule* pMod)
148 SdTbxCtlDiaPages::RegisterControl( SID_PAGES_PER_ROW, pMod );
149 SdTbxCtlGlueEscDir::RegisterControl( SID_GLUE_ESCDIR, pMod );
151 ::sd::AnimationChildWindow::RegisterChildWindow(false, pMod);
153 Svx3DChildWindow::RegisterChildWindow(false, pMod);
154 SvxFontWorkChildWindow::RegisterChildWindow(false, pMod);
155 SvxColorChildWindow::RegisterChildWindow(false, pMod, SfxChildWindowFlags::TASK);
156 SvxSearchDialogWrapper::RegisterChildWindow(false, pMod);
157 SvxBmpMaskChildWindow::RegisterChildWindow(false, pMod);
158 SvxIMapDlgChildWindow::RegisterChildWindow(false, pMod);
159 SvxHlinkDlgWrapper::RegisterChildWindow(false, pMod);
160 ::sd::SpellDialogChildWindow::RegisterChildWindow(
161 false, pMod, comphelper::LibreOfficeKit::isActive() ? SfxChildWindowFlags::NEVERCLONE
162 : SfxChildWindowFlags::NONE);
163 #if HAVE_FEATURE_AVMEDIA
164 ::avmedia::MediaPlayer::RegisterChildWindow(false, pMod);
165 #endif
166 ::sd::LeftPaneImpressChildWindow::RegisterChildWindow(false, pMod);
167 ::sd::LeftPaneDrawChildWindow::RegisterChildWindow(false, pMod);
168 ::sfx2::sidebar::SidebarChildWindow::RegisterChildWindow(false, pMod);
169 DevelopmentToolChildWindow::RegisterChildWindow(false, pMod);
171 ::sd::SdNavigatorWrapper::RegisterChildWindow(false, pMod, SfxChildWindowFlags::NEVERHIDE);
173 SvxFillToolBoxControl::RegisterControl(0, pMod);
174 SvxLineWidthToolBoxControl::RegisterControl(0, pMod);
176 SvxGrafModeToolBoxControl::RegisterControl( SID_ATTR_GRAF_MODE, pMod );
177 SvxGrafRedToolBoxControl::RegisterControl( SID_ATTR_GRAF_RED, pMod );
178 SvxGrafGreenToolBoxControl::RegisterControl( SID_ATTR_GRAF_GREEN, pMod );
179 SvxGrafBlueToolBoxControl::RegisterControl( SID_ATTR_GRAF_BLUE, pMod );
180 SvxGrafLuminanceToolBoxControl::RegisterControl( SID_ATTR_GRAF_LUMINANCE, pMod );
181 SvxGrafContrastToolBoxControl::RegisterControl( SID_ATTR_GRAF_CONTRAST, pMod );
182 SvxGrafGammaToolBoxControl::RegisterControl( SID_ATTR_GRAF_GAMMA, pMod );
183 SvxGrafTransparenceToolBoxControl::RegisterControl( SID_ATTR_GRAF_TRANSPARENCE, pMod );
185 // register StatusBarControls
186 SvxZoomPageStatusBarControl::RegisterControl( SID_ZOOM_ENTIRE_PAGE, pMod );
187 SvxZoomStatusBarControl::RegisterControl( SID_ATTR_ZOOM, pMod );
188 SvxPosSizeStatusBarControl::RegisterControl( SID_ATTR_SIZE, pMod );
189 SvxModifyControl::RegisterControl( SID_DOC_MODIFIED, pMod );
190 SvxZoomSliderControl::RegisterControl( SID_ATTR_ZOOMSLIDER, pMod );
192 svx::FormatPaintBrushToolBoxControl::RegisterControl(SID_FORMATPAINTBRUSH, pMod );
194 SvxClipBoardControl::RegisterControl( SID_PASTE, pMod );
195 SvxClipBoardControl::RegisterControl( SID_PASTE_UNFORMATTED, pMod );
197 #if HAVE_FEATURE_AVMEDIA
198 ::avmedia::MediaToolBoxControl::RegisterControl( SID_AVMEDIA_TOOLBOX, pMod );
199 #endif
200 XmlSecStatusBarControl::RegisterControl( SID_SIGNATURE, pMod );
201 SdTemplateControl::RegisterControl( SID_STATUS_LAYOUT, pMod );
202 SdScaleControl::RegisterControl( SID_SCALE, pMod );
203 SvxTbxCtlDraw::RegisterControl(SID_INSERT_DRAW, pMod );
206 void SdDLL::Init()
208 if ( SfxApplication::GetModule(SfxToolsModule::Draw) ) // Module already active
209 return;
211 SfxObjectFactory* pDrawFact = nullptr;
212 SfxObjectFactory* pImpressFact = nullptr;
214 if (utl::ConfigManager::IsFuzzing() || SvtModuleOptions().IsImpress())
215 pImpressFact = &::sd::DrawDocShell::Factory();
217 if (!utl::ConfigManager::IsFuzzing() && SvtModuleOptions().IsDraw())
218 pDrawFact = &::sd::GraphicDocShell::Factory();
220 auto pUniqueModule = std::make_unique<SdModule>(pImpressFact, pDrawFact);
221 SdModule* pModule = pUniqueModule.get();
222 SfxApplication::SetModule(SfxToolsModule::Draw, std::move(pUniqueModule));
224 if (!utl::ConfigManager::IsFuzzing() && SvtModuleOptions().IsImpress())
226 // Register the Impress shape types in order to make the shapes accessible.
227 ::accessibility::RegisterImpressShapeTypes ();
228 ::sd::DrawDocShell::Factory().SetDocumentServiceName( "com.sun.star.presentation.PresentationDocument" );
231 if (!utl::ConfigManager::IsFuzzing() && SvtModuleOptions().IsDraw())
233 ::sd::GraphicDocShell::Factory().SetDocumentServiceName( "com.sun.star.drawing.DrawingDocument" );
236 // register your view-factories here
237 RegisterFactorys();
239 // register your shell-interfaces here
240 RegisterInterfaces(pModule);
242 // register your controllers here
243 RegisterControllers(pModule);
245 // register 3D-object-factory
246 E3dObjFactory();
248 // register css::form::component::Form-Object-Factory
249 FmFormObjFactory();
251 // register your exotic remote controls here
252 #ifdef ENABLE_SDREMOTE
253 if (!utl::ConfigManager::IsFuzzing() && !Application::IsHeadlessModeEnabled())
254 RegisterRemotes();
255 #endif
258 #ifndef DISABLE_DYNLOADING
260 extern "C" SAL_DLLPUBLIC_EXPORT
261 void lok_preload_hook()
263 SdAbstractDialogFactory::Create();
266 #endif
268 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */