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 <config_features.h>
22 #include <svx/fmobjfac.hxx>
23 #include <svx/objfac3d.hxx>
25 #include <comphelper/lok.hxx>
26 #include <sfx2/sidebar/SidebarChildWindow.hxx>
27 #include <sfx2/app.hxx>
28 #include <sfx2/devtools/DevelopmentToolChildWindow.hxx>
29 #include <avmedia/mediatoolbox.hxx>
30 #include <NumberFormatControl.hxx>
32 #include <unotools/resmgr.hxx>
35 #include <scresid.hxx>
39 #include <tabvwsh.hxx>
40 #include <prevwsh.hxx>
42 #include <drformsh.hxx>
43 #include <drtxtob.hxx>
45 #include <pivotsh.hxx>
46 #include <auditsh.hxx>
48 #include <oleobjsh.hxx>
49 #include <chartsh.hxx>
50 #include <graphsh.hxx>
51 #include <mediash.hxx>
52 #include <pgbrksh.hxx>
54 #include <SparklineShell.hxx>
56 #include <appoptio.hxx>
57 #include <searchresults.hxx>
61 #include <svx/tbxctl.hxx>
62 #include <svx/fillctrl.hxx>
63 #include <svx/linectrl.hxx>
64 //#include <svx/tbcontrl.hxx>
65 #include <svx/selctrl.hxx>
66 #include <svx/insctrl.hxx>
67 #include <svx/zoomctrl.hxx>
68 #include <svx/modctrl.hxx>
69 #include <svx/pszctrl.hxx>
70 #include <svx/grafctrl.hxx>
71 #include <svx/clipboardctl.hxx>
72 #include <svx/formatpaintbrushctrl.hxx>
73 #include <tbzoomsliderctrl.hxx>
74 #include <svx/zoomsliderctrl.hxx>
76 #include <svx/xmlsecctrl.hxx>
78 #include <reffact.hxx>
80 #include <inputwin.hxx>
81 #include <spelldialog.hxx>
82 #include <svx/fontwork.hxx>
83 #include <svx/srchdlg.hxx>
84 #include <svx/hyperdlg.hxx>
85 #include <svx/imapdlg.hxx>
88 #include <scabstdlg.hxx>
91 OUString
ScResId(TranslateId aId
)
93 return Translate::get(aId
, ScModule::get()->GetResLocale());
96 OUString
ScResId(TranslateNId aContextSingularPlural
, int nCardinality
)
98 return Translate::nget(aContextSingularPlural
, nCardinality
, ScModule::get()->GetResLocale());
103 if ( SfxApplication::GetModule(SfxToolsModule::Calc
) ) // Module already active
106 auto pUniqueModule
= std::make_unique
<ScModule
>(&ScDocShell::Factory());
107 ScModule
* pMod
= pUniqueModule
.get();
108 SfxApplication::SetModule(SfxToolsModule::Calc
, std::move(pUniqueModule
));
110 ScDocShell::Factory().SetDocumentServiceName( u
"com.sun.star.sheet.SpreadsheetDocument"_ustr
);
112 // Not until the ResManager is initialized
113 // The AppOptions must be initialized not until after ScGlobal::Init
116 // register your view-factories here
117 ScTabViewShell ::RegisterFactory(SFX_INTERFACE_SFXAPP
);
118 ScPreviewShell ::RegisterFactory(SFX_INTERFACE_SFXDOCSH
);
120 // register your shell-interfaces here
121 ScModule ::RegisterInterface(pMod
);
122 ScDocShell ::RegisterInterface(pMod
);
123 ScTabViewShell ::RegisterInterface(pMod
);
124 ScPreviewShell ::RegisterInterface(pMod
);
125 ScDrawShell ::RegisterInterface(pMod
);
126 ScDrawFormShell ::RegisterInterface(pMod
);
127 ScDrawTextObjectBar ::RegisterInterface(pMod
);
128 ScEditShell ::RegisterInterface(pMod
);
129 ScPivotShell ::RegisterInterface(pMod
);
130 sc::SparklineShell ::RegisterInterface(pMod
);
131 ScAuditingShell ::RegisterInterface(pMod
);
132 ScFormatShell ::RegisterInterface(pMod
);
133 ScCellShell ::RegisterInterface(pMod
);
134 ScOleObjectShell ::RegisterInterface(pMod
);
135 ScChartShell ::RegisterInterface(pMod
);
136 ScGraphicShell ::RegisterInterface(pMod
);
137 ScMediaShell ::RegisterInterface(pMod
);
138 ScPageBreakShell ::RegisterInterface(pMod
);
141 ScZoomSliderControl ::RegisterControl(SID_PREVIEW_SCALINGFACTOR
, pMod
);
143 // SvxToolboxController
144 SvxTbxCtlDraw ::RegisterControl(SID_INSERT_DRAW
, pMod
);
145 SvxFillToolBoxControl ::RegisterControl(0, pMod
);
146 SvxLineWidthToolBoxControl ::RegisterControl(0, pMod
);
147 SvxClipBoardControl ::RegisterControl(SID_PASTE
, pMod
);
148 SvxClipBoardControl ::RegisterControl(SID_PASTE_UNFORMATTED
, pMod
);
149 svx::FormatPaintBrushToolBoxControl::RegisterControl(SID_FORMATPAINTBRUSH
, pMod
);
150 sc::ScNumberFormatControl ::RegisterControl(SID_NUMBER_TYPE_FORMAT
, pMod
);
152 SvxGrafModeToolBoxControl ::RegisterControl(SID_ATTR_GRAF_MODE
, pMod
);
153 SvxGrafRedToolBoxControl ::RegisterControl(SID_ATTR_GRAF_RED
, pMod
);
154 SvxGrafGreenToolBoxControl ::RegisterControl(SID_ATTR_GRAF_GREEN
, pMod
);
155 SvxGrafBlueToolBoxControl ::RegisterControl(SID_ATTR_GRAF_BLUE
, pMod
);
156 SvxGrafLuminanceToolBoxControl ::RegisterControl(SID_ATTR_GRAF_LUMINANCE
, pMod
);
157 SvxGrafContrastToolBoxControl ::RegisterControl(SID_ATTR_GRAF_CONTRAST
, pMod
);
158 SvxGrafGammaToolBoxControl ::RegisterControl(SID_ATTR_GRAF_GAMMA
, pMod
);
159 SvxGrafTransparenceToolBoxControl::RegisterControl(SID_ATTR_GRAF_TRANSPARENCE
, pMod
);
162 #if HAVE_FEATURE_AVMEDIA
163 ::avmedia::MediaToolBoxControl::RegisterControl( SID_AVMEDIA_TOOLBOX
, pMod
);
166 // Common SFX Controller
167 sfx2::sidebar::SidebarChildWindow::RegisterChildWindow(false, pMod
);
168 DevelopmentToolChildWindow::RegisterChildWindow(false, pMod
);
170 // SvxStatusBar Controller
171 SvxInsertStatusBarControl ::RegisterControl(SID_ATTR_INSERT
, pMod
);
172 SvxSelectionModeControl ::RegisterControl(SID_STATUS_SELMODE
, pMod
);
173 SvxZoomStatusBarControl ::RegisterControl(SID_ATTR_ZOOM
, pMod
);
174 SvxZoomSliderControl ::RegisterControl(SID_ATTR_ZOOMSLIDER
, pMod
);
175 SvxModifyControl ::RegisterControl(SID_DOC_MODIFIED
, pMod
);
176 XmlSecStatusBarControl ::RegisterControl( SID_SIGNATURE
, pMod
);
177 ScAutoCalculateControl ::RegisterControl(FID_AUTO_CALC
, pMod
);
179 SvxPosSizeStatusBarControl ::RegisterControl(SID_ATTR_SIZE
, pMod
);
183 ScInputWindowWrapper ::RegisterChildWindow(true, pMod
, SfxChildWindowFlags::TASK
|SfxChildWindowFlags::FORCEDOCK
);
184 ScSolverDlgWrapper ::RegisterChildWindow(false, pMod
);
185 ScOptSolverDlgWrapper ::RegisterChildWindow(false, pMod
);
186 ScXMLSourceDlgWrapper ::RegisterChildWindow(false, pMod
);
187 ScNameDlgWrapper ::RegisterChildWindow(false, pMod
);
188 ScNameDefDlgWrapper ::RegisterChildWindow(false, pMod
);
189 ScPivotLayoutWrapper ::RegisterChildWindow(false, pMod
);
190 ScTabOpDlgWrapper ::RegisterChildWindow(false, pMod
);
191 ScFilterDlgWrapper ::RegisterChildWindow(false, pMod
);
192 ScSpecialFilterDlgWrapper ::RegisterChildWindow(false, pMod
);
193 ScDbNameDlgWrapper ::RegisterChildWindow(false, pMod
);
194 ScConsolidateDlgWrapper ::RegisterChildWindow(false, pMod
);
195 ScPrintAreasDlgWrapper ::RegisterChildWindow(false, pMod
);
196 ScColRowNameRangesDlgWrapper::RegisterChildWindow(false, pMod
);
197 ScFormulaDlgWrapper ::RegisterChildWindow(false, pMod
);
199 ScRandomNumberGeneratorDialogWrapper::RegisterChildWindow(false, pMod
);
200 ScSamplingDialogWrapper ::RegisterChildWindow(false, pMod
);
201 ScDescriptiveStatisticsDialogWrapper::RegisterChildWindow(false, pMod
);
202 ScAnalysisOfVarianceDialogWrapper ::RegisterChildWindow(false, pMod
);
203 ScCorrelationDialogWrapper ::RegisterChildWindow(false, pMod
);
204 ScCovarianceDialogWrapper ::RegisterChildWindow(false, pMod
);
205 ScExponentialSmoothingDialogWrapper ::RegisterChildWindow(false, pMod
);
206 ScMovingAverageDialogWrapper ::RegisterChildWindow(false, pMod
);
207 ScRegressionDialogWrapper ::RegisterChildWindow(false, pMod
);
208 ScTTestDialogWrapper ::RegisterChildWindow(false, pMod
);
209 ScFTestDialogWrapper ::RegisterChildWindow(false, pMod
);
210 ScZTestDialogWrapper ::RegisterChildWindow(false, pMod
);
211 ScChiSquareTestDialogWrapper ::RegisterChildWindow(false, pMod
);
212 ScFourierAnalysisDialogWrapper ::RegisterChildWindow(false, pMod
);
213 sc::SparklineDialogWrapper ::RegisterChildWindow(false, pMod
);
214 sc::SparklineDataRangeDialogWrapper ::RegisterChildWindow(false, pMod
);
215 sc::ConditionalFormatEasyDialogWrapper ::RegisterChildWindow(false, pMod
);
218 ScAcceptChgDlgWrapper ::RegisterChildWindow(false, pMod
);
219 ScSimpleRefDlgWrapper ::RegisterChildWindow(false, pMod
, SfxChildWindowFlags::ALWAYSAVAILABLE
|SfxChildWindowFlags::NEVERHIDE
);
220 ScHighlightChgDlgWrapper ::RegisterChildWindow(false, pMod
);
222 SvxSearchDialogWrapper ::RegisterChildWindow(false, pMod
);
223 SvxHlinkDlgWrapper ::RegisterChildWindow(false, pMod
);
224 SvxFontWorkChildWindow ::RegisterChildWindow(false, pMod
);
225 SvxIMapDlgChildWindow ::RegisterChildWindow(false, pMod
);
226 ScSpellDialogChildWindow ::RegisterChildWindow(false, pMod
);
228 ScValidityRefChildWin::RegisterChildWindow(false, pMod
);
229 sc::SearchResultsDlgWrapper::RegisterChildWindow(false, pMod
);
230 ScCondFormatDlgWrapper::RegisterChildWindow(false, pMod
);
232 ScNavigatorWrapper::RegisterChildWindow(false, pMod
, SfxChildWindowFlags::NEVERHIDE
);
234 // Add 3DObject Factory
237 // Add css::form::component::FormObject Factory
240 pMod
->PutItem( SfxUInt16Item( SID_ATTR_METRIC
, sal::static_int_cast
<sal_uInt16
>(pMod
->GetAppOptions().GetAppMetric()) ) );
242 // StarOne Services are now handled in the registry
245 #ifndef DISABLE_DYNLOADING
247 extern "C" SAL_DLLPUBLIC_EXPORT
248 void lok_preload_hook()
251 ScFormatFilter::Get();
253 ScAbstractDialogFactory::Create();
258 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */