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