1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 <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>
31 #include "registerinterfaces.hxx"
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"
55 #include "SpellDialogChildWindow.hxx"
56 #include "SlideSorterViewShell.hxx"
57 #include "SlideSorterViewShellBase.hxx"
59 #include "SdShapeTypes.hxx"
61 #include "TextObjectBar.hxx"
62 #include "tmplctrl.hxx"
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/ParaLineSpacingPopup.hxx>
75 #include <svx/grafctrl.hxx>
76 #include <svx/hyperdlg.hxx>
77 #include <svx/imapdlg.hxx>
78 #include <svx/layctrl.hxx>
79 #include <svx/lboxctrl.hxx>
80 #include <svx/linectrl.hxx>
81 #include <svx/modctrl.hxx>
82 #include <svx/pszctrl.hxx>
83 #include <svx/srchdlg.hxx>
84 #include <svx/subtoolboxcontrol.hxx>
85 #include <svx/SvxColorChildWindow.hxx>
86 #include <svx/SvxShapeTypes.hxx>
87 #include <svx/tbcontrl.hxx>
88 #include <svx/tbxcustomshapes.hxx>
89 #include <svx/verttexttbxctrl.hxx>
90 #include <svx/xmlsecctrl.hxx>
91 #include <svx/zoomctrl.hxx>
92 #include <svx/zoomsliderctrl.hxx>
93 #include <sfx2/docfilt.hxx>
94 #include <sfx2/docfile.hxx>
95 #include <sfx2/fcontnr.hxx>
96 #include <sfx2/sidebar/SidebarChildWindow.hxx>
97 #include <vcl/FilterConfigItem.hxx>
98 #include <comphelper/processfactory.hxx>
100 using namespace ::com::sun::star
;
102 // Register all Factories
103 void SdDLL::RegisterFactorys()
105 if (SvtModuleOptions().IsImpress())
107 ::sd::ImpressViewShellBase::RegisterFactory (
108 ::sd::IMPRESS_FACTORY_ID
);
109 ::sd::SlideSorterViewShellBase::RegisterFactory (
110 ::sd::SLIDE_SORTER_FACTORY_ID
);
111 ::sd::OutlineViewShellBase::RegisterFactory (
112 ::sd::OUTLINE_FACTORY_ID
);
113 ::sd::PresentationViewShellBase::RegisterFactory (
114 ::sd::PRESENTATION_FACTORY_ID
);
116 if (SvtModuleOptions().IsDraw())
118 ::sd::GraphicViewShellBase::RegisterFactory (::sd::DRAW_FACTORY_ID
);
122 // Register all Interfaces
124 void SdDLL::RegisterInterfaces()
127 SfxModule
* pMod
= SD_MOD();
128 SdModule::RegisterInterface(pMod
);
131 ::sd::ViewShellBase::RegisterInterface(pMod
);
134 ::sd::DrawDocShell::RegisterInterface(pMod
);
135 ::sd::GraphicDocShell::RegisterInterface(pMod
);
137 // Impress ViewShells
138 ::sd::DrawViewShell::RegisterInterface(pMod
);
139 ::sd::OutlineViewShell::RegisterInterface(pMod
);
140 ::sd::PresentationViewShell::RegisterInterface(pMod
);
143 ::sd::GraphicViewShell::RegisterInterface(pMod
);
145 // Impress ObjectShells
146 ::sd::BezierObjectBar::RegisterInterface(pMod
);
147 ::sd::TextObjectBar::RegisterInterface(pMod
);
148 ::sd::GraphicObjectBar::RegisterInterface(pMod
);
151 ::sd::MediaObjectBar::RegisterInterface(pMod
);
154 ::sd::ui::table::RegisterInterfaces(pMod
);
156 // View shells for the side panes.
157 ::sd::slidesorter::SlideSorterViewShell::RegisterInterface (pMod
);
160 // Register all Controllers
162 void SdDLL::RegisterControllers()
164 SfxModule
* pMod
= SD_MOD();
166 // ToolBoxControls registrieren
167 SdTbxControl::RegisterControl( SID_OBJECT_ALIGN
, pMod
);
168 SdTbxControl::RegisterControl( SID_ZOOM_TOOLBOX
, pMod
);
169 SdTbxControl::RegisterControl( SID_OBJECT_CHOOSE_MODE
, pMod
);
170 SdTbxControl::RegisterControl( SID_POSITION
, pMod
);
171 SdTbxControl::RegisterControl( SID_DRAWTBX_TEXT
, pMod
);
172 SdTbxControl::RegisterControl( SID_DRAWTBX_RECTANGLES
, pMod
);
173 SdTbxControl::RegisterControl( SID_DRAWTBX_ELLIPSES
, pMod
);
174 SdTbxControl::RegisterControl( SID_DRAWTBX_LINES
, pMod
);
175 SdTbxControl::RegisterControl( SID_DRAWTBX_ARROWS
, pMod
);
176 SdTbxControl::RegisterControl( SID_DRAWTBX_3D_OBJECTS
, pMod
);
177 SdTbxControl::RegisterControl( SID_DRAWTBX_CONNECTORS
, pMod
);
178 SdTbxControl::RegisterControl( SID_DRAWTBX_INSERT
, pMod
);
180 SvxTbxCtlCustomShapes::RegisterControl( SID_DRAWTBX_CS_BASIC
, pMod
);
181 SvxTbxCtlCustomShapes::RegisterControl( SID_DRAWTBX_CS_SYMBOL
, pMod
);
182 SvxTbxCtlCustomShapes::RegisterControl( SID_DRAWTBX_CS_ARROW
, pMod
);
183 SvxTbxCtlCustomShapes::RegisterControl( SID_DRAWTBX_CS_FLOWCHART
, pMod
);
184 SvxTbxCtlCustomShapes::RegisterControl( SID_DRAWTBX_CS_CALLOUT
, pMod
);
185 SvxTbxCtlCustomShapes::RegisterControl( SID_DRAWTBX_CS_STAR
, pMod
);
187 SdTbxCtlDiaPages::RegisterControl( SID_PAGES_PER_ROW
, pMod
);
188 SdTbxCtlGlueEscDir::RegisterControl( SID_GLUE_ESCDIR
, pMod
);
190 ::sd::AnimationChildWindow::RegisterChildWindow(false, pMod
);
191 ::sd::NavigatorChildWindow::RegisterChildWindowContext( (sal_uInt16
) ::sd::DrawViewShell::GetInterfaceId(), pMod
);
192 ::sd::NavigatorChildWindow::RegisterChildWindowContext( (sal_uInt16
) ::sd::GraphicViewShell::GetInterfaceId(), pMod
);
194 Svx3DChildWindow::RegisterChildWindow(false, pMod
);
195 SvxFontWorkChildWindow::RegisterChildWindow(false, pMod
);
196 SvxColorChildWindow::RegisterChildWindow(false, pMod
, SfxChildWindowFlags::TASK
);
197 SvxSearchDialogWrapper::RegisterChildWindow(false, pMod
);
198 SvxBmpMaskChildWindow::RegisterChildWindow(false, pMod
);
199 SvxIMapDlgChildWindow::RegisterChildWindow(false, pMod
);
200 SvxHlinkDlgWrapper::RegisterChildWindow(false, pMod
);
201 ::sd::SpellDialogChildWindow::RegisterChildWindow(false, pMod
);
202 ::avmedia::MediaPlayer::RegisterChildWindow(false, pMod
);
203 ::sd::LeftPaneImpressChildWindow::RegisterChildWindow(false, pMod
);
204 ::sd::LeftPaneDrawChildWindow::RegisterChildWindow(false, pMod
);
205 ::sfx2::sidebar::SidebarChildWindow::RegisterChildWindow(false, pMod
);
207 SvxFillToolBoxControl::RegisterControl(0, pMod
);
208 SvxLineStyleToolBoxControl::RegisterControl(0, pMod
);
209 SvxLineWidthToolBoxControl::RegisterControl(0, pMod
);
210 SvxColorToolBoxControl::RegisterControl(SID_ATTR_LINE_COLOR
, pMod
);
211 SvxColorToolBoxControl::RegisterControl(SID_ATTR_FILL_COLOR
, pMod
);
213 SvxLineEndToolBoxControl::RegisterControl( SID_ATTR_LINEEND_STYLE
, pMod
);
215 SvxStyleToolBoxControl::RegisterControl(0, pMod
);
216 SvxFontNameToolBoxControl::RegisterControl(0, pMod
);
217 SvxColorToolBoxControl::RegisterControl( SID_ATTR_CHAR_COLOR
, pMod
);
218 SvxColorToolBoxControl::RegisterControl( SID_ATTR_CHAR_BACK_COLOR
, pMod
);
220 SvxGrafFilterToolBoxControl::RegisterControl( SID_GRFFILTER
, pMod
);
221 SvxGrafModeToolBoxControl::RegisterControl( SID_ATTR_GRAF_MODE
, pMod
);
222 SvxGrafRedToolBoxControl::RegisterControl( SID_ATTR_GRAF_RED
, pMod
);
223 SvxGrafGreenToolBoxControl::RegisterControl( SID_ATTR_GRAF_GREEN
, pMod
);
224 SvxGrafBlueToolBoxControl::RegisterControl( SID_ATTR_GRAF_BLUE
, pMod
);
225 SvxGrafLuminanceToolBoxControl::RegisterControl( SID_ATTR_GRAF_LUMINANCE
, pMod
);
226 SvxGrafContrastToolBoxControl::RegisterControl( SID_ATTR_GRAF_CONTRAST
, pMod
);
227 SvxGrafGammaToolBoxControl::RegisterControl( SID_ATTR_GRAF_GAMMA
, pMod
);
228 SvxGrafTransparenceToolBoxControl::RegisterControl( SID_ATTR_GRAF_TRANSPARENCE
, pMod
);
229 SvxVertTextTbxCtrl::RegisterControl(SID_TEXTDIRECTION_TOP_TO_BOTTOM
, pMod
);
230 SvxVertTextTbxCtrl::RegisterControl(SID_TEXTDIRECTION_LEFT_TO_RIGHT
, pMod
);
231 SvxVertTextTbxCtrl::RegisterControl(SID_DRAW_CAPTION_VERTICAL
, pMod
);
232 SvxVertTextTbxCtrl::RegisterControl(SID_DRAW_FONTWORK_VERTICAL
, pMod
);
233 SvxVertTextTbxCtrl::RegisterControl(SID_DRAW_TEXT_VERTICAL
, pMod
);
234 SvxVertTextTbxCtrl::RegisterControl(SID_TEXT_FITTOSIZE_VERTICAL
, pMod
);
235 SvxCTLTextTbxCtrl::RegisterControl(SID_ATTR_PARA_LEFT_TO_RIGHT
, pMod
);
236 SvxCTLTextTbxCtrl::RegisterControl(SID_ATTR_PARA_RIGHT_TO_LEFT
, pMod
);
238 // register StatusBarControls
239 SvxZoomPageStatusBarControl::RegisterControl( SID_ZOOM_ENTIRE_PAGE
, pMod
);
240 SvxZoomStatusBarControl::RegisterControl( SID_ATTR_ZOOM
, pMod
);
241 SvxPosSizeStatusBarControl::RegisterControl( SID_ATTR_SIZE
, pMod
);
242 SvxModifyControl::RegisterControl( SID_DOC_MODIFIED
, pMod
);
243 SvxZoomSliderControl::RegisterControl( SID_ATTR_ZOOMSLIDER
, pMod
);
245 // MenuControls for PopupMenu
246 SvxFontMenuControl::RegisterControl( SID_ATTR_CHAR_FONT
, pMod
);
247 SvxFontSizeMenuControl::RegisterControl( SID_ATTR_CHAR_FONTHEIGHT
, pMod
);
249 SfxMenuControl::RegisterControl( SID_SET_SNAPITEM
, pMod
);
250 SfxMenuControl::RegisterControl( SID_DELETE_SNAPITEM
, pMod
);
251 SfxMenuControl::RegisterControl( SID_BEZIER_CLOSE
, pMod
);
254 SvxUndoRedoControl::RegisterControl( SID_UNDO
, pMod
);
255 SvxUndoRedoControl::RegisterControl( SID_REDO
, pMod
);
257 svx::FormatPaintBrushToolBoxControl::RegisterControl(SID_FORMATPAINTBRUSH
, pMod
);
259 SvxClipBoardControl::RegisterControl( SID_PASTE
, pMod
);
260 SvxClipBoardControl::RegisterControl( SID_PASTE_UNFORMATTED
, pMod
);
262 SvxColorToolBoxControl::RegisterControl( SID_EXTRUSION_3D_COLOR
, pMod
);
263 svx::FontWorkShapeTypeControl::RegisterControl( SID_FONTWORK_SHAPE_TYPE
, pMod
);
264 svx::ParaLineSpacingPopup::RegisterControl(SID_ATTR_PARA_LINESPACE
, pMod
);
266 ::avmedia::MediaToolBoxControl::RegisterControl( SID_AVMEDIA_TOOLBOX
, pMod
);
267 XmlSecStatusBarControl::RegisterControl( SID_SIGNATURE
, pMod
);
268 SdTemplateControl::RegisterControl( SID_STATUS_LAYOUT
, pMod
);
269 SvxTableToolBoxControl::RegisterControl(SID_INSERT_TABLE
, pMod
);
270 SvxFrameLineStyleToolBoxControl::RegisterControl(SID_FRAME_LINESTYLE
, pMod
);
271 SvxColorToolBoxControl::RegisterControl(SID_FRAME_LINECOLOR
, pMod
);
272 SvxFrameToolBoxControl::RegisterControl(SID_ATTR_BORDER
, pMod
);
273 SvxSubToolBoxControl::RegisterControl(SID_OPTIMIZE_TABLE
, pMod
);
281 SfxObjectFactory
* pDrawFact
= NULL
;
282 SfxObjectFactory
* pImpressFact
= NULL
;
284 if (SvtModuleOptions().IsImpress())
285 pImpressFact
= &::sd::DrawDocShell::Factory();
287 if (SvtModuleOptions().IsDraw())
288 pDrawFact
= &::sd::GraphicDocShell::Factory();
290 // the SdModule must be created
291 SdModule
** ppShlPtr
= reinterpret_cast<SdModule
**>(GetAppData(SHL_DRAW
));
294 // The SfxModule::SfxModule stops when the first given factory
295 // is 0, so we must not give a 0 as first factory
298 (*ppShlPtr
) = new SdModule( pImpressFact
, pDrawFact
);
302 (*ppShlPtr
) = new SdModule( pDrawFact
, pImpressFact
);
305 if (SvtModuleOptions().IsImpress())
307 // Register the Impress shape types in order to make the shapes accessible.
308 ::accessibility::RegisterImpressShapeTypes ();
309 ::sd::DrawDocShell::Factory().SetDocumentServiceName( "com.sun.star.presentation.PresentationDocument" );
312 if (SvtModuleOptions().IsDraw())
314 ::sd::GraphicDocShell::Factory().SetDocumentServiceName( "com.sun.star.drawing.DrawingDocument" );
317 // register your view-factories here
320 // register your shell-interfaces here
321 RegisterInterfaces();
323 // register your controllers here
324 RegisterControllers();
326 // register SvDraw-Fields
327 SdrRegisterFieldClasses();
329 // register 3D-Objekt-Factory
332 // register ::com::sun::star::form::component::Form-Object-Factory
335 // register Object-Factory
336 SdrObjFactory::InsertMakeUserDataHdl(LINK(&aSdObjectFactory
, SdObjectFactory
, MakeUserData
));
338 // register your exotic remote controls here
339 #ifdef ENABLE_SDREMOTE
340 if ( !Application::IsHeadlessModeEnabled() )
345 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */