fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / sc / source / ui / app / scdll.cxx
blob15ee9bb63a2fe08fe45510cc70aef86428e1c045
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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/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>
40 #include <svtools/parhtml.hxx>
41 #include <sot/formats.hxx>
43 #include "scitems.hxx"
44 #include "scmod.hxx"
45 #include "scresid.hxx"
46 #include "sc.hrc"
47 #include "cfgids.hxx"
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"
65 #include "docpool.hxx"
66 #include "appoptio.hxx"
67 #include <searchresults.hxx>
69 // Controls
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>
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>
104 #include "editutil.hxx"
105 #include <svx/svdfield.hxx>
107 #include "dwfunctr.hxx"
108 #include "acredlin.hxx"
110 ScResId::ScResId( sal_uInt16 nId ) :
111 ResId( nId, *SC_MOD()->GetResMgr() )
115 void ScDLL::Init()
117 ScModule **ppShlPtr = reinterpret_cast<ScModule**>(GetAppData(SHL_CALC));
118 if ( *ppShlPtr )
119 return;
121 ScDocumentPool::InitVersionMaps(); // Is needed in the ScModule ctor
123 ScModule* pMod = new ScModule( &ScDocShell::Factory() );
124 (*ppShlPtr) = pMod;
126 ScDocShell::Factory().SetDocumentServiceName( OUString( "com.sun.star.sheet.SpreadsheetDocument" ) );
128 // Not until the ResManager is initialized
129 // The AppOptions must be initialized not until after ScGlobal::Init
130 ScGlobal::Init();
132 // register your view-factories here
133 ScTabViewShell ::RegisterFactory(1);
134 ScPreviewShell ::RegisterFactory(2);
136 // register your shell-interfaces here
137 ScModule ::RegisterInterface(pMod);
138 ScDocShell ::RegisterInterface(pMod);
139 ScTabViewShell ::RegisterInterface(pMod);
140 ScPreviewShell ::RegisterInterface(pMod);
141 ScDrawShell ::RegisterInterface(pMod);
142 ScDrawFormShell ::RegisterInterface(pMod);
143 ScDrawTextObjectBar ::RegisterInterface(pMod);
144 ScEditShell ::RegisterInterface(pMod);
145 ScPivotShell ::RegisterInterface(pMod);
146 ScAuditingShell ::RegisterInterface(pMod);
147 ScFormatShell ::RegisterInterface(pMod);
148 ScCellShell ::RegisterInterface(pMod);
149 ScOleObjectShell ::RegisterInterface(pMod);
150 ScChartShell ::RegisterInterface(pMod);
151 ScGraphicShell ::RegisterInterface(pMod);
152 ScMediaShell ::RegisterInterface(pMod);
153 ScPageBreakShell ::RegisterInterface(pMod);
155 SfxRecentFilesToolBoxControl::RegisterControl(SID_OPEN_CALC, pMod);
157 // Own Controller
158 ScTbxInsertCtrl ::RegisterControl(SID_TBXCTL_INSERT, pMod);
159 ScTbxInsertCtrl ::RegisterControl(SID_TBXCTL_INSCELLS, pMod);
160 ScTbxInsertCtrl ::RegisterControl(SID_TBXCTL_INSOBJ, pMod);
161 ScZoomSliderControl ::RegisterControl(SID_PREVIEW_SCALINGFACTOR, pMod);
163 // SvxToolboxController
164 SvxTbxCtlDraw ::RegisterControl(SID_INSERT_DRAW, pMod);
165 SvxTbxCtlCustomShapes ::RegisterControl(SID_DRAWTBX_CS_BASIC, pMod);
166 SvxTbxCtlCustomShapes ::RegisterControl(SID_DRAWTBX_CS_SYMBOL, pMod);
167 SvxTbxCtlCustomShapes ::RegisterControl(SID_DRAWTBX_CS_ARROW, pMod);
168 SvxTbxCtlCustomShapes ::RegisterControl(SID_DRAWTBX_CS_FLOWCHART, pMod);
169 SvxTbxCtlCustomShapes ::RegisterControl(SID_DRAWTBX_CS_CALLOUT, pMod);
170 SvxTbxCtlCustomShapes ::RegisterControl(SID_DRAWTBX_CS_STAR, pMod);
171 SvxTbxCtlAlign ::RegisterControl(SID_OBJECT_ALIGN, pMod);
172 SvxFillToolBoxControl ::RegisterControl(0, pMod);
173 SvxLineStyleToolBoxControl ::RegisterControl(0, pMod);
174 SvxLineWidthToolBoxControl ::RegisterControl(0, pMod);
175 SvxColorToolBoxControl ::RegisterControl(SID_ATTR_LINE_COLOR, pMod);
176 SvxColorToolBoxControl ::RegisterControl(SID_ATTR_FILL_COLOR, pMod);
177 SvxLineEndToolBoxControl ::RegisterControl(SID_ATTR_LINEEND_STYLE, pMod);
178 SvxStyleToolBoxControl ::RegisterControl(SID_STYLE_APPLY, pMod);
179 SvxFontNameToolBoxControl ::RegisterControl(SID_ATTR_CHAR_FONT, pMod);
180 SvxColorToolBoxControl ::RegisterControl(SID_ATTR_CHAR_COLOR, pMod);
181 SvxColorToolBoxControl ::RegisterControl(SID_BACKGROUND_COLOR, pMod);
182 SvxColorToolBoxControl ::RegisterControl(SID_ATTR_CHAR_BACK_COLOR, pMod);
183 SvxFrameToolBoxControl ::RegisterControl(SID_ATTR_BORDER, pMod);
184 SvxFrameLineStyleToolBoxControl ::RegisterControl(SID_FRAME_LINESTYLE, pMod);
185 SvxColorToolBoxControl ::RegisterControl(SID_FRAME_LINECOLOR, pMod);
186 SvxClipBoardControl ::RegisterControl(SID_PASTE, pMod );
187 SvxUndoRedoControl ::RegisterControl(SID_UNDO, pMod );
188 SvxUndoRedoControl ::RegisterControl(SID_REDO, pMod );
189 svx::ParaLineSpacingPopup ::RegisterControl(SID_ATTR_PARA_LINESPACE, pMod );
190 svx::FormatPaintBrushToolBoxControl::RegisterControl(SID_FORMATPAINTBRUSH, pMod );
192 SvxGrafModeToolBoxControl ::RegisterControl(SID_ATTR_GRAF_MODE, pMod);
193 SvxGrafRedToolBoxControl ::RegisterControl(SID_ATTR_GRAF_RED, pMod);
194 SvxGrafGreenToolBoxControl ::RegisterControl(SID_ATTR_GRAF_GREEN, pMod);
195 SvxGrafBlueToolBoxControl ::RegisterControl(SID_ATTR_GRAF_BLUE, pMod);
196 SvxGrafLuminanceToolBoxControl ::RegisterControl(SID_ATTR_GRAF_LUMINANCE, pMod);
197 SvxGrafContrastToolBoxControl ::RegisterControl(SID_ATTR_GRAF_CONTRAST, pMod);
198 SvxGrafGammaToolBoxControl ::RegisterControl(SID_ATTR_GRAF_GAMMA, pMod);
199 SvxGrafTransparenceToolBoxControl::RegisterControl(SID_ATTR_GRAF_TRANSPARENCE, pMod);
200 SvxGrafFilterToolBoxControl ::RegisterControl(SID_GRFFILTER, pMod);
202 SvxVertTextTbxCtrl::RegisterControl(SID_DRAW_CAPTION_VERTICAL, pMod);
203 SvxVertTextTbxCtrl::RegisterControl(SID_DRAW_TEXT_VERTICAL, pMod);
204 SvxVertTextTbxCtrl::RegisterControl(SID_TEXTDIRECTION_LEFT_TO_RIGHT, pMod);
205 SvxVertTextTbxCtrl::RegisterControl(SID_TEXTDIRECTION_TOP_TO_BOTTOM, pMod);
206 SvxCTLTextTbxCtrl::RegisterControl(SID_ATTR_PARA_LEFT_TO_RIGHT, pMod);
207 SvxCTLTextTbxCtrl::RegisterControl(SID_ATTR_PARA_RIGHT_TO_LEFT, pMod);
209 // Media Controller
210 ::avmedia::MediaToolBoxControl::RegisterControl( SID_AVMEDIA_TOOLBOX, pMod );
212 // Common SFX Controller
213 ::sfx2::TaskPaneWrapper::RegisterChildWindow( false, pMod );
214 ::sfx2::sidebar::SidebarChildWindow::RegisterChildWindow(false, pMod);
216 // SvxStatusBar Controller
217 SvxInsertStatusBarControl ::RegisterControl(SID_ATTR_INSERT, pMod);
218 SvxSelectionModeControl ::RegisterControl(SID_STATUS_SELMODE, pMod);
219 SvxZoomStatusBarControl ::RegisterControl(SID_ATTR_ZOOM, pMod);
220 SvxZoomSliderControl ::RegisterControl(SID_ATTR_ZOOMSLIDER, pMod);
221 SvxModifyControl ::RegisterControl(SID_DOC_MODIFIED, pMod);
222 XmlSecStatusBarControl ::RegisterControl( SID_SIGNATURE, pMod );
224 SvxPosSizeStatusBarControl ::RegisterControl(SID_ATTR_SIZE, pMod);
226 // SvxMenu Controller
227 SvxFontMenuControl ::RegisterControl(SID_ATTR_CHAR_FONT, pMod);
228 SvxFontSizeMenuControl ::RegisterControl(SID_ATTR_CHAR_FONTHEIGHT, pMod);
230 // CustomShape extrusion controller
231 SvxColorToolBoxControl::RegisterControl( SID_EXTRUSION_3D_COLOR, pMod );
232 svx::FontWorkShapeTypeControl::RegisterControl( SID_FONTWORK_SHAPE_TYPE, pMod );
234 // Child Windows
236 ScInputWindowWrapper ::RegisterChildWindow(true, pMod, SfxChildWindowFlags::TASK|SfxChildWindowFlags::FORCEDOCK);
237 ScNavigatorDialogWrapper ::RegisterChildWindowContext(static_cast<sal_uInt16>(ScTabViewShell::GetInterfaceId()), pMod);
238 ScSolverDlgWrapper ::RegisterChildWindow(false, pMod);
239 ScOptSolverDlgWrapper ::RegisterChildWindow(false, pMod);
240 ScXMLSourceDlgWrapper ::RegisterChildWindow(false, pMod);
241 ScNameDlgWrapper ::RegisterChildWindow(false, pMod);
242 ScNameDefDlgWrapper ::RegisterChildWindow(false, pMod);
243 ScPivotLayoutWrapper ::RegisterChildWindow(false, pMod);
244 ScTabOpDlgWrapper ::RegisterChildWindow(false, pMod);
245 ScFilterDlgWrapper ::RegisterChildWindow(false, pMod);
246 ScSpecialFilterDlgWrapper ::RegisterChildWindow(false, pMod);
247 ScDbNameDlgWrapper ::RegisterChildWindow(false, pMod);
248 ScConsolidateDlgWrapper ::RegisterChildWindow(false, pMod);
249 ScPrintAreasDlgWrapper ::RegisterChildWindow(false, pMod);
250 ScColRowNameRangesDlgWrapper::RegisterChildWindow(false, pMod);
251 ScFormulaDlgWrapper ::RegisterChildWindow(false, pMod);
253 ScRandomNumberGeneratorDialogWrapper::RegisterChildWindow(false, pMod);
254 ScSamplingDialogWrapper ::RegisterChildWindow(false, pMod);
255 ScDescriptiveStatisticsDialogWrapper::RegisterChildWindow(false, pMod);
256 ScAnalysisOfVarianceDialogWrapper ::RegisterChildWindow(false, pMod);
257 ScCorrelationDialogWrapper ::RegisterChildWindow(false, pMod);
258 ScCovarianceDialogWrapper ::RegisterChildWindow(false, pMod);
259 ScExponentialSmoothingDialogWrapper ::RegisterChildWindow(false, pMod);
260 ScMovingAverageDialogWrapper ::RegisterChildWindow(false, pMod);
261 ScTTestDialogWrapper ::RegisterChildWindow(false, pMod);
262 ScFTestDialogWrapper ::RegisterChildWindow(false, pMod);
263 ScZTestDialogWrapper ::RegisterChildWindow(false, pMod);
264 ScChiSquareTestDialogWrapper ::RegisterChildWindow(false, pMod);
266 // First docking Window for Calc
267 ScFunctionChildWindow ::RegisterChildWindow(false, pMod);
269 // Redlining Window
270 ScAcceptChgDlgWrapper ::RegisterChildWindow(false, pMod);
271 ScSimpleRefDlgWrapper ::RegisterChildWindow(false, pMod, SfxChildWindowFlags::ALWAYSAVAILABLE|SfxChildWindowFlags::NEVERHIDE );
272 ScHighlightChgDlgWrapper ::RegisterChildWindow(false, pMod);
274 SvxSearchDialogWrapper ::RegisterChildWindow(false, pMod);
275 SvxHlinkDlgWrapper ::RegisterChildWindow(false, pMod);
276 SvxFontWorkChildWindow ::RegisterChildWindow(false, pMod);
277 SvxIMapDlgChildWindow ::RegisterChildWindow(false, pMod);
278 ScSpellDialogChildWindow ::RegisterChildWindow(false, pMod);
280 ScValidityRefChildWin::RegisterChildWindow(false, pMod);
281 sc::SearchResultsDlgWrapper::RegisterChildWindow(false, pMod);
282 ScCondFormatDlgWrapper::RegisterChildWindow(false, pMod);
284 // EditEngine Field; insofar not already defined in OfficeApplication::Init
285 SvClassManager& rClassManager = SvxFieldItem::GetClassManager();
286 rClassManager.Register(SvxPagesField::StaticClassId(), SvxPagesField::CreateInstance);
287 rClassManager.Register(SvxFileField::StaticClassId(), SvxFileField::CreateInstance);
288 rClassManager.Register(SvxTableField::StaticClassId(), SvxTableField::CreateInstance);
290 SdrRegisterFieldClasses(); // Register SvDraw fields
292 // Add 3DObject Factory
293 E3dObjFactory();
295 // Add ::com::sun::star::form::component::FormObject Factory
296 FmFormObjFactory();
298 pMod->PutItem( SfxUInt16Item( SID_ATTR_METRIC, sal::static_int_cast<sal_uInt16>(pMod->GetAppOptions().GetAppMetric()) ) );
300 // StarOne Services are now handled in the registry
303 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */