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 : #include <svx/fmobjfac.hxx>
23 : #include <svx/objfac3d.hxx>
24 : #include <svx/tbxcolor.hxx>
25 :
26 : #include <comphelper/classids.hxx>
27 : #include <sfx2/taskpane.hxx>
28 : #include <sfx2/sidebar/SidebarChildWindow.hxx>
29 : #include <sfx2/docfilt.hxx>
30 : #include <sfx2/fcontnr.hxx>
31 : #include <sfx2/docfile.hxx>
32 : #include <sfx2/app.hxx>
33 : #include <avmedia/mediaplayer.hxx>
34 : #include <avmedia/mediatoolbox.hxx>
35 : #include <comphelper/types.hxx>
36 : #include <svx/fontworkgallery.hxx>
37 : #include <svx/tbxcustomshapes.hxx>
38 : #include <svx/ParaLineSpacingPopup.hxx>
39 :
40 : #include <svtools/parhtml.hxx>
41 : #include <sot/formats.hxx>
42 :
43 : #include "scitems.hxx"
44 : #include "scmod.hxx"
45 : #include "scresid.hxx"
46 : #include "sc.hrc"
47 : #include "cfgids.hxx"
48 :
49 : #include "docsh.hxx"
50 : #include "tabvwsh.hxx"
51 : #include "prevwsh.hxx"
52 : #include "drawsh.hxx"
53 : #include "drformsh.hxx"
54 : #include "drtxtob.hxx"
55 : #include "editsh.hxx"
56 : #include "pivotsh.hxx"
57 : #include "auditsh.hxx"
58 : #include "cellsh.hxx"
59 : #include "oleobjsh.hxx"
60 : #include "chartsh.hxx"
61 : #include "graphsh.hxx"
62 : #include "mediash.hxx"
63 : #include "pgbrksh.hxx"
64 :
65 : #include "docpool.hxx"
66 : #include "appoptio.hxx"
67 : #include <searchresults.hxx>
68 :
69 : // Controls
70 :
71 : #include <svx/tbxalign.hxx>
72 : #include <svx/tbxctl.hxx>
73 : #include <svx/fillctrl.hxx>
74 : #include <svx/linectrl.hxx>
75 : #include <svx/tbcontrl.hxx>
76 : #include <svx/selctrl.hxx>
77 : #include <svx/insctrl.hxx>
78 : #include <svx/zoomctrl.hxx>
79 : #include <editeng/flditem.hxx>
80 : #include <svx/modctrl.hxx>
81 : #include <svx/pszctrl.hxx>
82 : #include <svx/fntctl.hxx>
83 : #include <svx/fntszctl.hxx>
84 : #include <svx/grafctrl.hxx>
85 : #include <svx/clipboardctl.hxx>
86 : #include <svx/lboxctrl.hxx>
87 : #include <svx/verttexttbxctrl.hxx>
88 : #include <svx/formatpaintbrushctrl.hxx>
89 : #include "tbinsert.hxx"
90 : #include "tbzoomsliderctrl.hxx"
91 : #include <svx/zoomsliderctrl.hxx>
92 :
93 : #include <svx/xmlsecctrl.hxx>
94 : // Child windows
95 : #include "reffact.hxx"
96 : #include "navipi.hxx"
97 : #include "inputwin.hxx"
98 : #include "spelldialog.hxx"
99 : #include <svx/fontwork.hxx>
100 : #include <svx/srchdlg.hxx>
101 : #include <svx/hyperdlg.hxx>
102 : #include <svx/imapdlg.hxx>
103 :
104 : #include "editutil.hxx"
105 : #include <svx/svdfield.hxx>
106 :
107 : #include "dwfunctr.hxx"
108 : #include "acredlin.hxx"
109 :
110 21123 : ScResId::ScResId( sal_uInt16 nId ) :
111 21123 : ResId( nId, *SC_MOD()->GetResMgr() )
112 : {
113 21123 : }
114 :
115 1081 : void ScDLL::Init()
116 : {
117 1081 : ScModule **ppShlPtr = reinterpret_cast<ScModule**>(GetAppData(SHL_CALC));
118 1081 : if ( *ppShlPtr )
119 2110 : return;
120 :
121 52 : ScDocumentPool::InitVersionMaps(); // Is needed in the ScModule ctor
122 :
123 52 : ScModule* pMod = new ScModule( &ScDocShell::Factory() );
124 52 : (*ppShlPtr) = pMod;
125 :
126 52 : ScDocShell::Factory().SetDocumentServiceName( OUString( "com.sun.star.sheet.SpreadsheetDocument" ) );
127 :
128 : // Not until the ResManager is initialized
129 : // The AppOptions must be initialized not until after ScGlobal::Init
130 52 : ScGlobal::Init();
131 :
132 : // register your view-factories here
133 52 : ScTabViewShell ::RegisterFactory(1);
134 52 : ScPreviewShell ::RegisterFactory(2);
135 :
136 : // register your shell-interfaces here
137 52 : ScModule ::RegisterInterface(pMod);
138 52 : ScDocShell ::RegisterInterface(pMod);
139 52 : ScTabViewShell ::RegisterInterface(pMod);
140 52 : ScPreviewShell ::RegisterInterface(pMod);
141 52 : ScDrawShell ::RegisterInterface(pMod);
142 52 : ScDrawFormShell ::RegisterInterface(pMod);
143 52 : ScDrawTextObjectBar ::RegisterInterface(pMod);
144 52 : ScEditShell ::RegisterInterface(pMod);
145 52 : ScPivotShell ::RegisterInterface(pMod);
146 52 : ScAuditingShell ::RegisterInterface(pMod);
147 52 : ScFormatShell ::RegisterInterface(pMod);
148 52 : ScCellShell ::RegisterInterface(pMod);
149 52 : ScOleObjectShell ::RegisterInterface(pMod);
150 52 : ScChartShell ::RegisterInterface(pMod);
151 52 : ScGraphicShell ::RegisterInterface(pMod);
152 52 : ScMediaShell ::RegisterInterface(pMod);
153 52 : ScPageBreakShell ::RegisterInterface(pMod);
154 :
155 52 : SfxRecentFilesToolBoxControl::RegisterControl(SID_OPEN_CALC, pMod);
156 :
157 : // Own Controller
158 52 : ScTbxInsertCtrl ::RegisterControl(SID_TBXCTL_INSERT, pMod);
159 52 : ScTbxInsertCtrl ::RegisterControl(SID_TBXCTL_INSCELLS, pMod);
160 52 : ScTbxInsertCtrl ::RegisterControl(SID_TBXCTL_INSOBJ, pMod);
161 52 : ScZoomSliderControl ::RegisterControl(SID_PREVIEW_SCALINGFACTOR, pMod);
162 :
163 : // SvxToolboxController
164 52 : SvxTbxCtlDraw ::RegisterControl(SID_INSERT_DRAW, pMod);
165 52 : SvxTbxCtlCustomShapes ::RegisterControl(SID_DRAWTBX_CS_BASIC, pMod);
166 52 : SvxTbxCtlCustomShapes ::RegisterControl(SID_DRAWTBX_CS_SYMBOL, pMod);
167 52 : SvxTbxCtlCustomShapes ::RegisterControl(SID_DRAWTBX_CS_ARROW, pMod);
168 52 : SvxTbxCtlCustomShapes ::RegisterControl(SID_DRAWTBX_CS_FLOWCHART, pMod);
169 52 : SvxTbxCtlCustomShapes ::RegisterControl(SID_DRAWTBX_CS_CALLOUT, pMod);
170 52 : SvxTbxCtlCustomShapes ::RegisterControl(SID_DRAWTBX_CS_STAR, pMod);
171 52 : SvxTbxCtlAlign ::RegisterControl(SID_OBJECT_ALIGN, pMod);
172 52 : SvxFillToolBoxControl ::RegisterControl(0, pMod);
173 52 : SvxLineStyleToolBoxControl ::RegisterControl(0, pMod);
174 52 : SvxLineWidthToolBoxControl ::RegisterControl(0, pMod);
175 52 : SvxColorToolBoxControl ::RegisterControl(SID_ATTR_LINE_COLOR, pMod);
176 52 : SvxColorToolBoxControl ::RegisterControl(SID_ATTR_FILL_COLOR, pMod);
177 52 : SvxLineEndToolBoxControl ::RegisterControl(SID_ATTR_LINEEND_STYLE, pMod);
178 52 : SvxStyleToolBoxControl ::RegisterControl(SID_STYLE_APPLY, pMod);
179 52 : SvxFontNameToolBoxControl ::RegisterControl(SID_ATTR_CHAR_FONT, pMod);
180 52 : SvxColorToolBoxControl ::RegisterControl(SID_ATTR_CHAR_COLOR, pMod);
181 52 : SvxColorToolBoxControl ::RegisterControl(SID_BACKGROUND_COLOR, pMod);
182 52 : SvxFrameToolBoxControl ::RegisterControl(SID_ATTR_BORDER, pMod);
183 52 : SvxFrameLineStyleToolBoxControl ::RegisterControl(SID_FRAME_LINESTYLE, pMod);
184 52 : SvxColorToolBoxControl ::RegisterControl(SID_FRAME_LINECOLOR, pMod);
185 52 : SvxClipBoardControl ::RegisterControl(SID_PASTE, pMod );
186 52 : SvxUndoRedoControl ::RegisterControl(SID_UNDO, pMod );
187 52 : SvxUndoRedoControl ::RegisterControl(SID_REDO, pMod );
188 52 : svx::ParaLineSpacingPopup ::RegisterControl(SID_ATTR_PARA_LINESPACE, pMod );
189 52 : svx::FormatPaintBrushToolBoxControl::RegisterControl(SID_FORMATPAINTBRUSH, pMod );
190 :
191 52 : SvxGrafModeToolBoxControl ::RegisterControl(SID_ATTR_GRAF_MODE, pMod);
192 52 : SvxGrafRedToolBoxControl ::RegisterControl(SID_ATTR_GRAF_RED, pMod);
193 52 : SvxGrafGreenToolBoxControl ::RegisterControl(SID_ATTR_GRAF_GREEN, pMod);
194 52 : SvxGrafBlueToolBoxControl ::RegisterControl(SID_ATTR_GRAF_BLUE, pMod);
195 52 : SvxGrafLuminanceToolBoxControl ::RegisterControl(SID_ATTR_GRAF_LUMINANCE, pMod);
196 52 : SvxGrafContrastToolBoxControl ::RegisterControl(SID_ATTR_GRAF_CONTRAST, pMod);
197 52 : SvxGrafGammaToolBoxControl ::RegisterControl(SID_ATTR_GRAF_GAMMA, pMod);
198 52 : SvxGrafTransparenceToolBoxControl::RegisterControl(SID_ATTR_GRAF_TRANSPARENCE, pMod);
199 52 : SvxGrafFilterToolBoxControl ::RegisterControl(SID_GRFFILTER, pMod);
200 :
201 52 : SvxVertTextTbxCtrl::RegisterControl(SID_DRAW_CAPTION_VERTICAL, pMod);
202 52 : SvxVertTextTbxCtrl::RegisterControl(SID_DRAW_TEXT_VERTICAL, pMod);
203 52 : SvxVertTextTbxCtrl::RegisterControl(SID_TEXTDIRECTION_LEFT_TO_RIGHT, pMod);
204 52 : SvxVertTextTbxCtrl::RegisterControl(SID_TEXTDIRECTION_TOP_TO_BOTTOM, pMod);
205 52 : SvxCTLTextTbxCtrl::RegisterControl(SID_ATTR_PARA_LEFT_TO_RIGHT, pMod);
206 52 : SvxCTLTextTbxCtrl::RegisterControl(SID_ATTR_PARA_RIGHT_TO_LEFT, pMod);
207 :
208 : // Media Controller
209 52 : ::avmedia::MediaToolBoxControl::RegisterControl( SID_AVMEDIA_TOOLBOX, pMod );
210 :
211 : // Common SFX Controller
212 52 : ::sfx2::TaskPaneWrapper::RegisterChildWindow( false, pMod );
213 52 : ::sfx2::sidebar::SidebarChildWindow::RegisterChildWindow(false, pMod);
214 :
215 : // SvxStatusBar Controller
216 52 : SvxInsertStatusBarControl ::RegisterControl(SID_ATTR_INSERT, pMod);
217 52 : SvxSelectionModeControl ::RegisterControl(SID_STATUS_SELMODE, pMod);
218 52 : SvxZoomStatusBarControl ::RegisterControl(SID_ATTR_ZOOM, pMod);
219 52 : SvxZoomSliderControl ::RegisterControl(SID_ATTR_ZOOMSLIDER, pMod);
220 52 : SvxModifyControl ::RegisterControl(SID_DOC_MODIFIED, pMod);
221 52 : XmlSecStatusBarControl ::RegisterControl( SID_SIGNATURE, pMod );
222 :
223 52 : SvxPosSizeStatusBarControl ::RegisterControl(SID_ATTR_SIZE, pMod);
224 :
225 : // SvxMenu Controller
226 52 : SvxFontMenuControl ::RegisterControl(SID_ATTR_CHAR_FONT, pMod);
227 52 : SvxFontSizeMenuControl ::RegisterControl(SID_ATTR_CHAR_FONTHEIGHT, pMod);
228 :
229 : // CustomShape extrusion controller
230 52 : SvxColorToolBoxControl::RegisterControl( SID_EXTRUSION_3D_COLOR, pMod );
231 52 : svx::FontWorkShapeTypeControl::RegisterControl( SID_FONTWORK_SHAPE_TYPE, pMod );
232 :
233 : // Child Windows
234 :
235 52 : ScInputWindowWrapper ::RegisterChildWindow(true, pMod, SfxChildWindowFlags::TASK|SfxChildWindowFlags::FORCEDOCK);
236 52 : ScNavigatorDialogWrapper ::RegisterChildWindowContext(static_cast<sal_uInt16>(ScTabViewShell::GetInterfaceId()), pMod);
237 52 : ScSolverDlgWrapper ::RegisterChildWindow(false, pMod);
238 52 : ScOptSolverDlgWrapper ::RegisterChildWindow(false, pMod);
239 52 : ScXMLSourceDlgWrapper ::RegisterChildWindow(false, pMod);
240 52 : ScNameDlgWrapper ::RegisterChildWindow(false, pMod);
241 52 : ScNameDefDlgWrapper ::RegisterChildWindow(false, pMod);
242 52 : ScPivotLayoutWrapper ::RegisterChildWindow(false, pMod);
243 52 : ScTabOpDlgWrapper ::RegisterChildWindow(false, pMod);
244 52 : ScFilterDlgWrapper ::RegisterChildWindow(false, pMod);
245 52 : ScSpecialFilterDlgWrapper ::RegisterChildWindow(false, pMod);
246 52 : ScDbNameDlgWrapper ::RegisterChildWindow(false, pMod);
247 52 : ScConsolidateDlgWrapper ::RegisterChildWindow(false, pMod);
248 52 : ScPrintAreasDlgWrapper ::RegisterChildWindow(false, pMod);
249 52 : ScColRowNameRangesDlgWrapper::RegisterChildWindow(false, pMod);
250 52 : ScFormulaDlgWrapper ::RegisterChildWindow(false, pMod);
251 :
252 52 : ScRandomNumberGeneratorDialogWrapper::RegisterChildWindow(false, pMod);
253 52 : ScSamplingDialogWrapper ::RegisterChildWindow(false, pMod);
254 52 : ScDescriptiveStatisticsDialogWrapper::RegisterChildWindow(false, pMod);
255 52 : ScAnalysisOfVarianceDialogWrapper ::RegisterChildWindow(false, pMod);
256 52 : ScCorrelationDialogWrapper ::RegisterChildWindow(false, pMod);
257 52 : ScCovarianceDialogWrapper ::RegisterChildWindow(false, pMod);
258 52 : ScExponentialSmoothingDialogWrapper ::RegisterChildWindow(false, pMod);
259 52 : ScMovingAverageDialogWrapper ::RegisterChildWindow(false, pMod);
260 52 : ScTTestDialogWrapper ::RegisterChildWindow(false, pMod);
261 52 : ScFTestDialogWrapper ::RegisterChildWindow(false, pMod);
262 52 : ScZTestDialogWrapper ::RegisterChildWindow(false, pMod);
263 52 : ScChiSquareTestDialogWrapper ::RegisterChildWindow(false, pMod);
264 :
265 : // First docking Window for Calc
266 52 : ScFunctionChildWindow ::RegisterChildWindow(false, pMod);
267 :
268 : // Redlining Window
269 52 : ScAcceptChgDlgWrapper ::RegisterChildWindow(false, pMod);
270 52 : ScSimpleRefDlgWrapper ::RegisterChildWindow(false, pMod, SfxChildWindowFlags::ALWAYSAVAILABLE|SfxChildWindowFlags::NEVERHIDE );
271 52 : ScHighlightChgDlgWrapper ::RegisterChildWindow(false, pMod);
272 :
273 52 : SvxSearchDialogWrapper ::RegisterChildWindow(false, pMod);
274 52 : SvxHlinkDlgWrapper ::RegisterChildWindow(false, pMod);
275 52 : SvxFontWorkChildWindow ::RegisterChildWindow(false, pMod);
276 52 : SvxIMapDlgChildWindow ::RegisterChildWindow(false, pMod);
277 52 : ScSpellDialogChildWindow ::RegisterChildWindow(false, pMod);
278 :
279 52 : ScValidityRefChildWin::RegisterChildWindow(false, pMod);
280 52 : sc::SearchResultsDlgWrapper::RegisterChildWindow(false, pMod);
281 52 : ScCondFormatDlgWrapper::RegisterChildWindow(false, pMod);
282 :
283 : // EditEngine Field; insofar not already defined in OfficeApplication::Init
284 52 : SvClassManager& rClassManager = SvxFieldItem::GetClassManager();
285 52 : rClassManager.Register(SvxPagesField::StaticClassId(), SvxPagesField::CreateInstance);
286 52 : rClassManager.Register(SvxFileField::StaticClassId(), SvxFileField::CreateInstance);
287 52 : rClassManager.Register(SvxTableField::StaticClassId(), SvxTableField::CreateInstance);
288 :
289 52 : SdrRegisterFieldClasses(); // Register SvDraw fields
290 :
291 : // Add 3DObject Factory
292 52 : E3dObjFactory();
293 :
294 : // Add ::com::sun::star::form::component::FormObject Factory
295 52 : FmFormObjFactory();
296 :
297 52 : pMod->PutItem( SfxUInt16Item( SID_ATTR_METRIC, sal::static_int_cast<sal_uInt16>(pMod->GetAppOptions().GetAppMetric()) ) );
298 :
299 : // StarOne Services are now handled in the registry
300 156 : }
301 :
302 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|