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 :
23 : #include <svx/fmobjfac.hxx>
24 : #include <svx/objfac3d.hxx>
25 : #include <svx/tbxcolor.hxx>
26 :
27 : #include <comphelper/classids.hxx>
28 : #include <sfx2/taskpane.hxx>
29 : #include <sfx2/sidebar/SidebarChildWindow.hxx>
30 : #include <sfx2/docfilt.hxx>
31 : #include <sfx2/fcontnr.hxx>
32 : #include <sfx2/docfile.hxx>
33 : #include <sfx2/app.hxx>
34 : #include <avmedia/mediaplayer.hxx>
35 : #include <avmedia/mediatoolbox.hxx>
36 : #include <comphelper/types.hxx>
37 : #include <svx/extrusioncolorcontrol.hxx>
38 : #include <svx/fontworkgallery.hxx>
39 : #include <svx/tbxcustomshapes.hxx>
40 :
41 : #include <svtools/parhtml.hxx>
42 : #include <sot/formats.hxx>
43 :
44 : #include "scitems.hxx" // fuer tbxctrls etc.
45 : #include "scmod.hxx"
46 : #include "scresid.hxx"
47 : #include "sc.hrc"
48 : #include "cfgids.hxx"
49 :
50 : //! Here used to be an old German comment: "die Registrierung wird
51 : //! wegen CLOOKs in ein eigenes File wandern muessen..." which refers
52 : //! to the infamous CLOOK (Compiler Limit: Out of Keys) problem
53 : //! (http://msdn.microsoft.com/en-us/library/3d859kh1(v=vs.71).aspx ,
54 : //! which has not been relevant for many years. Presumably that is
55 : //! supposed to explain some odd arrangement of source code, or
56 : //! something. Or maybe that comment is completely irrelevant.
57 :
58 : #include "docsh.hxx"
59 : #include "tabvwsh.hxx"
60 : #include "prevwsh.hxx"
61 : #include "drawsh.hxx"
62 : #include "drformsh.hxx"
63 : #include "drtxtob.hxx"
64 : #include "editsh.hxx"
65 : #include "pivotsh.hxx"
66 : #include "auditsh.hxx"
67 : #include "cellsh.hxx"
68 : #include "oleobjsh.hxx"
69 : #include "chartsh.hxx"
70 : #include "graphsh.hxx"
71 : #include "mediash.hxx"
72 : #include "pgbrksh.hxx"
73 :
74 : #include "docpool.hxx"
75 : #include "appoptio.hxx"
76 :
77 : // Controls
78 :
79 : #include <svx/tbxalign.hxx>
80 : #include <svx/tbxctl.hxx>
81 : #include <svx/fillctrl.hxx>
82 : #include <svx/linectrl.hxx>
83 : #include <svx/tbcontrl.hxx>
84 : #include <svx/selctrl.hxx>
85 : #include <svx/insctrl.hxx>
86 : #include <svx/zoomctrl.hxx>
87 : #include <editeng/flditem.hxx>
88 : #include <svx/modctrl.hxx>
89 : #include <svx/pszctrl.hxx>
90 : #include <svx/fntctl.hxx>
91 : #include <svx/fntszctl.hxx>
92 : #include <svx/grafctrl.hxx>
93 : #include <svx/galbrws.hxx>
94 : #include <svx/clipboardctl.hxx>
95 : #include <svx/lboxctrl.hxx>
96 : #include <svx/verttexttbxctrl.hxx>
97 : #include <svx/formatpaintbrushctrl.hxx>
98 : #include "tbinsert.hxx"
99 : #include "tbzoomsliderctrl.hxx"
100 : #include <svx/zoomsliderctrl.hxx>
101 :
102 : #include <svx/xmlsecctrl.hxx>
103 : // Child-Windows
104 : #include "reffact.hxx"
105 : #include "navipi.hxx"
106 : #include "inputwin.hxx"
107 : #include "spelldialog.hxx"
108 : #include <svx/fontwork.hxx>
109 : #include <svx/srchdlg.hxx>
110 : #include <svx/hyperdlg.hxx>
111 : #include <svx/imapdlg.hxx>
112 :
113 : #include "editutil.hxx"
114 : #include <svx/svdfield.hxx> // SdrRegisterFieldClasses
115 : #include <rtl/logfile.hxx>
116 :
117 : #include "dwfunctr.hxx"
118 : #include "acredlin.hxx"
119 :
120 : //------------------------------------------------------------------
121 :
122 :
123 : //------------------------------------------------------------------
124 :
125 14322 : ScResId::ScResId( sal_uInt16 nId ) :
126 14322 : ResId( nId, *SC_MOD()->GetResMgr() )
127 : {
128 14322 : }
129 :
130 : //------------------------------------------------------------------
131 :
132 474 : void ScDLL::Init()
133 : {
134 : RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "sc", "nn93723", "ScDLL::Init" );
135 :
136 474 : ScModule **ppShlPtr = (ScModule**) GetAppData(SHL_CALC);
137 474 : if ( *ppShlPtr )
138 917 : return;
139 :
140 31 : ScDocumentPool::InitVersionMaps(); // wird im ScModule ctor gebraucht
141 :
142 31 : ScModule* pMod = new ScModule( &ScDocShell::Factory() );
143 31 : (*ppShlPtr) = pMod;
144 :
145 31 : ScDocShell::Factory().SetDocumentServiceName( OUString( "com.sun.star.sheet.SpreadsheetDocument" ) );
146 :
147 31 : ScGlobal::Init(); // erst wenn der ResManager initialisiert ist
148 : // erst nach ScGlobal::Init duerfen die App-Optionen
149 : // initialisiert werden
150 :
151 : // register your view-factories here
152 :
153 31 : ScTabViewShell ::RegisterFactory(1);
154 31 : ScPreviewShell ::RegisterFactory(2);
155 :
156 : // register your shell-interfaces here
157 :
158 31 : ScModule ::RegisterInterface(pMod);
159 31 : ScDocShell ::RegisterInterface(pMod);
160 31 : ScTabViewShell ::RegisterInterface(pMod);
161 31 : ScPreviewShell ::RegisterInterface(pMod);
162 31 : ScDrawShell ::RegisterInterface(pMod);
163 31 : ScDrawFormShell ::RegisterInterface(pMod);
164 31 : ScDrawTextObjectBar ::RegisterInterface(pMod);
165 31 : ScEditShell ::RegisterInterface(pMod);
166 31 : ScPivotShell ::RegisterInterface(pMod);
167 31 : ScAuditingShell ::RegisterInterface(pMod);
168 31 : ScFormatShell ::RegisterInterface(pMod);
169 31 : ScCellShell ::RegisterInterface(pMod);
170 31 : ScOleObjectShell ::RegisterInterface(pMod);
171 31 : ScChartShell ::RegisterInterface(pMod);
172 31 : ScGraphicShell ::RegisterInterface(pMod);
173 31 : ScMediaShell ::RegisterInterface(pMod);
174 31 : ScPageBreakShell ::RegisterInterface(pMod);
175 :
176 31 : SfxRecentFilesToolBoxControl::RegisterControl(SID_OPEN_CALC, pMod);
177 :
178 : // eigene Controller
179 31 : ScTbxInsertCtrl ::RegisterControl(SID_TBXCTL_INSERT, pMod);
180 31 : ScTbxInsertCtrl ::RegisterControl(SID_TBXCTL_INSCELLS, pMod);
181 31 : ScTbxInsertCtrl ::RegisterControl(SID_TBXCTL_INSOBJ, pMod);
182 31 : ScZoomSliderControl ::RegisterControl(SID_PREVIEW_SCALINGFACTOR, pMod);
183 :
184 : // Svx-Toolbox-Controller
185 31 : SvxTbxCtlDraw ::RegisterControl(SID_INSERT_DRAW, pMod);
186 31 : SvxTbxCtlCustomShapes ::RegisterControl(SID_DRAWTBX_CS_BASIC, pMod);
187 31 : SvxTbxCtlCustomShapes ::RegisterControl(SID_DRAWTBX_CS_SYMBOL, pMod);
188 31 : SvxTbxCtlCustomShapes ::RegisterControl(SID_DRAWTBX_CS_ARROW, pMod);
189 31 : SvxTbxCtlCustomShapes ::RegisterControl(SID_DRAWTBX_CS_FLOWCHART, pMod);
190 31 : SvxTbxCtlCustomShapes ::RegisterControl(SID_DRAWTBX_CS_CALLOUT, pMod);
191 31 : SvxTbxCtlCustomShapes ::RegisterControl(SID_DRAWTBX_CS_STAR, pMod);
192 31 : SvxTbxCtlAlign ::RegisterControl(SID_OBJECT_ALIGN, pMod);
193 31 : SvxFillToolBoxControl ::RegisterControl(0, pMod);
194 31 : SvxLineStyleToolBoxControl ::RegisterControl(0, pMod);
195 31 : SvxLineWidthToolBoxControl ::RegisterControl(0, pMod);
196 31 : SvxLineColorToolBoxControl ::RegisterControl(0, pMod);
197 31 : SvxLineEndToolBoxControl ::RegisterControl(SID_ATTR_LINEEND_STYLE, pMod);
198 31 : SvxStyleToolBoxControl ::RegisterControl(SID_STYLE_APPLY, pMod);
199 31 : SvxFontNameToolBoxControl ::RegisterControl(SID_ATTR_CHAR_FONT, pMod);
200 31 : SvxColorExtToolBoxControl ::RegisterControl(SID_ATTR_CHAR_COLOR, pMod);
201 31 : SvxColorExtToolBoxControl ::RegisterControl(SID_BACKGROUND_COLOR, pMod);
202 31 : SvxFrameToolBoxControl ::RegisterControl(SID_ATTR_BORDER, pMod);
203 31 : SvxFrameLineStyleToolBoxControl ::RegisterControl(SID_FRAME_LINESTYLE, pMod);
204 31 : SvxColorExtToolBoxControl ::RegisterControl(SID_FRAME_LINECOLOR, pMod);
205 31 : SvxClipBoardControl ::RegisterControl(SID_PASTE, pMod );
206 31 : SvxUndoRedoControl ::RegisterControl(SID_UNDO, pMod );
207 31 : SvxUndoRedoControl ::RegisterControl(SID_REDO, pMod );
208 31 : svx::FormatPaintBrushToolBoxControl::RegisterControl(SID_FORMATPAINTBRUSH, pMod );
209 :
210 31 : SvxGrafModeToolBoxControl ::RegisterControl(SID_ATTR_GRAF_MODE, pMod);
211 31 : SvxGrafRedToolBoxControl ::RegisterControl(SID_ATTR_GRAF_RED, pMod);
212 31 : SvxGrafGreenToolBoxControl ::RegisterControl(SID_ATTR_GRAF_GREEN, pMod);
213 31 : SvxGrafBlueToolBoxControl ::RegisterControl(SID_ATTR_GRAF_BLUE, pMod);
214 31 : SvxGrafLuminanceToolBoxControl ::RegisterControl(SID_ATTR_GRAF_LUMINANCE, pMod);
215 31 : SvxGrafContrastToolBoxControl ::RegisterControl(SID_ATTR_GRAF_CONTRAST, pMod);
216 31 : SvxGrafGammaToolBoxControl ::RegisterControl(SID_ATTR_GRAF_GAMMA, pMod);
217 31 : SvxGrafTransparenceToolBoxControl::RegisterControl(SID_ATTR_GRAF_TRANSPARENCE, pMod);
218 31 : SvxGrafFilterToolBoxControl ::RegisterControl(SID_GRFFILTER, pMod);
219 :
220 31 : SvxVertTextTbxCtrl::RegisterControl(SID_DRAW_CAPTION_VERTICAL, pMod);
221 31 : SvxVertTextTbxCtrl::RegisterControl(SID_DRAW_TEXT_VERTICAL, pMod);
222 31 : SvxVertTextTbxCtrl::RegisterControl(SID_TEXTDIRECTION_LEFT_TO_RIGHT, pMod);
223 31 : SvxVertTextTbxCtrl::RegisterControl(SID_TEXTDIRECTION_TOP_TO_BOTTOM, pMod);
224 31 : SvxCTLTextTbxCtrl::RegisterControl(SID_ATTR_PARA_LEFT_TO_RIGHT, pMod);
225 31 : SvxCTLTextTbxCtrl::RegisterControl(SID_ATTR_PARA_RIGHT_TO_LEFT, pMod);
226 :
227 : //Media Controller
228 31 : ::avmedia::MediaToolBoxControl::RegisterControl( SID_AVMEDIA_TOOLBOX, pMod );
229 :
230 : // common SFX controller
231 31 : ::sfx2::TaskPaneWrapper::RegisterChildWindow( false, pMod );
232 31 : ::sfx2::sidebar::SidebarChildWindow::RegisterChildWindowIfEnabled(false, pMod);
233 :
234 : // Svx-StatusBar-Controller
235 31 : SvxInsertStatusBarControl ::RegisterControl(SID_ATTR_INSERT, pMod);
236 31 : SvxSelectionModeControl ::RegisterControl(SID_STATUS_SELMODE, pMod);
237 31 : SvxZoomStatusBarControl ::RegisterControl(SID_ATTR_ZOOM, pMod);
238 31 : SvxZoomSliderControl ::RegisterControl(SID_ATTR_ZOOMSLIDER, pMod);
239 31 : SvxModifyControl ::RegisterControl(SID_DOC_MODIFIED, pMod);
240 31 : XmlSecStatusBarControl ::RegisterControl( SID_SIGNATURE, pMod );
241 :
242 31 : SvxPosSizeStatusBarControl ::RegisterControl(SID_ATTR_SIZE, pMod);
243 :
244 : // Svx-Menue-Controller
245 31 : SvxFontMenuControl ::RegisterControl(SID_ATTR_CHAR_FONT, pMod);
246 31 : SvxFontSizeMenuControl ::RegisterControl(SID_ATTR_CHAR_FONTHEIGHT, pMod);
247 :
248 : // CustomShape extrusion controller
249 31 : svx::ExtrusionColorControl::RegisterControl( SID_EXTRUSION_3D_COLOR, pMod );
250 31 : svx::FontWorkShapeTypeControl::RegisterControl( SID_FONTWORK_SHAPE_TYPE, pMod );
251 :
252 : // Child-Windows
253 :
254 : // Hack: Eingabezeile mit 42 registrieren, damit sie im PlugIn immer sichtbar ist
255 31 : ScInputWindowWrapper ::RegisterChildWindow(42, pMod, SFX_CHILDWIN_TASK|SFX_CHILDWIN_FORCEDOCK);
256 : ScNavigatorDialogWrapper ::RegisterChildWindowContext(
257 31 : sal::static_int_cast<sal_uInt16>(ScTabViewShell::GetInterfaceId()), pMod);
258 31 : ScSolverDlgWrapper ::RegisterChildWindow(false, pMod);
259 31 : ScOptSolverDlgWrapper ::RegisterChildWindow(false, pMod);
260 31 : ScXMLSourceDlgWrapper ::RegisterChildWindow(false, pMod);
261 31 : ScNameDlgWrapper ::RegisterChildWindow(false, pMod);
262 31 : ScNameDefDlgWrapper ::RegisterChildWindow(false, pMod);
263 31 : ScPivotLayoutWrapper ::RegisterChildWindow(false, pMod);
264 31 : ScTabOpDlgWrapper ::RegisterChildWindow(false, pMod);
265 31 : ScFilterDlgWrapper ::RegisterChildWindow(false, pMod);
266 31 : ScSpecialFilterDlgWrapper ::RegisterChildWindow(false, pMod);
267 31 : ScDbNameDlgWrapper ::RegisterChildWindow(false, pMod);
268 31 : ScConsolidateDlgWrapper ::RegisterChildWindow(false, pMod);
269 31 : ScPrintAreasDlgWrapper ::RegisterChildWindow(false, pMod);
270 31 : ScColRowNameRangesDlgWrapper::RegisterChildWindow(false, pMod);
271 31 : ScFormulaDlgWrapper ::RegisterChildWindow(false, pMod);
272 :
273 : // First docking Window for Calc
274 31 : ScFunctionChildWindow ::RegisterChildWindow(false, pMod);
275 :
276 : // Redlining- Window
277 31 : ScAcceptChgDlgWrapper ::RegisterChildWindow(false, pMod);
278 31 : ScSimpleRefDlgWrapper ::RegisterChildWindow(false, pMod, SFX_CHILDWIN_ALWAYSAVAILABLE|SFX_CHILDWIN_NEVERHIDE );
279 31 : ScHighlightChgDlgWrapper ::RegisterChildWindow(false, pMod);
280 :
281 31 : SvxSearchDialogWrapper ::RegisterChildWindow(false, pMod);
282 31 : SvxHlinkDlgWrapper ::RegisterChildWindow(false, pMod);
283 31 : SvxFontWorkChildWindow ::RegisterChildWindow(false, pMod);
284 31 : SvxIMapDlgChildWindow ::RegisterChildWindow(false, pMod);
285 31 : GalleryChildWindow ::RegisterChildWindow(false, pMod);
286 31 : ScSpellDialogChildWindow ::RegisterChildWindow(false, pMod);
287 :
288 31 : ScValidityRefChildWin::RegisterChildWindow(false, pMod);
289 :
290 : // Edit-Engine-Felder, soweit nicht schon in OfficeApplication::Init
291 :
292 31 : SvClassManager& rClassManager = SvxFieldItem::GetClassManager();
293 31 : rClassManager.Register(SvxPagesField::StaticClassId(), SvxPagesField::CreateInstance);
294 31 : rClassManager.Register(SvxFileField::StaticClassId(), SvxFileField::CreateInstance);
295 31 : rClassManager.Register(SvxTableField::StaticClassId(), SvxTableField::CreateInstance);
296 :
297 31 : SdrRegisterFieldClasses(); // SvDraw-Felder registrieren
298 :
299 : // 3D-Objekt-Factory eintragen
300 31 : E3dObjFactory();
301 :
302 : // ::com::sun::star::form::component::Form-Objekt-Factory eintragen
303 31 : FmFormObjFactory();
304 :
305 31 : pMod->PutItem( SfxUInt16Item( SID_ATTR_METRIC, sal::static_int_cast<sal_uInt16>(pMod->GetAppOptions().GetAppMetric()) ) );
306 :
307 : // StarOne Services are now handled in the registry
308 93 : }
309 :
310 : // DetectFilter functionality has moved - please update your bookmarks
311 : // see sc/source/ui/unoobj/scdetect.cxx, have a nice day.
312 :
313 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|