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