LibreOffice Module sc (master) 1
scdll.cxx
Go to the documentation of this file.
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 <config_features.h>
21
22#include <svx/fmobjfac.hxx>
23#include <svx/objfac3d.hxx>
24
25#include <comphelper/lok.hxx>
27#include <sfx2/app.hxx>
31
32#include <unotools/resmgr.hxx>
33
34#include <scmod.hxx>
35#include <scresid.hxx>
36#include <sc.hrc>
37
38#include <docsh.hxx>
39#include <tabvwsh.hxx>
40#include <prevwsh.hxx>
41#include <drawsh.hxx>
42#include <drformsh.hxx>
43#include <drtxtob.hxx>
44#include <editsh.hxx>
45#include <pivotsh.hxx>
46#include <auditsh.hxx>
47#include <cellsh.hxx>
48#include <oleobjsh.hxx>
49#include <chartsh.hxx>
50#include <graphsh.hxx>
51#include <mediash.hxx>
52#include <pgbrksh.hxx>
53#include <scdll.hxx>
54#include <SparklineShell.hxx>
55
56#include <appoptio.hxx>
57#include <searchresults.hxx>
58
59// Controls
60
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>
73#include <tbzoomsliderctrl.hxx>
75
76#include <svx/xmlsecctrl.hxx>
77// Child windows
78#include <reffact.hxx>
79#include <navipi.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>
86
87#include <filter.hxx>
88#include <scabstdlg.hxx>
89
90OUString ScResId(TranslateId aId)
91{
92 return Translate::get(aId, SC_MOD()->GetResLocale());
93}
94
95OUString ScResId(TranslateNId aContextSingularPlural, int nCardinality)
96{
97 return Translate::nget(aContextSingularPlural, nCardinality, SC_MOD()->GetResLocale());
98}
99
101{
102 if ( SfxApplication::GetModule(SfxToolsModule::Calc) ) // Module already active
103 return;
104
105 auto pUniqueModule = std::make_unique<ScModule>(&ScDocShell::Factory());
106 ScModule* pMod = pUniqueModule.get();
107 SfxApplication::SetModule(SfxToolsModule::Calc, std::move(pUniqueModule));
108
109 ScDocShell::Factory().SetDocumentServiceName( "com.sun.star.sheet.SpreadsheetDocument" );
110
111 // Not until the ResManager is initialized
112 // The AppOptions must be initialized not until after ScGlobal::Init
114
115 // register your view-factories here
116 ScTabViewShell ::RegisterFactory(SFX_INTERFACE_SFXAPP);
117 ScPreviewShell ::RegisterFactory(SFX_INTERFACE_SFXDOCSH);
118
119 // register your shell-interfaces here
120 ScModule ::RegisterInterface(pMod);
121 ScDocShell ::RegisterInterface(pMod);
122 ScTabViewShell ::RegisterInterface(pMod);
123 ScPreviewShell ::RegisterInterface(pMod);
124 ScDrawShell ::RegisterInterface(pMod);
125 ScDrawFormShell ::RegisterInterface(pMod);
126 ScDrawTextObjectBar ::RegisterInterface(pMod);
127 ScEditShell ::RegisterInterface(pMod);
128 ScPivotShell ::RegisterInterface(pMod);
129 sc::SparklineShell ::RegisterInterface(pMod);
130 ScAuditingShell ::RegisterInterface(pMod);
131 ScFormatShell ::RegisterInterface(pMod);
132 ScCellShell ::RegisterInterface(pMod);
133 ScOleObjectShell ::RegisterInterface(pMod);
134 ScChartShell ::RegisterInterface(pMod);
135 ScGraphicShell ::RegisterInterface(pMod);
136 ScMediaShell ::RegisterInterface(pMod);
137 ScPageBreakShell ::RegisterInterface(pMod);
138
139 // Own Controller
140 ScZoomSliderControl ::RegisterControl(SID_PREVIEW_SCALINGFACTOR, pMod);
141
142 // SvxToolboxController
143 SvxTbxCtlDraw ::RegisterControl(SID_INSERT_DRAW, pMod);
144 SvxFillToolBoxControl ::RegisterControl(0, pMod);
145 SvxLineWidthToolBoxControl ::RegisterControl(0, pMod);
146 SvxClipBoardControl ::RegisterControl(SID_PASTE, pMod );
147 SvxClipBoardControl ::RegisterControl(SID_PASTE_UNFORMATTED, pMod );
148 svx::FormatPaintBrushToolBoxControl::RegisterControl(SID_FORMATPAINTBRUSH, pMod );
149 sc::ScNumberFormatControl ::RegisterControl(SID_NUMBER_TYPE_FORMAT, pMod );
150
151 SvxGrafModeToolBoxControl ::RegisterControl(SID_ATTR_GRAF_MODE, pMod);
152 SvxGrafRedToolBoxControl ::RegisterControl(SID_ATTR_GRAF_RED, pMod);
153 SvxGrafGreenToolBoxControl ::RegisterControl(SID_ATTR_GRAF_GREEN, pMod);
154 SvxGrafBlueToolBoxControl ::RegisterControl(SID_ATTR_GRAF_BLUE, pMod);
155 SvxGrafLuminanceToolBoxControl ::RegisterControl(SID_ATTR_GRAF_LUMINANCE, pMod);
156 SvxGrafContrastToolBoxControl ::RegisterControl(SID_ATTR_GRAF_CONTRAST, pMod);
157 SvxGrafGammaToolBoxControl ::RegisterControl(SID_ATTR_GRAF_GAMMA, pMod);
158 SvxGrafTransparenceToolBoxControl::RegisterControl(SID_ATTR_GRAF_TRANSPARENCE, pMod);
159
160 // Media Controller
161#if HAVE_FEATURE_AVMEDIA
162 ::avmedia::MediaToolBoxControl::RegisterControl( SID_AVMEDIA_TOOLBOX, pMod );
163#endif
164
165 // Common SFX Controller
168
169 // SvxStatusBar Controller
170 SvxInsertStatusBarControl ::RegisterControl(SID_ATTR_INSERT, pMod);
171 SvxSelectionModeControl ::RegisterControl(SID_STATUS_SELMODE, pMod);
172 SvxZoomStatusBarControl ::RegisterControl(SID_ATTR_ZOOM, pMod);
173 SvxZoomSliderControl ::RegisterControl(SID_ATTR_ZOOMSLIDER, pMod);
174 SvxModifyControl ::RegisterControl(SID_DOC_MODIFIED, pMod);
175 XmlSecStatusBarControl ::RegisterControl( SID_SIGNATURE, pMod );
176
177 SvxPosSizeStatusBarControl ::RegisterControl(SID_ATTR_SIZE, pMod);
178
179 // Child Windows
180
181 ScInputWindowWrapper ::RegisterChildWindow(true, pMod, SfxChildWindowFlags::TASK|SfxChildWindowFlags::FORCEDOCK);
182 ScSolverDlgWrapper ::RegisterChildWindow(false, pMod);
183 ScOptSolverDlgWrapper ::RegisterChildWindow(false, pMod);
184 ScXMLSourceDlgWrapper ::RegisterChildWindow(false, pMod);
185 ScNameDlgWrapper ::RegisterChildWindow(false, pMod);
186 ScNameDefDlgWrapper ::RegisterChildWindow(false, pMod);
187 ScPivotLayoutWrapper ::RegisterChildWindow(false, pMod);
188 ScTabOpDlgWrapper ::RegisterChildWindow(false, pMod);
189 ScFilterDlgWrapper ::RegisterChildWindow(false, pMod);
190 ScSpecialFilterDlgWrapper ::RegisterChildWindow(false, pMod);
191 ScDbNameDlgWrapper ::RegisterChildWindow(false, pMod);
192 ScConsolidateDlgWrapper ::RegisterChildWindow(false, pMod);
193 ScPrintAreasDlgWrapper ::RegisterChildWindow(false, pMod);
194 ScColRowNameRangesDlgWrapper::RegisterChildWindow(false, pMod);
195 ScFormulaDlgWrapper ::RegisterChildWindow(false, pMod);
196
213
214 // Redlining Window
216 ScSimpleRefDlgWrapper ::RegisterChildWindow(false, pMod, SfxChildWindowFlags::ALWAYSAVAILABLE|SfxChildWindowFlags::NEVERHIDE );
217 ScHighlightChgDlgWrapper ::RegisterChildWindow(false, pMod);
218
219 SvxSearchDialogWrapper ::RegisterChildWindow(false, pMod);
220 SvxHlinkDlgWrapper ::RegisterChildWindow(false, pMod);
221 SvxFontWorkChildWindow ::RegisterChildWindow(false, pMod);
222 SvxIMapDlgChildWindow ::RegisterChildWindow(false, pMod);
223 ScSpellDialogChildWindow::RegisterChildWindow(
224 false, pMod, comphelper::LibreOfficeKit::isActive() ? SfxChildWindowFlags::NEVERCLONE
225 : SfxChildWindowFlags::NONE);
226
229 ScCondFormatDlgWrapper::RegisterChildWindow(false, pMod);
230
231 ScNavigatorWrapper::RegisterChildWindow(false, pMod, SfxChildWindowFlags::NEVERHIDE);
232
233 // Add 3DObject Factory
235
236 // Add css::form::component::FormObject Factory
238
239 pMod->PutItem( SfxUInt16Item( SID_ATTR_METRIC, sal::static_int_cast<sal_uInt16>(pMod->GetAppOptions().GetAppMetric()) ) );
240
241 // StarOne Services are now handled in the registry
242}
243
244#ifndef DISABLE_DYNLOADING
245
246extern "C" SAL_DLLPUBLIC_EXPORT
248{
249 // scfilt
251 // scui
253}
254
255#endif
256
257/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static void RegisterChildWindow(bool bVisible=false, SfxModule *pModule=nullptr, SfxChildWindowFlags nFlags=SfxChildWindowFlags::NONE)
static SC_DLLPUBLIC ScAbstractDialogFactory * Create()
Definition: scabstdlg.cxx:37
FieldUnit GetAppMetric() const
Definition: appoptio.hxx:40
static SC_DLLPUBLIC void Init()
DLL-init/exit-code must be linked to the DLL only.
Definition: scdll.cxx:100
static SC_DLLPUBLIC ScFormatFilterPlugin & Get()
Definition: impex.cxx:2684
static SC_DLLPUBLIC void Init()
Definition: global.cxx:448
SC_DLLPUBLIC const ScAppOptions & GetAppOptions()
Definition: scmod.cxx:799
static void SetModule(SfxToolsModule nSharedLib, std::unique_ptr< SfxModule > pModule)
static SfxModule * GetModule(SfxToolsModule nSharedLib)
static void RegisterChildWindow(SfxModule *, const SfxChildWinFactory &)
void PutItem(const SfxPoolItem &rItem)
OUString nget(TranslateNId aContextSingularPlural, int n, const std::locale &loc)
OUString get(TranslateId sContextAndId, const std::locale &loc)
OUString ScResId(TranslateId aId)
Definition: scdll.cxx:90
SAL_DLLPUBLIC_EXPORT void lok_preload_hook()
Definition: scdll.cxx:247
#define SC_MOD()
Definition: scmod.hxx:247
constexpr auto SFX_INTERFACE_SFXDOCSH
constexpr auto SFX_INTERFACE_SFXAPP