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 0 : void SdDLL::RegisterFactorys()
110 : {
111 0 : if (SvtModuleOptions().IsImpress())
112 : {
113 : ::sd::ImpressViewShellBase::RegisterFactory (
114 0 : ::sd::IMPRESS_FACTORY_ID);
115 : ::sd::SlideSorterViewShellBase::RegisterFactory (
116 0 : ::sd::SLIDE_SORTER_FACTORY_ID);
117 : ::sd::OutlineViewShellBase::RegisterFactory (
118 0 : ::sd::OUTLINE_FACTORY_ID);
119 : ::sd::PresentationViewShellBase::RegisterFactory (
120 0 : ::sd::PRESENTATION_FACTORY_ID);
121 : }
122 0 : if (SvtModuleOptions().IsDraw())
123 : {
124 0 : ::sd::GraphicViewShellBase::RegisterFactory (::sd::DRAW_FACTORY_ID);
125 : }
126 0 : }
127 :
128 : // Register all Interfaces
129 :
130 0 : void SdDLL::RegisterInterfaces()
131 : {
132 : // Module
133 0 : SfxModule* pMod = SD_MOD();
134 0 : SdModule::RegisterInterface(pMod);
135 :
136 : // View shell base.
137 0 : ::sd::ViewShellBase::RegisterInterface(pMod);
138 :
139 : // DocShells
140 0 : ::sd::DrawDocShell::RegisterInterface(pMod);
141 0 : ::sd::GraphicDocShell::RegisterInterface(pMod);
142 :
143 : // Impress ViewShells
144 0 : ::sd::DrawViewShell::RegisterInterface(pMod);
145 0 : ::sd::OutlineViewShell::RegisterInterface(pMod);
146 0 : ::sd::PresentationViewShell::RegisterInterface(pMod);
147 :
148 : // Draw ViewShell
149 0 : ::sd::GraphicViewShell::RegisterInterface(pMod);
150 :
151 : // Impress ObjectShells
152 0 : ::sd::BezierObjectBar::RegisterInterface(pMod);
153 0 : ::sd::TextObjectBar::RegisterInterface(pMod);
154 0 : ::sd::GraphicObjectBar::RegisterInterface(pMod);
155 :
156 : // Media ObjectShell
157 0 : ::sd::MediaObjectBar::RegisterInterface(pMod);
158 :
159 : // Table ObjectShell
160 0 : ::sd::ui::table::RegisterInterfaces(pMod);
161 :
162 : // View shells for the side panes.
163 0 : ::sd::slidesorter::SlideSorterViewShell::RegisterInterface (pMod);
164 0 : }
165 :
166 : // Register all Controllers
167 :
168 0 : void SdDLL::RegisterControllers()
169 : {
170 0 : SfxModule* pMod = SD_MOD();
171 :
172 : // ToolBoxControls registrieren
173 0 : SdTbxControl::RegisterControl( SID_OBJECT_ALIGN, pMod );
174 0 : SdTbxControl::RegisterControl( SID_ZOOM_TOOLBOX, pMod );
175 0 : SdTbxControl::RegisterControl( SID_OBJECT_CHOOSE_MODE, pMod );
176 0 : SdTbxControl::RegisterControl( SID_POSITION, pMod );
177 0 : SdTbxControl::RegisterControl( SID_DRAWTBX_TEXT, pMod );
178 0 : SdTbxControl::RegisterControl( SID_DRAWTBX_RECTANGLES, pMod );
179 0 : SdTbxControl::RegisterControl( SID_DRAWTBX_ELLIPSES, pMod );
180 0 : SdTbxControl::RegisterControl( SID_DRAWTBX_LINES, pMod );
181 0 : SdTbxControl::RegisterControl( SID_DRAWTBX_ARROWS, pMod );
182 0 : SdTbxControl::RegisterControl( SID_DRAWTBX_3D_OBJECTS, pMod );
183 0 : SdTbxControl::RegisterControl( SID_DRAWTBX_CONNECTORS, pMod );
184 0 : SdTbxControl::RegisterControl( SID_DRAWTBX_INSERT, pMod );
185 :
186 0 : SvxTbxCtlCustomShapes::RegisterControl( SID_DRAWTBX_CS_BASIC, pMod );
187 0 : SvxTbxCtlCustomShapes::RegisterControl( SID_DRAWTBX_CS_SYMBOL, pMod );
188 0 : SvxTbxCtlCustomShapes::RegisterControl( SID_DRAWTBX_CS_ARROW, pMod );
189 0 : SvxTbxCtlCustomShapes::RegisterControl( SID_DRAWTBX_CS_FLOWCHART, pMod );
190 0 : SvxTbxCtlCustomShapes::RegisterControl( SID_DRAWTBX_CS_CALLOUT, pMod );
191 0 : SvxTbxCtlCustomShapes::RegisterControl( SID_DRAWTBX_CS_STAR, pMod );
192 :
193 0 : SdTbxCtlDiaPages::RegisterControl( SID_PAGES_PER_ROW, pMod );
194 0 : SdTbxCtlGlueEscDir::RegisterControl( SID_GLUE_ESCDIR, pMod );
195 :
196 0 : ::sd::AnimationChildWindow::RegisterChildWindow(false, pMod);
197 0 : ::sd::NavigatorChildWindow::RegisterChildWindowContext( (sal_uInt16) ::sd::DrawViewShell::GetInterfaceId(), pMod );
198 0 : ::sd::NavigatorChildWindow::RegisterChildWindowContext( (sal_uInt16) ::sd::GraphicViewShell::GetInterfaceId(), pMod );
199 0 : ::sd::LayerDialogChildWindow::RegisterChildWindow(false, pMod);
200 :
201 0 : Svx3DChildWindow::RegisterChildWindow(false, pMod);
202 0 : SvxFontWorkChildWindow::RegisterChildWindow(false, pMod);
203 0 : SvxColorChildWindow::RegisterChildWindow(false, pMod, SFX_CHILDWIN_TASK);
204 0 : SvxSearchDialogWrapper::RegisterChildWindow(false, pMod);
205 0 : SvxBmpMaskChildWindow::RegisterChildWindow(false, pMod);
206 0 : GalleryChildWindow::RegisterChildWindow(false, pMod);
207 0 : SvxIMapDlgChildWindow::RegisterChildWindow(false, pMod);
208 0 : SvxHlinkDlgWrapper::RegisterChildWindow(false, pMod);
209 0 : ::sd::SpellDialogChildWindow::RegisterChildWindow(false, pMod);
210 0 : ::avmedia::MediaPlayer::RegisterChildWindow(false, pMod);
211 0 : ::sd::LeftPaneImpressChildWindow::RegisterChildWindow(false, pMod);
212 0 : ::sd::LeftPaneDrawChildWindow::RegisterChildWindow(false, pMod);
213 0 : ::sfx2::sidebar::SidebarChildWindow::RegisterChildWindow(false, pMod);
214 :
215 0 : SvxFillToolBoxControl::RegisterControl(0, pMod);
216 0 : SvxLineStyleToolBoxControl::RegisterControl(0, pMod);
217 0 : SvxLineWidthToolBoxControl::RegisterControl(0, pMod);
218 0 : SvxLineColorToolBoxControl::RegisterControl(0, pMod);
219 :
220 0 : SvxLineEndToolBoxControl::RegisterControl( SID_ATTR_LINEEND_STYLE, pMod );
221 :
222 0 : SvxStyleToolBoxControl::RegisterControl(0, pMod);
223 0 : SvxFontNameToolBoxControl::RegisterControl(0, pMod);
224 0 : SvxFontColorToolBoxControl::RegisterControl(0, pMod);
225 :
226 0 : SvxGrafFilterToolBoxControl::RegisterControl( SID_GRFFILTER, pMod );
227 0 : SvxGrafModeToolBoxControl::RegisterControl( SID_ATTR_GRAF_MODE, pMod );
228 0 : SvxGrafRedToolBoxControl::RegisterControl( SID_ATTR_GRAF_RED, pMod );
229 0 : SvxGrafGreenToolBoxControl::RegisterControl( SID_ATTR_GRAF_GREEN, pMod );
230 0 : SvxGrafBlueToolBoxControl::RegisterControl( SID_ATTR_GRAF_BLUE, pMod );
231 0 : SvxGrafLuminanceToolBoxControl::RegisterControl( SID_ATTR_GRAF_LUMINANCE, pMod );
232 0 : SvxGrafContrastToolBoxControl::RegisterControl( SID_ATTR_GRAF_CONTRAST, pMod );
233 0 : SvxGrafGammaToolBoxControl::RegisterControl( SID_ATTR_GRAF_GAMMA, pMod );
234 0 : SvxGrafTransparenceToolBoxControl::RegisterControl( SID_ATTR_GRAF_TRANSPARENCE, pMod );
235 0 : SvxVertTextTbxCtrl::RegisterControl(SID_TEXTDIRECTION_TOP_TO_BOTTOM, pMod);
236 0 : SvxVertTextTbxCtrl::RegisterControl(SID_TEXTDIRECTION_LEFT_TO_RIGHT, pMod);
237 0 : SvxVertTextTbxCtrl::RegisterControl(SID_DRAW_CAPTION_VERTICAL, pMod);
238 0 : SvxVertTextTbxCtrl::RegisterControl(SID_DRAW_FONTWORK_VERTICAL, pMod);
239 0 : SvxVertTextTbxCtrl::RegisterControl(SID_DRAW_TEXT_VERTICAL, pMod);
240 0 : SvxVertTextTbxCtrl::RegisterControl(SID_TEXT_FITTOSIZE_VERTICAL, pMod);
241 0 : SvxCTLTextTbxCtrl::RegisterControl(SID_ATTR_PARA_LEFT_TO_RIGHT, pMod);
242 0 : SvxCTLTextTbxCtrl::RegisterControl(SID_ATTR_PARA_RIGHT_TO_LEFT, pMod);
243 :
244 : // register StatusBarControls
245 0 : SvxZoomStatusBarControl::RegisterControl( SID_ATTR_ZOOM, pMod );
246 0 : SvxPosSizeStatusBarControl::RegisterControl( SID_ATTR_SIZE, pMod );
247 0 : SvxModifyControl::RegisterControl( SID_DOC_MODIFIED, pMod );
248 0 : SvxZoomSliderControl::RegisterControl( SID_ATTR_ZOOMSLIDER, pMod );
249 :
250 : // MenuControls for PopupMenu
251 0 : SvxFontMenuControl::RegisterControl( SID_ATTR_CHAR_FONT, pMod );
252 0 : SvxFontSizeMenuControl::RegisterControl( SID_ATTR_CHAR_FONTHEIGHT, pMod );
253 :
254 0 : SfxMenuControl::RegisterControl( SID_SET_SNAPITEM, pMod );
255 0 : SfxMenuControl::RegisterControl( SID_DELETE_SNAPITEM, pMod );
256 0 : SfxMenuControl::RegisterControl( SID_BEZIER_CLOSE, pMod );
257 :
258 : // #UndoRedo#
259 0 : SvxUndoRedoControl::RegisterControl( SID_UNDO , pMod );
260 0 : SvxUndoRedoControl::RegisterControl( SID_REDO , pMod );
261 :
262 0 : svx::FormatPaintBrushToolBoxControl::RegisterControl(SID_FORMATPAINTBRUSH, pMod );
263 :
264 0 : SvxClipBoardControl::RegisterControl( SID_PASTE, pMod );
265 0 : SvxClipBoardControl::RegisterControl( SID_PASTE_UNFORMATTED, pMod );
266 :
267 0 : svx::ExtrusionColorControl::RegisterControl( SID_EXTRUSION_3D_COLOR, pMod );
268 0 : svx::FontWorkShapeTypeControl::RegisterControl( SID_FONTWORK_SHAPE_TYPE, pMod );
269 :
270 0 : ::avmedia::MediaToolBoxControl::RegisterControl( SID_AVMEDIA_TOOLBOX, pMod );
271 0 : XmlSecStatusBarControl::RegisterControl( SID_SIGNATURE, pMod );
272 0 : SdTemplateControl::RegisterControl( SID_STATUS_LAYOUT, pMod );
273 0 : SvxTableToolBoxControl::RegisterControl(SID_INSERT_TABLE, pMod );
274 0 : SvxFrameLineStyleToolBoxControl::RegisterControl(SID_FRAME_LINESTYLE, pMod );
275 0 : SvxFrameLineColorToolBoxControl::RegisterControl(SID_FRAME_LINECOLOR, pMod );
276 0 : SvxFrameToolBoxControl::RegisterControl(SID_ATTR_BORDER, pMod );
277 0 : SvxSubToolBoxControl::RegisterControl(SID_OPTIMIZE_TABLE, pMod);
278 0 : }
279 :
280 0 : void SdDLL::Init()
281 : {
282 0 : if ( SD_MOD() )
283 0 : return;
284 :
285 0 : SfxObjectFactory* pDrawFact = NULL;
286 0 : SfxObjectFactory* pImpressFact = NULL;
287 :
288 0 : if (SvtModuleOptions().IsImpress())
289 0 : pImpressFact = &::sd::DrawDocShell::Factory();
290 :
291 0 : if (SvtModuleOptions().IsDraw())
292 0 : pDrawFact = &::sd::GraphicDocShell::Factory();
293 :
294 : // the SdModule must be created
295 0 : 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 0 : if( pImpressFact )
301 : {
302 0 : (*ppShlPtr) = new SdModule( pImpressFact, pDrawFact );
303 : }
304 : else
305 : {
306 0 : (*ppShlPtr) = new SdModule( pDrawFact, pImpressFact );
307 : }
308 :
309 0 : if (SvtModuleOptions().IsImpress())
310 : {
311 : // Register the Impress shape types in order to make the shapes accessible.
312 0 : ::accessibility::RegisterImpressShapeTypes ();
313 0 : ::sd::DrawDocShell::Factory().SetDocumentServiceName( "com.sun.star.presentation.PresentationDocument" );
314 : }
315 :
316 0 : if (SvtModuleOptions().IsDraw())
317 : {
318 0 : ::sd::GraphicDocShell::Factory().SetDocumentServiceName( "com.sun.star.drawing.DrawingDocument" );
319 : }
320 :
321 : // register your view-factories here
322 0 : RegisterFactorys();
323 :
324 : // register your shell-interfaces here
325 0 : RegisterInterfaces();
326 :
327 : // register your controllers here
328 0 : RegisterControllers();
329 :
330 : // register SvDraw-Fields
331 0 : SdrRegisterFieldClasses();
332 :
333 : // register 3D-Objekt-Factory
334 0 : E3dObjFactory();
335 :
336 : // register ::com::sun::star::form::component::Form-Object-Factory
337 0 : FmFormObjFactory();
338 :
339 : // register Object-Factory
340 0 : SdrObjFactory::InsertMakeUserDataHdl(LINK(&aSdObjectFactory, SdObjectFactory, MakeUserData));
341 :
342 : // register your exotic remote controlls here
343 : #ifdef ENABLE_SDREMOTE
344 0 : if ( !Application::IsHeadlessModeRequested() )
345 0 : RegisterRemotes();
346 : #endif
347 0 : }
348 :
349 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|