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 <editeng/eeitem.hxx>
21 :
22 :
23 : #include <svx/fmobjfac.hxx>
24 : #include <svx/objfac3d.hxx>
25 : #include <svx/tbxcolor.hxx>
26 :
27 : #include <comphelper/classids.hxx>
28 : #include <sfx2/taskpane.hxx>
29 : #include <sfx2/sidebar/SidebarChildWindow.hxx>
30 : #include <sfx2/docfilt.hxx>
31 : #include <sfx2/fcontnr.hxx>
32 : #include <sfx2/docfile.hxx>
33 : #include <sfx2/app.hxx>
34 : #include <avmedia/mediaplayer.hxx>
35 : #include <avmedia/mediatoolbox.hxx>
36 : #include <comphelper/types.hxx>
37 : #include <svx/extrusioncolorcontrol.hxx>
38 : #include <svx/fontworkgallery.hxx>
39 : #include <svx/tbxcustomshapes.hxx>
40 :
41 : #include <svtools/parhtml.hxx>
42 : #include <sot/formats.hxx>
43 :
44 : #include "scitems.hxx"
45 : #include "scmod.hxx"
46 : #include "scresid.hxx"
47 : #include "sc.hrc"
48 : #include "cfgids.hxx"
49 :
50 : //! Here used to be an old German comment: "die Registrierung wird
51 : //! wegen CLOOKs in ein eigenes File wandern muessen..." which refers
52 : //! to the infamous CLOOK (Compiler Limit: Out of Keys) problem
53 : //! (http://msdn.microsoft.com/en-us/library/3d859kh1(v=vs.71).aspx ,
54 : //! which has not been relevant for many years. Presumably that is
55 : //! supposed to explain some odd arrangement of source code, or
56 : //! something. Or maybe that comment is completely irrelevant.
57 :
58 : #include "docsh.hxx"
59 : #include "tabvwsh.hxx"
60 : #include "prevwsh.hxx"
61 : #include "drawsh.hxx"
62 : #include "drformsh.hxx"
63 : #include "drtxtob.hxx"
64 : #include "editsh.hxx"
65 : #include "pivotsh.hxx"
66 : #include "auditsh.hxx"
67 : #include "cellsh.hxx"
68 : #include "oleobjsh.hxx"
69 : #include "chartsh.hxx"
70 : #include "graphsh.hxx"
71 : #include "mediash.hxx"
72 : #include "pgbrksh.hxx"
73 :
74 : #include "docpool.hxx"
75 : #include "appoptio.hxx"
76 :
77 : // Controls
78 :
79 : #include <svx/tbxalign.hxx>
80 : #include <svx/tbxctl.hxx>
81 : #include <svx/fillctrl.hxx>
82 : #include <svx/linectrl.hxx>
83 : #include <svx/tbcontrl.hxx>
84 : #include <svx/selctrl.hxx>
85 : #include <svx/insctrl.hxx>
86 : #include <svx/zoomctrl.hxx>
87 : #include <editeng/flditem.hxx>
88 : #include <svx/modctrl.hxx>
89 : #include <svx/pszctrl.hxx>
90 : #include <svx/fntctl.hxx>
91 : #include <svx/fntszctl.hxx>
92 : #include <svx/grafctrl.hxx>
93 : #include <svx/galbrws.hxx>
94 : #include <svx/clipboardctl.hxx>
95 : #include <svx/lboxctrl.hxx>
96 : #include <svx/verttexttbxctrl.hxx>
97 : #include <svx/formatpaintbrushctrl.hxx>
98 : #include "tbinsert.hxx"
99 : #include "tbzoomsliderctrl.hxx"
100 : #include <svx/zoomsliderctrl.hxx>
101 :
102 : #include <svx/xmlsecctrl.hxx>
103 : // Child-Windows
104 : #include "reffact.hxx"
105 : #include "navipi.hxx"
106 : #include "inputwin.hxx"
107 : #include "spelldialog.hxx"
108 : #include <svx/fontwork.hxx>
109 : #include <svx/srchdlg.hxx>
110 : #include <svx/hyperdlg.hxx>
111 : #include <svx/imapdlg.hxx>
112 :
113 : #include "editutil.hxx"
114 : #include <svx/svdfield.hxx>
115 :
116 : #include "dwfunctr.hxx"
117 : #include "acredlin.hxx"
118 :
119 :
120 :
121 :
122 16444 : ScResId::ScResId( sal_uInt16 nId ) :
123 16444 : ResId( nId, *SC_MOD()->GetResMgr() )
124 : {
125 16444 : }
126 :
127 814 : void ScDLL::Init()
128 : {
129 814 : ScModule **ppShlPtr = (ScModule**) GetAppData(SHL_CALC);
130 814 : if ( *ppShlPtr )
131 1594 : return;
132 :
133 34 : ScDocumentPool::InitVersionMaps(); // wird im ScModule ctor gebraucht
134 :
135 34 : ScModule* pMod = new ScModule( &ScDocShell::Factory() );
136 34 : (*ppShlPtr) = pMod;
137 :
138 34 : ScDocShell::Factory().SetDocumentServiceName( OUString( "com.sun.star.sheet.SpreadsheetDocument" ) );
139 :
140 34 : ScGlobal::Init(); // erst wenn der ResManager initialisiert ist
141 : // erst nach ScGlobal::Init duerfen die App-Optionen
142 : // initialisiert werden
143 :
144 : // register your view-factories here
145 :
146 34 : ScTabViewShell ::RegisterFactory(1);
147 34 : ScPreviewShell ::RegisterFactory(2);
148 :
149 : // register your shell-interfaces here
150 :
151 34 : ScModule ::RegisterInterface(pMod);
152 34 : ScDocShell ::RegisterInterface(pMod);
153 34 : ScTabViewShell ::RegisterInterface(pMod);
154 34 : ScPreviewShell ::RegisterInterface(pMod);
155 34 : ScDrawShell ::RegisterInterface(pMod);
156 34 : ScDrawFormShell ::RegisterInterface(pMod);
157 34 : ScDrawTextObjectBar ::RegisterInterface(pMod);
158 34 : ScEditShell ::RegisterInterface(pMod);
159 34 : ScPivotShell ::RegisterInterface(pMod);
160 34 : ScAuditingShell ::RegisterInterface(pMod);
161 34 : ScFormatShell ::RegisterInterface(pMod);
162 34 : ScCellShell ::RegisterInterface(pMod);
163 34 : ScOleObjectShell ::RegisterInterface(pMod);
164 34 : ScChartShell ::RegisterInterface(pMod);
165 34 : ScGraphicShell ::RegisterInterface(pMod);
166 34 : ScMediaShell ::RegisterInterface(pMod);
167 34 : ScPageBreakShell ::RegisterInterface(pMod);
168 :
169 34 : SfxRecentFilesToolBoxControl::RegisterControl(SID_OPEN_CALC, pMod);
170 :
171 : // eigene Controller
172 34 : ScTbxInsertCtrl ::RegisterControl(SID_TBXCTL_INSERT, pMod);
173 34 : ScTbxInsertCtrl ::RegisterControl(SID_TBXCTL_INSCELLS, pMod);
174 34 : ScTbxInsertCtrl ::RegisterControl(SID_TBXCTL_INSOBJ, pMod);
175 34 : ScZoomSliderControl ::RegisterControl(SID_PREVIEW_SCALINGFACTOR, pMod);
176 :
177 : // Svx-Toolbox-Controller
178 34 : SvxTbxCtlDraw ::RegisterControl(SID_INSERT_DRAW, pMod);
179 34 : SvxTbxCtlCustomShapes ::RegisterControl(SID_DRAWTBX_CS_BASIC, pMod);
180 34 : SvxTbxCtlCustomShapes ::RegisterControl(SID_DRAWTBX_CS_SYMBOL, pMod);
181 34 : SvxTbxCtlCustomShapes ::RegisterControl(SID_DRAWTBX_CS_ARROW, pMod);
182 34 : SvxTbxCtlCustomShapes ::RegisterControl(SID_DRAWTBX_CS_FLOWCHART, pMod);
183 34 : SvxTbxCtlCustomShapes ::RegisterControl(SID_DRAWTBX_CS_CALLOUT, pMod);
184 34 : SvxTbxCtlCustomShapes ::RegisterControl(SID_DRAWTBX_CS_STAR, pMod);
185 34 : SvxTbxCtlAlign ::RegisterControl(SID_OBJECT_ALIGN, pMod);
186 34 : SvxFillToolBoxControl ::RegisterControl(0, pMod);
187 34 : SvxLineStyleToolBoxControl ::RegisterControl(0, pMod);
188 34 : SvxLineWidthToolBoxControl ::RegisterControl(0, pMod);
189 34 : SvxLineColorToolBoxControl ::RegisterControl(0, pMod);
190 34 : SvxLineEndToolBoxControl ::RegisterControl(SID_ATTR_LINEEND_STYLE, pMod);
191 34 : SvxStyleToolBoxControl ::RegisterControl(SID_STYLE_APPLY, pMod);
192 34 : SvxFontNameToolBoxControl ::RegisterControl(SID_ATTR_CHAR_FONT, pMod);
193 34 : SvxColorExtToolBoxControl ::RegisterControl(SID_ATTR_CHAR_COLOR, pMod);
194 34 : SvxColorExtToolBoxControl ::RegisterControl(SID_BACKGROUND_COLOR, pMod);
195 34 : SvxFrameToolBoxControl ::RegisterControl(SID_ATTR_BORDER, pMod);
196 34 : SvxFrameLineStyleToolBoxControl ::RegisterControl(SID_FRAME_LINESTYLE, pMod);
197 34 : SvxColorExtToolBoxControl ::RegisterControl(SID_FRAME_LINECOLOR, pMod);
198 34 : SvxClipBoardControl ::RegisterControl(SID_PASTE, pMod );
199 34 : SvxUndoRedoControl ::RegisterControl(SID_UNDO, pMod );
200 34 : SvxUndoRedoControl ::RegisterControl(SID_REDO, pMod );
201 34 : svx::FormatPaintBrushToolBoxControl::RegisterControl(SID_FORMATPAINTBRUSH, pMod );
202 :
203 34 : SvxGrafModeToolBoxControl ::RegisterControl(SID_ATTR_GRAF_MODE, pMod);
204 34 : SvxGrafRedToolBoxControl ::RegisterControl(SID_ATTR_GRAF_RED, pMod);
205 34 : SvxGrafGreenToolBoxControl ::RegisterControl(SID_ATTR_GRAF_GREEN, pMod);
206 34 : SvxGrafBlueToolBoxControl ::RegisterControl(SID_ATTR_GRAF_BLUE, pMod);
207 34 : SvxGrafLuminanceToolBoxControl ::RegisterControl(SID_ATTR_GRAF_LUMINANCE, pMod);
208 34 : SvxGrafContrastToolBoxControl ::RegisterControl(SID_ATTR_GRAF_CONTRAST, pMod);
209 34 : SvxGrafGammaToolBoxControl ::RegisterControl(SID_ATTR_GRAF_GAMMA, pMod);
210 34 : SvxGrafTransparenceToolBoxControl::RegisterControl(SID_ATTR_GRAF_TRANSPARENCE, pMod);
211 34 : SvxGrafFilterToolBoxControl ::RegisterControl(SID_GRFFILTER, pMod);
212 :
213 34 : SvxVertTextTbxCtrl::RegisterControl(SID_DRAW_CAPTION_VERTICAL, pMod);
214 34 : SvxVertTextTbxCtrl::RegisterControl(SID_DRAW_TEXT_VERTICAL, pMod);
215 34 : SvxVertTextTbxCtrl::RegisterControl(SID_TEXTDIRECTION_LEFT_TO_RIGHT, pMod);
216 34 : SvxVertTextTbxCtrl::RegisterControl(SID_TEXTDIRECTION_TOP_TO_BOTTOM, pMod);
217 34 : SvxCTLTextTbxCtrl::RegisterControl(SID_ATTR_PARA_LEFT_TO_RIGHT, pMod);
218 34 : SvxCTLTextTbxCtrl::RegisterControl(SID_ATTR_PARA_RIGHT_TO_LEFT, pMod);
219 :
220 : //Media Controller
221 34 : ::avmedia::MediaToolBoxControl::RegisterControl( SID_AVMEDIA_TOOLBOX, pMod );
222 :
223 : // common SFX controller
224 34 : ::sfx2::TaskPaneWrapper::RegisterChildWindow( false, pMod );
225 34 : ::sfx2::sidebar::SidebarChildWindow::RegisterChildWindow(false, pMod);
226 :
227 : // Svx-StatusBar-Controller
228 34 : SvxInsertStatusBarControl ::RegisterControl(SID_ATTR_INSERT, pMod);
229 34 : SvxSelectionModeControl ::RegisterControl(SID_STATUS_SELMODE, pMod);
230 34 : SvxZoomStatusBarControl ::RegisterControl(SID_ATTR_ZOOM, pMod);
231 34 : SvxZoomSliderControl ::RegisterControl(SID_ATTR_ZOOMSLIDER, pMod);
232 34 : SvxModifyControl ::RegisterControl(SID_DOC_MODIFIED, pMod);
233 34 : XmlSecStatusBarControl ::RegisterControl( SID_SIGNATURE, pMod );
234 :
235 34 : SvxPosSizeStatusBarControl ::RegisterControl(SID_ATTR_SIZE, pMod);
236 :
237 : // Svx-Menue-Controller
238 34 : SvxFontMenuControl ::RegisterControl(SID_ATTR_CHAR_FONT, pMod);
239 34 : SvxFontSizeMenuControl ::RegisterControl(SID_ATTR_CHAR_FONTHEIGHT, pMod);
240 :
241 : // CustomShape extrusion controller
242 34 : svx::ExtrusionColorControl::RegisterControl( SID_EXTRUSION_3D_COLOR, pMod );
243 34 : svx::FontWorkShapeTypeControl::RegisterControl( SID_FONTWORK_SHAPE_TYPE, pMod );
244 :
245 : // Child-Windows
246 :
247 34 : ScInputWindowWrapper ::RegisterChildWindow(true, pMod, SFX_CHILDWIN_TASK|SFX_CHILDWIN_FORCEDOCK);
248 34 : ScNavigatorDialogWrapper ::RegisterChildWindowContext(static_cast<sal_uInt16>(ScTabViewShell::GetInterfaceId()), pMod);
249 34 : ScSolverDlgWrapper ::RegisterChildWindow(false, pMod);
250 34 : ScOptSolverDlgWrapper ::RegisterChildWindow(false, pMod);
251 34 : ScXMLSourceDlgWrapper ::RegisterChildWindow(false, pMod);
252 34 : ScNameDlgWrapper ::RegisterChildWindow(false, pMod);
253 34 : ScNameDefDlgWrapper ::RegisterChildWindow(false, pMod);
254 34 : ScPivotLayoutWrapper ::RegisterChildWindow(false, pMod);
255 34 : ScTabOpDlgWrapper ::RegisterChildWindow(false, pMod);
256 34 : ScFilterDlgWrapper ::RegisterChildWindow(false, pMod);
257 34 : ScSpecialFilterDlgWrapper ::RegisterChildWindow(false, pMod);
258 34 : ScDbNameDlgWrapper ::RegisterChildWindow(false, pMod);
259 34 : ScConsolidateDlgWrapper ::RegisterChildWindow(false, pMod);
260 34 : ScPrintAreasDlgWrapper ::RegisterChildWindow(false, pMod);
261 34 : ScColRowNameRangesDlgWrapper::RegisterChildWindow(false, pMod);
262 34 : ScFormulaDlgWrapper ::RegisterChildWindow(false, pMod);
263 :
264 34 : ScRandomNumberGeneratorDialogWrapper::RegisterChildWindow(false, pMod);
265 34 : ScSamplingDialogWrapper ::RegisterChildWindow(false, pMod);
266 34 : ScDescriptiveStatisticsDialogWrapper::RegisterChildWindow(false, pMod);
267 34 : ScAnalysisOfVarianceDialogWrapper ::RegisterChildWindow(false, pMod);
268 34 : ScCorrelationDialogWrapper ::RegisterChildWindow(false, pMod);
269 34 : ScCovarianceDialogWrapper ::RegisterChildWindow(false, pMod);
270 34 : ScExponentialSmoothingDialogWrapper ::RegisterChildWindow(false, pMod);
271 34 : ScMovingAverageDialogWrapper ::RegisterChildWindow(false, pMod);
272 34 : ScTTestDialogWrapper ::RegisterChildWindow(false, pMod);
273 :
274 : // First docking Window for Calc
275 34 : ScFunctionChildWindow ::RegisterChildWindow(false, pMod);
276 :
277 : // Redlining- Window
278 34 : ScAcceptChgDlgWrapper ::RegisterChildWindow(false, pMod);
279 34 : ScSimpleRefDlgWrapper ::RegisterChildWindow(false, pMod, SFX_CHILDWIN_ALWAYSAVAILABLE|SFX_CHILDWIN_NEVERHIDE );
280 34 : ScHighlightChgDlgWrapper ::RegisterChildWindow(false, pMod);
281 :
282 34 : SvxSearchDialogWrapper ::RegisterChildWindow(false, pMod);
283 34 : SvxHlinkDlgWrapper ::RegisterChildWindow(false, pMod);
284 34 : SvxFontWorkChildWindow ::RegisterChildWindow(false, pMod);
285 34 : SvxIMapDlgChildWindow ::RegisterChildWindow(false, pMod);
286 34 : GalleryChildWindow ::RegisterChildWindow(false, pMod);
287 34 : ScSpellDialogChildWindow ::RegisterChildWindow(false, pMod);
288 :
289 34 : ScValidityRefChildWin::RegisterChildWindow(false, pMod);
290 :
291 : // Edit-Engine-Felder, soweit nicht schon in OfficeApplication::Init
292 :
293 34 : SvClassManager& rClassManager = SvxFieldItem::GetClassManager();
294 34 : rClassManager.Register(SvxPagesField::StaticClassId(), SvxPagesField::CreateInstance);
295 34 : rClassManager.Register(SvxFileField::StaticClassId(), SvxFileField::CreateInstance);
296 34 : rClassManager.Register(SvxTableField::StaticClassId(), SvxTableField::CreateInstance);
297 :
298 34 : SdrRegisterFieldClasses(); // SvDraw-Felder registrieren
299 :
300 : // 3D-Objekt-Factory eintragen
301 34 : E3dObjFactory();
302 :
303 : // ::com::sun::star::form::component::Form-Objekt-Factory eintragen
304 34 : FmFormObjFactory();
305 :
306 34 : pMod->PutItem( SfxUInt16Item( SID_ATTR_METRIC, sal::static_int_cast<sal_uInt16>(pMod->GetAppOptions().GetAppMetric()) ) );
307 :
308 : // StarOne Services are now handled in the registry
309 102 : }
310 :
311 : // DetectFilter functionality has moved - please update your bookmarks
312 : // see sc/source/ui/unoobj/scdetect.cxx, have a nice day.
313 :
314 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|