Line data Source code
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 <avmedia/mediaplayer.hxx>
21 : #include <avmedia/mediatoolbox.hxx>
22 : #include <editeng/eeitem.hxx>
23 : #include <editeng/editeng.hxx>
24 : #include <svx/svdobj.hxx>
25 : #include <unotools/moduleoptions.hxx>
26 : #include <svx/fmobjfac.hxx>
27 : #include <svx/svdfield.hxx>
28 : #include <svx/objfac3d.hxx>
29 : #include <vcl/svapp.hxx>
30 :
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 "LayerDialogChildWindow.hxx"
47 : #include "MediaObjectBar.hxx"
48 : #include "NavigatorChildWindow.hxx"
49 : #include "OutlineViewShell.hxx"
50 : #include "OutlineViewShellBase.hxx"
51 : #include "PaneChildWindows.hxx"
52 : #include "sdresid.hxx"
53 : #include "sdobjfac.hxx"
54 : #include "cfgids.hxx"
55 : #include "SpellDialogChildWindow.hxx"
56 : #include "SlideSorterViewShell.hxx"
57 : #include "SlideSorterViewShellBase.hxx"
58 : #include "strmname.h"
59 : #include "SdShapeTypes.hxx"
60 : #include "tbx_ww.hxx"
61 : #include "TextObjectBar.hxx"
62 : #include "tmplctrl.hxx"
63 :
64 : #include <svx/svxids.hrc>
65 : #include <svx/bmpmask.hxx>
66 : #include <svx/clipboardctl.hxx>
67 : #include <svx/extrusioncolorcontrol.hxx>
68 : #include <svx/f3dchild.hxx>
69 : #include <svx/fillctrl.hxx>
70 : #include <svx/fntctl.hxx>
71 : #include <svx/fntszctl.hxx>
72 : #include <svx/fontwork.hxx>
73 : #include <svx/fontworkgallery.hxx>
74 : #include <svx/formatpaintbrushctrl.hxx>
75 : #include <svx/galbrws.hxx>
76 : #include <svx/grafctrl.hxx>
77 : #include <svx/hyperdlg.hxx>
78 : #include <svx/imapdlg.hxx>
79 : #include <svx/layctrl.hxx>
80 : #include <svx/lboxctrl.hxx>
81 : #include <svx/linectrl.hxx>
82 : #include <svx/modctrl.hxx>
83 : #include <svx/pszctrl.hxx>
84 : #include <svx/srchdlg.hxx>
85 : #include <svx/subtoolboxcontrol.hxx>
86 : #include <svx/SvxColorChildWindow.hxx>
87 : #include <svx/SvxShapeTypes.hxx>
88 : #include <svx/tbcontrl.hxx>
89 : #include <svx/tbxcustomshapes.hxx>
90 : #include <svx/verttexttbxctrl.hxx>
91 : #include <svx/xmlsecctrl.hxx>
92 : #include <svx/zoomctrl.hxx>
93 : #include <svx/zoomsliderctrl.hxx>
94 : #include <sfx2/docfilt.hxx>
95 : #include <sfx2/docfile.hxx>
96 : #include <sfx2/fcontnr.hxx>
97 : #include <sfx2/sidebar/SidebarChildWindow.hxx>
98 : #include <vcl/FilterConfigItem.hxx>
99 : #include <comphelper/processfactory.hxx>
100 :
101 : using namespace ::rtl;
102 : using namespace ::com::sun::star;
103 :
104 : namespace sd { namespace ui { namespace table {
105 : extern void RegisterInterfaces( SfxModule* pMod );
106 : } } }
107 :
108 : // Register all Factorys
109 16 : void SdDLL::RegisterFactorys()
110 : {
111 16 : if (SvtModuleOptions().IsImpress())
112 : {
113 : ::sd::ImpressViewShellBase::RegisterFactory (
114 16 : ::sd::IMPRESS_FACTORY_ID);
115 : ::sd::SlideSorterViewShellBase::RegisterFactory (
116 16 : ::sd::SLIDE_SORTER_FACTORY_ID);
117 : ::sd::OutlineViewShellBase::RegisterFactory (
118 16 : ::sd::OUTLINE_FACTORY_ID);
119 : ::sd::PresentationViewShellBase::RegisterFactory (
120 16 : ::sd::PRESENTATION_FACTORY_ID);
121 : }
122 16 : if (SvtModuleOptions().IsDraw())
123 : {
124 16 : ::sd::GraphicViewShellBase::RegisterFactory (::sd::DRAW_FACTORY_ID);
125 : }
126 16 : }
127 :
128 : // Register all Interfaces
129 :
130 16 : void SdDLL::RegisterInterfaces()
131 : {
132 : // Module
133 16 : SfxModule* pMod = SD_MOD();
134 16 : SdModule::RegisterInterface(pMod);
135 :
136 : // View shell base.
137 16 : ::sd::ViewShellBase::RegisterInterface(pMod);
138 :
139 : // DocShells
140 16 : ::sd::DrawDocShell::RegisterInterface(pMod);
141 16 : ::sd::GraphicDocShell::RegisterInterface(pMod);
142 :
143 : // Impress ViewShells
144 16 : ::sd::DrawViewShell::RegisterInterface(pMod);
145 16 : ::sd::OutlineViewShell::RegisterInterface(pMod);
146 16 : ::sd::PresentationViewShell::RegisterInterface(pMod);
147 :
148 : // Draw ViewShell
149 16 : ::sd::GraphicViewShell::RegisterInterface(pMod);
150 :
151 : // Impress ObjectShells
152 16 : ::sd::BezierObjectBar::RegisterInterface(pMod);
153 16 : ::sd::TextObjectBar::RegisterInterface(pMod);
154 16 : ::sd::GraphicObjectBar::RegisterInterface(pMod);
155 :
156 : // Media ObjectShell
157 16 : ::sd::MediaObjectBar::RegisterInterface(pMod);
158 :
159 : // Table ObjectShell
160 16 : ::sd::ui::table::RegisterInterfaces(pMod);
161 :
162 : // View shells for the side panes.
163 16 : ::sd::slidesorter::SlideSorterViewShell::RegisterInterface (pMod);
164 16 : }
165 :
166 : // Register all Controllers
167 :
168 16 : void SdDLL::RegisterControllers()
169 : {
170 16 : SfxModule* pMod = SD_MOD();
171 :
172 : // ToolBoxControls registrieren
173 16 : SdTbxControl::RegisterControl( SID_OBJECT_ALIGN, pMod );
174 16 : SdTbxControl::RegisterControl( SID_ZOOM_TOOLBOX, pMod );
175 16 : SdTbxControl::RegisterControl( SID_OBJECT_CHOOSE_MODE, pMod );
176 16 : SdTbxControl::RegisterControl( SID_POSITION, pMod );
177 16 : SdTbxControl::RegisterControl( SID_DRAWTBX_TEXT, pMod );
178 16 : SdTbxControl::RegisterControl( SID_DRAWTBX_RECTANGLES, pMod );
179 16 : SdTbxControl::RegisterControl( SID_DRAWTBX_ELLIPSES, pMod );
180 16 : SdTbxControl::RegisterControl( SID_DRAWTBX_LINES, pMod );
181 16 : SdTbxControl::RegisterControl( SID_DRAWTBX_ARROWS, pMod );
182 16 : SdTbxControl::RegisterControl( SID_DRAWTBX_3D_OBJECTS, pMod );
183 16 : SdTbxControl::RegisterControl( SID_DRAWTBX_CONNECTORS, pMod );
184 16 : SdTbxControl::RegisterControl( SID_DRAWTBX_INSERT, pMod );
185 :
186 16 : SvxTbxCtlCustomShapes::RegisterControl( SID_DRAWTBX_CS_BASIC, pMod );
187 16 : SvxTbxCtlCustomShapes::RegisterControl( SID_DRAWTBX_CS_SYMBOL, pMod );
188 16 : SvxTbxCtlCustomShapes::RegisterControl( SID_DRAWTBX_CS_ARROW, pMod );
189 16 : SvxTbxCtlCustomShapes::RegisterControl( SID_DRAWTBX_CS_FLOWCHART, pMod );
190 16 : SvxTbxCtlCustomShapes::RegisterControl( SID_DRAWTBX_CS_CALLOUT, pMod );
191 16 : SvxTbxCtlCustomShapes::RegisterControl( SID_DRAWTBX_CS_STAR, pMod );
192 :
193 16 : SdTbxCtlDiaPages::RegisterControl( SID_PAGES_PER_ROW, pMod );
194 16 : SdTbxCtlGlueEscDir::RegisterControl( SID_GLUE_ESCDIR, pMod );
195 :
196 16 : ::sd::AnimationChildWindow::RegisterChildWindow(false, pMod);
197 16 : ::sd::NavigatorChildWindow::RegisterChildWindowContext( (sal_uInt16) ::sd::DrawViewShell::GetInterfaceId(), pMod );
198 16 : ::sd::NavigatorChildWindow::RegisterChildWindowContext( (sal_uInt16) ::sd::GraphicViewShell::GetInterfaceId(), pMod );
199 16 : ::sd::LayerDialogChildWindow::RegisterChildWindow(false, pMod);
200 :
201 16 : Svx3DChildWindow::RegisterChildWindow(false, pMod);
202 16 : SvxFontWorkChildWindow::RegisterChildWindow(false, pMod);
203 16 : SvxColorChildWindow::RegisterChildWindow(false, pMod, SFX_CHILDWIN_TASK);
204 16 : SvxSearchDialogWrapper::RegisterChildWindow(false, pMod);
205 16 : SvxBmpMaskChildWindow::RegisterChildWindow(false, pMod);
206 16 : GalleryChildWindow::RegisterChildWindow(false, pMod);
207 16 : SvxIMapDlgChildWindow::RegisterChildWindow(false, pMod);
208 16 : SvxHlinkDlgWrapper::RegisterChildWindow(false, pMod);
209 16 : ::sd::SpellDialogChildWindow::RegisterChildWindow(false, pMod);
210 16 : ::avmedia::MediaPlayer::RegisterChildWindow(false, pMod);
211 16 : ::sd::LeftPaneImpressChildWindow::RegisterChildWindow(false, pMod);
212 16 : ::sd::LeftPaneDrawChildWindow::RegisterChildWindow(false, pMod);
213 16 : ::sfx2::sidebar::SidebarChildWindow::RegisterChildWindow(false, pMod);
214 :
215 16 : SvxFillToolBoxControl::RegisterControl(0, pMod);
216 16 : SvxLineStyleToolBoxControl::RegisterControl(0, pMod);
217 16 : SvxLineWidthToolBoxControl::RegisterControl(0, pMod);
218 16 : SvxLineColorToolBoxControl::RegisterControl(0, pMod);
219 :
220 16 : SvxLineEndToolBoxControl::RegisterControl( SID_ATTR_LINEEND_STYLE, pMod );
221 :
222 16 : SvxStyleToolBoxControl::RegisterControl(0, pMod);
223 16 : SvxFontNameToolBoxControl::RegisterControl(0, pMod);
224 16 : SvxFontColorToolBoxControl::RegisterControl(0, pMod);
225 :
226 16 : SvxGrafFilterToolBoxControl::RegisterControl( SID_GRFFILTER, pMod );
227 16 : SvxGrafModeToolBoxControl::RegisterControl( SID_ATTR_GRAF_MODE, pMod );
228 16 : SvxGrafRedToolBoxControl::RegisterControl( SID_ATTR_GRAF_RED, pMod );
229 16 : SvxGrafGreenToolBoxControl::RegisterControl( SID_ATTR_GRAF_GREEN, pMod );
230 16 : SvxGrafBlueToolBoxControl::RegisterControl( SID_ATTR_GRAF_BLUE, pMod );
231 16 : SvxGrafLuminanceToolBoxControl::RegisterControl( SID_ATTR_GRAF_LUMINANCE, pMod );
232 16 : SvxGrafContrastToolBoxControl::RegisterControl( SID_ATTR_GRAF_CONTRAST, pMod );
233 16 : SvxGrafGammaToolBoxControl::RegisterControl( SID_ATTR_GRAF_GAMMA, pMod );
234 16 : SvxGrafTransparenceToolBoxControl::RegisterControl( SID_ATTR_GRAF_TRANSPARENCE, pMod );
235 16 : SvxVertTextTbxCtrl::RegisterControl(SID_TEXTDIRECTION_TOP_TO_BOTTOM, pMod);
236 16 : SvxVertTextTbxCtrl::RegisterControl(SID_TEXTDIRECTION_LEFT_TO_RIGHT, pMod);
237 16 : SvxVertTextTbxCtrl::RegisterControl(SID_DRAW_CAPTION_VERTICAL, pMod);
238 16 : SvxVertTextTbxCtrl::RegisterControl(SID_DRAW_FONTWORK_VERTICAL, pMod);
239 16 : SvxVertTextTbxCtrl::RegisterControl(SID_DRAW_TEXT_VERTICAL, pMod);
240 16 : SvxVertTextTbxCtrl::RegisterControl(SID_TEXT_FITTOSIZE_VERTICAL, pMod);
241 16 : SvxCTLTextTbxCtrl::RegisterControl(SID_ATTR_PARA_LEFT_TO_RIGHT, pMod);
242 16 : SvxCTLTextTbxCtrl::RegisterControl(SID_ATTR_PARA_RIGHT_TO_LEFT, pMod);
243 :
244 : // register StatusBarControls
245 16 : SvxZoomStatusBarControl::RegisterControl( SID_ATTR_ZOOM, pMod );
246 16 : SvxPosSizeStatusBarControl::RegisterControl( SID_ATTR_SIZE, pMod );
247 16 : SvxModifyControl::RegisterControl( SID_DOC_MODIFIED, pMod );
248 16 : SvxZoomSliderControl::RegisterControl( SID_ATTR_ZOOMSLIDER, pMod );
249 :
250 : // MenuControls for PopupMenu
251 16 : SvxFontMenuControl::RegisterControl( SID_ATTR_CHAR_FONT, pMod );
252 16 : SvxFontSizeMenuControl::RegisterControl( SID_ATTR_CHAR_FONTHEIGHT, pMod );
253 :
254 16 : SfxMenuControl::RegisterControl( SID_SET_SNAPITEM, pMod );
255 16 : SfxMenuControl::RegisterControl( SID_DELETE_SNAPITEM, pMod );
256 16 : SfxMenuControl::RegisterControl( SID_BEZIER_CLOSE, pMod );
257 :
258 : // #UndoRedo#
259 16 : SvxUndoRedoControl::RegisterControl( SID_UNDO , pMod );
260 16 : SvxUndoRedoControl::RegisterControl( SID_REDO , pMod );
261 :
262 16 : svx::FormatPaintBrushToolBoxControl::RegisterControl(SID_FORMATPAINTBRUSH, pMod );
263 :
264 16 : SvxClipBoardControl::RegisterControl( SID_PASTE, pMod );
265 16 : SvxClipBoardControl::RegisterControl( SID_PASTE_UNFORMATTED, pMod );
266 :
267 16 : svx::ExtrusionColorControl::RegisterControl( SID_EXTRUSION_3D_COLOR, pMod );
268 16 : svx::FontWorkShapeTypeControl::RegisterControl( SID_FONTWORK_SHAPE_TYPE, pMod );
269 :
270 16 : ::avmedia::MediaToolBoxControl::RegisterControl( SID_AVMEDIA_TOOLBOX, pMod );
271 16 : XmlSecStatusBarControl::RegisterControl( SID_SIGNATURE, pMod );
272 16 : SdTemplateControl::RegisterControl( SID_STATUS_LAYOUT, pMod );
273 16 : SvxTableToolBoxControl::RegisterControl(SID_INSERT_TABLE, pMod );
274 16 : SvxFrameLineStyleToolBoxControl::RegisterControl(SID_FRAME_LINESTYLE, pMod );
275 16 : SvxFrameLineColorToolBoxControl::RegisterControl(SID_FRAME_LINECOLOR, pMod );
276 16 : SvxFrameToolBoxControl::RegisterControl(SID_ATTR_BORDER, pMod );
277 16 : SvxSubToolBoxControl::RegisterControl(SID_OPTIMIZE_TABLE, pMod);
278 16 : }
279 :
280 217 : void SdDLL::Init()
281 : {
282 217 : if ( SD_MOD() )
283 418 : return;
284 :
285 16 : SfxObjectFactory* pDrawFact = NULL;
286 16 : SfxObjectFactory* pImpressFact = NULL;
287 :
288 16 : if (SvtModuleOptions().IsImpress())
289 16 : pImpressFact = &::sd::DrawDocShell::Factory();
290 :
291 16 : if (SvtModuleOptions().IsDraw())
292 16 : pDrawFact = &::sd::GraphicDocShell::Factory();
293 :
294 : // the SdModule must be created
295 16 : SdModule** ppShlPtr = (SdModule**) GetAppData(SHL_DRAW);
296 :
297 : // #i46427#
298 : // The SfxModule::SfxModule stops when the first given factory
299 : // is 0, so we must not give a 0 as first factory
300 16 : if( pImpressFact )
301 : {
302 16 : (*ppShlPtr) = new SdModule( pImpressFact, pDrawFact );
303 : }
304 : else
305 : {
306 0 : (*ppShlPtr) = new SdModule( pDrawFact, pImpressFact );
307 : }
308 :
309 16 : if (SvtModuleOptions().IsImpress())
310 : {
311 : // Register the Impress shape types in order to make the shapes accessible.
312 16 : ::accessibility::RegisterImpressShapeTypes ();
313 16 : ::sd::DrawDocShell::Factory().SetDocumentServiceName( "com.sun.star.presentation.PresentationDocument" );
314 : }
315 :
316 16 : if (SvtModuleOptions().IsDraw())
317 : {
318 16 : ::sd::GraphicDocShell::Factory().SetDocumentServiceName( "com.sun.star.drawing.DrawingDocument" );
319 : }
320 :
321 : // register your view-factories here
322 16 : RegisterFactorys();
323 :
324 : // register your shell-interfaces here
325 16 : RegisterInterfaces();
326 :
327 : // register your controllers here
328 16 : RegisterControllers();
329 :
330 : // register SvDraw-Fields
331 16 : SdrRegisterFieldClasses();
332 :
333 : // register 3D-Objekt-Factory
334 16 : E3dObjFactory();
335 :
336 : // register ::com::sun::star::form::component::Form-Object-Factory
337 16 : FmFormObjFactory();
338 :
339 : // register Object-Factory
340 16 : SdrObjFactory::InsertMakeUserDataHdl(LINK(&aSdObjectFactory, SdObjectFactory, MakeUserData));
341 :
342 : // register your exotic remote controlls here
343 : #ifdef ENABLE_SDREMOTE
344 16 : if ( !Application::IsHeadlessModeRequested() )
345 0 : RegisterRemotes();
346 : #endif
347 48 : }
348 :
349 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|