LibreOffice Module sd (master) 1
sddll.cxx
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
20#include <config_features.h>
21
26#include <svx/fmobjfac.hxx>
27#include <svx/objfac3d.hxx>
28#include <vcl/svapp.hxx>
29
31#include <sddll.hxx>
32#include <app.hrc>
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>
46#include <MediaObjectBar.hxx>
48#include <OutlineViewShell.hxx>
50#include <PaneChildWindows.hxx>
51#include <SpellDialogChildWindow.hxx>
54#include <SdShapeTypes.hxx>
55#include <TextObjectBar.hxx>
56#include <tmplctrl.hxx>
57#include <scalectrl.hxx>
58
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>
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>
74#include <svx/xmlsecctrl.hxx>
75#include <svx/zoomctrl.hxx>
77#include <svx/tbxctl.hxx>
80#include <comphelper/lok.hxx>
81#include <sdabstdlg.hxx>
82#include <sdfilter.hxx>
83#include <sdmod.hxx>
84
85using namespace ::com::sun::star;
86
87// Register all Factories
89{
91 {
92 ::sd::ImpressViewShellBase::RegisterFactory (
95 {
96 ::sd::ImpressViewShellBase::RegisterFactory (
98 ::sd::ImpressViewShellBase::RegisterFactory (
100 ::sd::ImpressViewShellBase::RegisterFactory (
102 }
103 else
104 {
105 ::sd::SlideSorterViewShellBase::RegisterFactory (
107 ::sd::OutlineViewShellBase::RegisterFactory (
109 ::sd::PresentationViewShellBase::RegisterFactory (
111 }
112 }
114 {
115 ::sd::GraphicViewShellBase::RegisterFactory (::sd::DRAW_FACTORY_ID);
116 }
117}
118
119// Register all Interfaces
120
122{
123 // Module
124 SdModule::RegisterInterface(pMod);
125
126 // View shell base.
127 ::sd::ViewShellBase::RegisterInterface(pMod);
128
129 // DocShells
130 ::sd::DrawDocShell::RegisterInterface(pMod);
131 ::sd::GraphicDocShell::RegisterInterface(pMod);
132
133 // Impress ViewShells
134 ::sd::DrawViewShell::RegisterInterface(pMod);
135 ::sd::OutlineViewShell::RegisterInterface(pMod);
136 ::sd::PresentationViewShell::RegisterInterface(pMod);
137
138 // Draw ViewShell
139 ::sd::GraphicViewShell::RegisterInterface(pMod);
140
141 // Impress ObjectShells
142 ::sd::BezierObjectBar::RegisterInterface(pMod);
143 ::sd::TextObjectBar::RegisterInterface(pMod);
144 ::sd::GraphicObjectBar::RegisterInterface(pMod);
145
146 // Media ObjectShell
147 ::sd::MediaObjectBar::RegisterInterface(pMod);
148
149 // Table ObjectShell
151
152 // View shells for the side panes.
153 ::sd::slidesorter::SlideSorterViewShell::RegisterInterface (pMod);
154}
155
156// Register all Controllers
157
159{
160 SdTbxCtlDiaPages::RegisterControl( SID_PAGES_PER_ROW, pMod );
161 SdTbxCtlGlueEscDir::RegisterControl( SID_GLUE_ESCDIR, pMod );
162
164
165 Svx3DChildWindow::RegisterChildWindow(false, pMod);
166 SvxFontWorkChildWindow::RegisterChildWindow(false, pMod);
167 SvxColorChildWindow::RegisterChildWindow(false, pMod, SfxChildWindowFlags::TASK);
168 SvxSearchDialogWrapper::RegisterChildWindow(false, pMod);
169 SvxBmpMaskChildWindow::RegisterChildWindow(false, pMod);
170 SvxIMapDlgChildWindow::RegisterChildWindow(false, pMod);
171 SvxHlinkDlgWrapper::RegisterChildWindow(false, pMod);
172 ::sd::SpellDialogChildWindow::RegisterChildWindow(
173 false, pMod, comphelper::LibreOfficeKit::isActive() ? SfxChildWindowFlags::NEVERCLONE
174 : SfxChildWindowFlags::NONE);
175#if HAVE_FEATURE_AVMEDIA
176 ::avmedia::MediaPlayer::RegisterChildWindow(false, pMod);
177#endif
182
183 ::sd::SdNavigatorWrapper::RegisterChildWindow(false, pMod, SfxChildWindowFlags::NEVERHIDE);
184
185 SvxFillToolBoxControl::RegisterControl(0, pMod);
186 SvxLineWidthToolBoxControl::RegisterControl(0, pMod);
187
188 SvxGrafModeToolBoxControl::RegisterControl( SID_ATTR_GRAF_MODE, pMod );
189 SvxGrafRedToolBoxControl::RegisterControl( SID_ATTR_GRAF_RED, pMod );
190 SvxGrafGreenToolBoxControl::RegisterControl( SID_ATTR_GRAF_GREEN, pMod );
191 SvxGrafBlueToolBoxControl::RegisterControl( SID_ATTR_GRAF_BLUE, pMod );
192 SvxGrafLuminanceToolBoxControl::RegisterControl( SID_ATTR_GRAF_LUMINANCE, pMod );
193 SvxGrafContrastToolBoxControl::RegisterControl( SID_ATTR_GRAF_CONTRAST, pMod );
194 SvxGrafGammaToolBoxControl::RegisterControl( SID_ATTR_GRAF_GAMMA, pMod );
195 SvxGrafTransparenceToolBoxControl::RegisterControl( SID_ATTR_GRAF_TRANSPARENCE, pMod );
196
197 // register StatusBarControls
198 SvxZoomPageStatusBarControl::RegisterControl( SID_ZOOM_ENTIRE_PAGE, pMod );
199 SvxZoomStatusBarControl::RegisterControl( SID_ATTR_ZOOM, pMod );
200 SvxPosSizeStatusBarControl::RegisterControl( SID_ATTR_SIZE, pMod );
201 SvxModifyControl::RegisterControl( SID_DOC_MODIFIED, pMod );
202 SvxZoomSliderControl::RegisterControl( SID_ATTR_ZOOMSLIDER, pMod );
203
204 svx::FormatPaintBrushToolBoxControl::RegisterControl(SID_FORMATPAINTBRUSH, pMod );
205
206 SvxClipBoardControl::RegisterControl( SID_PASTE, pMod );
207 SvxClipBoardControl::RegisterControl( SID_PASTE_UNFORMATTED, pMod );
208
209#if HAVE_FEATURE_AVMEDIA
210 ::avmedia::MediaToolBoxControl::RegisterControl( SID_AVMEDIA_TOOLBOX, pMod );
211#endif
212 XmlSecStatusBarControl::RegisterControl( SID_SIGNATURE, pMod );
213 SdTemplateControl::RegisterControl( SID_STATUS_LAYOUT, pMod );
214 SdScaleControl::RegisterControl( SID_SCALE, pMod );
215 SvxTbxCtlDraw::RegisterControl(SID_INSERT_DRAW, pMod );
216}
217
219{
220 if ( SfxApplication::GetModule(SfxToolsModule::Draw) ) // Module already active
221 return;
222
223 SfxObjectFactory* pDrawFact = nullptr;
224 SfxObjectFactory* pImpressFact = nullptr;
225
226 if (utl::ConfigManager::IsFuzzing() || SvtModuleOptions().IsImpress())
227 pImpressFact = &::sd::DrawDocShell::Factory();
228
230 pDrawFact = &::sd::GraphicDocShell::Factory();
231
232 auto pUniqueModule = std::make_unique<SdModule>(pImpressFact, pDrawFact);
233 SdModule* pModule = pUniqueModule.get();
234 SfxApplication::SetModule(SfxToolsModule::Draw, std::move(pUniqueModule));
235
236 if (!utl::ConfigManager::IsFuzzing() && SvtModuleOptions().IsImpress())
237 {
238 // Register the Impress shape types in order to make the shapes accessible.
240 ::sd::DrawDocShell::Factory().SetDocumentServiceName( "com.sun.star.presentation.PresentationDocument" );
241 }
242
244 {
245 ::sd::GraphicDocShell::Factory().SetDocumentServiceName( "com.sun.star.drawing.DrawingDocument" );
246 }
247
248 // register your view-factories here
250
251 // register your shell-interfaces here
252 RegisterInterfaces(pModule);
253
254 // register your controllers here
255 RegisterControllers(pModule);
256
257 // register 3D-object-factory
259
260 // register css::form::component::Form-Object-Factory
262
263 // register your exotic remote controls here
264#ifdef ENABLE_SDREMOTE
266 RegisterRemotes();
267#endif
268}
269
270#ifndef DISABLE_DYNLOADING
271
272extern "C" SAL_DLLPUBLIC_EXPORT
274{
276}
277
278#endif
279
280/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static bool IsHeadlessModeEnabled()
static SD_DLLPUBLIC SdAbstractDialogFactory * Create()
Definition: sdabstdlg.cxx:38
static void RegisterInterfaces(const SdModule *pMod)
Definition: sddll.cxx:121
static void RegisterFactorys()
Definition: sddll.cxx:88
static void Init()
Definition: sddll.cxx:218
static void RegisterControllers(SdModule *pMod)
Definition: sddll.cxx:158
static void SetModule(SfxToolsModule nSharedLib, std::unique_ptr< SfxModule > pModule)
static SfxModule * GetModule(SfxToolsModule nSharedLib)
static void RegisterChildWindow(SfxModule *, const SfxChildWinFactory &)
static bool IsFuzzing()
void RegisterImpressShapeTypes()
Register the SD presentation shape types with the ShapeTypeHandler singleton.
void RegisterInterfaces(const SfxModule *pMod)
registers the interfaces from the table ui
constexpr auto SLIDE_SORTER_FACTORY_ID
Definition: FactoryIds.hxx:34
constexpr auto DRAW_FACTORY_ID
Definition: FactoryIds.hxx:33
constexpr auto OUTLINE_FACTORY_ID
Definition: FactoryIds.hxx:35
constexpr auto IMPRESS_FACTORY_ID
This are ids used by SfxTopFrame::Create() or CreateViewFrame() to select a factory to create an inst...
Definition: FactoryIds.hxx:32
constexpr auto PRESENTATION_FACTORY_ID
Definition: FactoryIds.hxx:36
SAL_DLLPUBLIC_EXPORT void lok_preload_hook()
Definition: sddll.cxx:273