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 <editeng/eeitem.hxx>
22 #include <svx/fmobjfac.hxx>
23 #include <svx/objfac3d.hxx>
24 #include <svx/tbxcolor.hxx>
26 #include <comphelper/classids.hxx>
27 #include <sfx2/sidebar/SidebarChildWindow.hxx>
28 #include <sfx2/docfilt.hxx>
29 #include <sfx2/fcontnr.hxx>
30 #include <sfx2/docfile.hxx>
31 #include <sfx2/app.hxx>
32 #include <avmedia/mediaplayer.hxx>
33 #include <avmedia/mediatoolbox.hxx>
34 #include <comphelper/types.hxx>
35 #include <svx/ParaLineSpacingPopup.hxx>
36 #include <svx/TextCharacterSpacingPopup.hxx>
37 #include <svx/TextUnderlinePopup.hxx>
39 #include <svtools/parhtml.hxx>
40 #include <sot/formats.hxx>
42 #include "scitems.hxx"
44 #include "scresid.hxx"
49 #include "tabvwsh.hxx"
50 #include "prevwsh.hxx"
52 #include "drformsh.hxx"
53 #include "drtxtob.hxx"
55 #include "pivotsh.hxx"
56 #include "auditsh.hxx"
58 #include "oleobjsh.hxx"
59 #include "chartsh.hxx"
60 #include "graphsh.hxx"
61 #include "mediash.hxx"
62 #include "pgbrksh.hxx"
64 #include "docpool.hxx"
65 #include "appoptio.hxx"
66 #include <searchresults.hxx>
70 #include <svx/tbxctl.hxx>
71 #include <svx/fillctrl.hxx>
72 #include <svx/linectrl.hxx>
73 #include <svx/tbcontrl.hxx>
74 #include <svx/selctrl.hxx>
75 #include <svx/insctrl.hxx>
76 #include <svx/zoomctrl.hxx>
77 #include <editeng/flditem.hxx>
78 #include <svx/modctrl.hxx>
79 #include <svx/pszctrl.hxx>
80 #include <svx/grafctrl.hxx>
81 #include <svx/clipboardctl.hxx>
82 #include <svx/lboxctrl.hxx>
83 #include <svx/verttexttbxctrl.hxx>
84 #include <svx/formatpaintbrushctrl.hxx>
85 #include "tbzoomsliderctrl.hxx"
86 #include <svx/zoomsliderctrl.hxx>
88 #include <svx/xmlsecctrl.hxx>
90 #include "reffact.hxx"
92 #include "inputwin.hxx"
93 #include "spelldialog.hxx"
94 #include <svx/fontwork.hxx>
95 #include <svx/srchdlg.hxx>
96 #include <svx/hyperdlg.hxx>
97 #include <svx/imapdlg.hxx>
99 #include "editutil.hxx"
100 #include <svx/svdfield.hxx>
102 #include "dwfunctr.hxx"
103 #include "acredlin.hxx"
105 ScResId::ScResId( sal_uInt16 nId
) :
106 ResId( nId
, *SC_MOD()->GetResMgr() )
112 ScModule
**ppShlPtr
= reinterpret_cast<ScModule
**>(GetAppData(SHL_CALC
));
116 ScDocumentPool::InitVersionMaps(); // Is needed in the ScModule ctor
118 ScModule
* pMod
= new ScModule( &ScDocShell::Factory() );
121 ScDocShell::Factory().SetDocumentServiceName( "com.sun.star.sheet.SpreadsheetDocument" );
123 // Not until the ResManager is initialized
124 // The AppOptions must be initialized not until after ScGlobal::Init
127 // register your view-factories here
128 ScTabViewShell ::RegisterFactory(1);
129 ScPreviewShell ::RegisterFactory(2);
131 // register your shell-interfaces here
132 ScModule ::RegisterInterface(pMod
);
133 ScDocShell ::RegisterInterface(pMod
);
134 ScTabViewShell ::RegisterInterface(pMod
);
135 ScPreviewShell ::RegisterInterface(pMod
);
136 ScDrawShell ::RegisterInterface(pMod
);
137 ScDrawFormShell ::RegisterInterface(pMod
);
138 ScDrawTextObjectBar ::RegisterInterface(pMod
);
139 ScEditShell ::RegisterInterface(pMod
);
140 ScPivotShell ::RegisterInterface(pMod
);
141 ScAuditingShell ::RegisterInterface(pMod
);
142 ScFormatShell ::RegisterInterface(pMod
);
143 ScCellShell ::RegisterInterface(pMod
);
144 ScOleObjectShell ::RegisterInterface(pMod
);
145 ScChartShell ::RegisterInterface(pMod
);
146 ScGraphicShell ::RegisterInterface(pMod
);
147 ScMediaShell ::RegisterInterface(pMod
);
148 ScPageBreakShell ::RegisterInterface(pMod
);
151 ScZoomSliderControl ::RegisterControl(SID_PREVIEW_SCALINGFACTOR
, pMod
);
152 SvxCurrencyToolBoxControl ::RegisterControl(SID_NUMBER_CURRENCY
, pMod
);
154 // SvxToolboxController
155 SvxTbxCtlDraw ::RegisterControl(SID_INSERT_DRAW
, pMod
);
156 SvxFillToolBoxControl ::RegisterControl(0, pMod
);
157 SvxLineStyleToolBoxControl ::RegisterControl(0, pMod
);
158 SvxLineWidthToolBoxControl ::RegisterControl(0, pMod
);
159 SvxColorToolBoxControl ::RegisterControl(SID_ATTR_LINE_COLOR
, pMod
);
160 SvxColorToolBoxControl ::RegisterControl(SID_ATTR_FILL_COLOR
, pMod
);
161 SvxLineEndToolBoxControl ::RegisterControl(SID_ATTR_LINEEND_STYLE
, pMod
);
162 SvxStyleToolBoxControl ::RegisterControl(SID_STYLE_APPLY
, pMod
);
163 SvxFontNameToolBoxControl ::RegisterControl(SID_ATTR_CHAR_FONT
, pMod
);
164 SvxColorToolBoxControl ::RegisterControl(SID_ATTR_CHAR_COLOR
, pMod
);
165 SvxColorToolBoxControl ::RegisterControl(SID_BACKGROUND_COLOR
, pMod
);
166 SvxColorToolBoxControl ::RegisterControl(SID_ATTR_CHAR_BACK_COLOR
, pMod
);
167 SvxFrameToolBoxControl ::RegisterControl(SID_ATTR_BORDER
, pMod
);
168 SvxFrameLineStyleToolBoxControl ::RegisterControl(SID_FRAME_LINESTYLE
, pMod
);
169 SvxColorToolBoxControl ::RegisterControl(SID_FRAME_LINECOLOR
, pMod
);
170 SvxClipBoardControl ::RegisterControl(SID_PASTE
, pMod
);
171 SvxUndoRedoControl ::RegisterControl(SID_UNDO
, pMod
);
172 SvxUndoRedoControl ::RegisterControl(SID_REDO
, pMod
);
173 svx::ParaLineSpacingPopup ::RegisterControl(SID_ATTR_PARA_LINESPACE
, pMod
);
174 svx::TextCharacterSpacingPopup ::RegisterControl(SID_ATTR_CHAR_KERNING
, pMod
);
175 svx::TextUnderlinePopup ::RegisterControl(SID_ATTR_CHAR_UNDERLINE
, pMod
);
176 svx::FormatPaintBrushToolBoxControl::RegisterControl(SID_FORMATPAINTBRUSH
, pMod
);
178 SvxGrafModeToolBoxControl ::RegisterControl(SID_ATTR_GRAF_MODE
, pMod
);
179 SvxGrafRedToolBoxControl ::RegisterControl(SID_ATTR_GRAF_RED
, pMod
);
180 SvxGrafGreenToolBoxControl ::RegisterControl(SID_ATTR_GRAF_GREEN
, pMod
);
181 SvxGrafBlueToolBoxControl ::RegisterControl(SID_ATTR_GRAF_BLUE
, pMod
);
182 SvxGrafLuminanceToolBoxControl ::RegisterControl(SID_ATTR_GRAF_LUMINANCE
, pMod
);
183 SvxGrafContrastToolBoxControl ::RegisterControl(SID_ATTR_GRAF_CONTRAST
, pMod
);
184 SvxGrafGammaToolBoxControl ::RegisterControl(SID_ATTR_GRAF_GAMMA
, pMod
);
185 SvxGrafTransparenceToolBoxControl::RegisterControl(SID_ATTR_GRAF_TRANSPARENCE
, pMod
);
187 SvxVertTextTbxCtrl::RegisterControl(SID_DRAW_CAPTION_VERTICAL
, pMod
);
188 SvxVertTextTbxCtrl::RegisterControl(SID_DRAW_TEXT_VERTICAL
, pMod
);
189 SvxVertTextTbxCtrl::RegisterControl(SID_TEXTDIRECTION_LEFT_TO_RIGHT
, pMod
);
190 SvxVertTextTbxCtrl::RegisterControl(SID_TEXTDIRECTION_TOP_TO_BOTTOM
, pMod
);
191 SvxCTLTextTbxCtrl::RegisterControl(SID_ATTR_PARA_LEFT_TO_RIGHT
, pMod
);
192 SvxCTLTextTbxCtrl::RegisterControl(SID_ATTR_PARA_RIGHT_TO_LEFT
, pMod
);
195 ::avmedia::MediaToolBoxControl::RegisterControl( SID_AVMEDIA_TOOLBOX
, pMod
);
197 // Common SFX Controller
198 ::sfx2::sidebar::SidebarChildWindow::RegisterChildWindow(false, pMod
);
200 // SvxStatusBar Controller
201 SvxInsertStatusBarControl ::RegisterControl(SID_ATTR_INSERT
, pMod
);
202 SvxSelectionModeControl ::RegisterControl(SID_STATUS_SELMODE
, pMod
);
203 SvxZoomStatusBarControl ::RegisterControl(SID_ATTR_ZOOM
, pMod
);
204 SvxZoomSliderControl ::RegisterControl(SID_ATTR_ZOOMSLIDER
, pMod
);
205 SvxModifyControl ::RegisterControl(SID_DOC_MODIFIED
, pMod
);
206 XmlSecStatusBarControl ::RegisterControl( SID_SIGNATURE
, pMod
);
208 SvxPosSizeStatusBarControl ::RegisterControl(SID_ATTR_SIZE
, pMod
);
210 // CustomShape extrusion controller
211 SvxColorToolBoxControl::RegisterControl( SID_EXTRUSION_3D_COLOR
, pMod
);
215 ScInputWindowWrapper ::RegisterChildWindow(true, pMod
, SfxChildWindowFlags::TASK
|SfxChildWindowFlags::FORCEDOCK
);
216 ScNavigatorDialogWrapper ::RegisterChildWindowContext(static_cast<sal_uInt16
>(ScTabViewShell::GetInterfaceId()), pMod
);
217 ScSolverDlgWrapper ::RegisterChildWindow(false, pMod
);
218 ScOptSolverDlgWrapper ::RegisterChildWindow(false, pMod
);
219 ScXMLSourceDlgWrapper ::RegisterChildWindow(false, pMod
);
220 ScNameDlgWrapper ::RegisterChildWindow(false, pMod
);
221 ScNameDefDlgWrapper ::RegisterChildWindow(false, pMod
);
222 ScPivotLayoutWrapper ::RegisterChildWindow(false, pMod
);
223 ScTabOpDlgWrapper ::RegisterChildWindow(false, pMod
);
224 ScFilterDlgWrapper ::RegisterChildWindow(false, pMod
);
225 ScSpecialFilterDlgWrapper ::RegisterChildWindow(false, pMod
);
226 ScDbNameDlgWrapper ::RegisterChildWindow(false, pMod
);
227 ScConsolidateDlgWrapper ::RegisterChildWindow(false, pMod
);
228 ScPrintAreasDlgWrapper ::RegisterChildWindow(false, pMod
);
229 ScColRowNameRangesDlgWrapper::RegisterChildWindow(false, pMod
);
230 ScFormulaDlgWrapper ::RegisterChildWindow(false, pMod
);
232 ScRandomNumberGeneratorDialogWrapper::RegisterChildWindow(false, pMod
);
233 ScSamplingDialogWrapper ::RegisterChildWindow(false, pMod
);
234 ScDescriptiveStatisticsDialogWrapper::RegisterChildWindow(false, pMod
);
235 ScAnalysisOfVarianceDialogWrapper ::RegisterChildWindow(false, pMod
);
236 ScCorrelationDialogWrapper ::RegisterChildWindow(false, pMod
);
237 ScCovarianceDialogWrapper ::RegisterChildWindow(false, pMod
);
238 ScExponentialSmoothingDialogWrapper ::RegisterChildWindow(false, pMod
);
239 ScMovingAverageDialogWrapper ::RegisterChildWindow(false, pMod
);
240 ScRegressionDialogWrapper ::RegisterChildWindow(false, pMod
);
241 ScTTestDialogWrapper ::RegisterChildWindow(false, pMod
);
242 ScFTestDialogWrapper ::RegisterChildWindow(false, pMod
);
243 ScZTestDialogWrapper ::RegisterChildWindow(false, pMod
);
244 ScChiSquareTestDialogWrapper ::RegisterChildWindow(false, pMod
);
247 ScAcceptChgDlgWrapper ::RegisterChildWindow(false, pMod
);
248 ScSimpleRefDlgWrapper ::RegisterChildWindow(false, pMod
, SfxChildWindowFlags::ALWAYSAVAILABLE
|SfxChildWindowFlags::NEVERHIDE
);
249 ScHighlightChgDlgWrapper ::RegisterChildWindow(false, pMod
);
251 SvxSearchDialogWrapper ::RegisterChildWindow(false, pMod
);
252 SvxHlinkDlgWrapper ::RegisterChildWindow(false, pMod
);
253 SvxFontWorkChildWindow ::RegisterChildWindow(false, pMod
);
254 SvxIMapDlgChildWindow ::RegisterChildWindow(false, pMod
);
255 ScSpellDialogChildWindow ::RegisterChildWindow(false, pMod
);
257 ScValidityRefChildWin::RegisterChildWindow(false, pMod
);
258 sc::SearchResultsDlgWrapper::RegisterChildWindow(false, pMod
);
259 ScCondFormatDlgWrapper::RegisterChildWindow(false, pMod
);
261 // EditEngine Field; insofar not already defined in OfficeApplication::Init
262 SvClassManager
& rClassManager
= SvxFieldItem::GetClassManager();
263 rClassManager
.Register(SvxPagesField::StaticClassId(), SvxPagesField::CreateInstance
);
264 rClassManager
.Register(SvxFileField::StaticClassId(), SvxFileField::CreateInstance
);
265 rClassManager
.Register(SvxTableField::StaticClassId(), SvxTableField::CreateInstance
);
267 SdrRegisterFieldClasses(); // Register SvDraw fields
269 // Add 3DObject Factory
272 // Add css::form::component::FormObject Factory
275 pMod
->PutItem( SfxUInt16Item( SID_ATTR_METRIC
, sal::static_int_cast
<sal_uInt16
>(pMod
->GetAppOptions().GetAppMetric()) ) );
277 // StarOne Services are now handled in the registry
280 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */