Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #include <editeng/eeitem.hxx>
30 : :
31 : :
32 : : #include <svx/fmobjfac.hxx>
33 : : #include <svx/objfac3d.hxx>
34 : : #include <svx/tbxcolor.hxx>
35 : :
36 : : #include <sot/clsids.hxx>
37 : : #include <sfx2/taskpane.hxx>
38 : : #include <sfx2/docfilt.hxx>
39 : : #include <sfx2/fcontnr.hxx>
40 : : #include <sfx2/docfile.hxx>
41 : : #include <sfx2/app.hxx>
42 : : #include <avmedia/mediaplayer.hxx>
43 : : #include <avmedia/mediatoolbox.hxx>
44 : : #include <comphelper/types.hxx>
45 : : #include <svx/extrusioncolorcontrol.hxx>
46 : : #include <svx/fontworkgallery.hxx>
47 : : #include <svx/tbxcustomshapes.hxx>
48 : :
49 : : #include <svtools/parhtml.hxx>
50 : : #include <sot/formats.hxx>
51 : :
52 : : #include "scitems.hxx" // fuer tbxctrls etc.
53 : : #include "scmod.hxx"
54 : : #include "scresid.hxx"
55 : : #include "sc.hrc"
56 : : #include "cfgids.hxx"
57 : :
58 : : //! die Registrierung wird wegen CLOOKs in ein eigenes File wandern muessen...
59 : :
60 : : // Interface-Registrierung
61 : : #include "docsh.hxx"
62 : : #include "tabvwsh.hxx"
63 : : #include "prevwsh.hxx"
64 : : #include "drawsh.hxx"
65 : : #include "drformsh.hxx"
66 : : #include "drtxtob.hxx"
67 : : #include "editsh.hxx"
68 : : #include "pivotsh.hxx"
69 : : #include "auditsh.hxx"
70 : : #include "cellsh.hxx"
71 : : #include "oleobjsh.hxx"
72 : : #include "chartsh.hxx"
73 : : #include "graphsh.hxx"
74 : : #include "mediash.hxx"
75 : : #include "pgbrksh.hxx"
76 : :
77 : : #include "docpool.hxx"
78 : : #include "appoptio.hxx"
79 : :
80 : : // Controls
81 : :
82 : : #include <svx/tbxalign.hxx>
83 : : #include <svx/tbxctl.hxx>
84 : : #include <svx/fillctrl.hxx>
85 : : #include <svx/linectrl.hxx>
86 : : #include <svx/tbcontrl.hxx>
87 : : #include <svx/selctrl.hxx>
88 : : #include <svx/insctrl.hxx>
89 : : #include <svx/zoomctrl.hxx>
90 : : #include <editeng/flditem.hxx>
91 : : #include <svx/modctrl.hxx>
92 : : #include <svx/pszctrl.hxx>
93 : : #include <svx/fntctl.hxx>
94 : : #include <svx/fntszctl.hxx>
95 : : #include <svx/grafctrl.hxx>
96 : : #include <svx/galbrws.hxx>
97 : : #include <svx/clipboardctl.hxx>
98 : : #include <svx/lboxctrl.hxx>
99 : : #include <svx/verttexttbxctrl.hxx>
100 : : #include <svx/formatpaintbrushctrl.hxx>
101 : : #include "tbinsert.hxx"
102 : : #include "tbzoomsliderctrl.hxx"
103 : : #include <svx/zoomsliderctrl.hxx>
104 : :
105 : : #include <svx/xmlsecctrl.hxx>
106 : : // Child-Windows
107 : : #include "reffact.hxx"
108 : : #include "navipi.hxx"
109 : : #include "inputwin.hxx"
110 : : #include "spelldialog.hxx"
111 : : #include <svx/fontwork.hxx>
112 : : #include <svx/srchdlg.hxx>
113 : : #include <svx/hyperdlg.hxx>
114 : : #include <svx/imapdlg.hxx>
115 : :
116 : : #include "editutil.hxx"
117 : : #include <svx/svdfield.hxx> // SdrRegisterFieldClasses
118 : : #include <rtl/logfile.hxx>
119 : :
120 : : #include "dwfunctr.hxx"
121 : : #include "acredlin.hxx"
122 : :
123 : : //------------------------------------------------------------------
124 : :
125 : :
126 : : //------------------------------------------------------------------
127 : :
128 : 21036 : ScResId::ScResId( sal_uInt16 nId ) :
129 : 21036 : ResId( nId, *SC_MOD()->GetResMgr() )
130 : : {
131 : 21036 : }
132 : :
133 : : //------------------------------------------------------------------
134 : :
135 : 669 : void ScDLL::Init()
136 : : {
137 : : RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "sc", "nn93723", "ScDLL::Init" );
138 : :
139 : 669 : ScModule **ppShlPtr = (ScModule**) GetAppData(SHL_CALC);
140 [ + + ]: 669 : if ( *ppShlPtr )
141 : 669 : return;
142 : :
143 : 51 : ScDocumentPool::InitVersionMaps(); // wird im ScModule ctor gebraucht
144 : :
145 [ + - ]: 51 : ScModule* pMod = new ScModule( &ScDocShell::Factory() );
146 : 51 : (*ppShlPtr) = pMod;
147 : :
148 [ + - ][ + - ]: 51 : ScDocShell::Factory().SetDocumentServiceName( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sheet.SpreadsheetDocument" )) );
149 : :
150 : 51 : ScGlobal::Init(); // erst wenn der ResManager initialisiert ist
151 : : // erst nach ScGlobal::Init duerfen die App-Optionen
152 : : // initialisiert werden
153 : :
154 : : // register your view-factories here
155 : :
156 : 51 : ScTabViewShell ::RegisterFactory(1);
157 : 51 : ScPreviewShell ::RegisterFactory(2);
158 : :
159 : : // register your shell-interfaces here
160 : :
161 : 51 : ScModule ::RegisterInterface(pMod);
162 : 51 : ScDocShell ::RegisterInterface(pMod);
163 : 51 : ScTabViewShell ::RegisterInterface(pMod);
164 : 51 : ScPreviewShell ::RegisterInterface(pMod);
165 : 51 : ScDrawShell ::RegisterInterface(pMod);
166 : 51 : ScDrawFormShell ::RegisterInterface(pMod);
167 : 51 : ScDrawTextObjectBar ::RegisterInterface(pMod);
168 : 51 : ScEditShell ::RegisterInterface(pMod);
169 : 51 : ScPivotShell ::RegisterInterface(pMod);
170 : 51 : ScAuditingShell ::RegisterInterface(pMod);
171 : 51 : ScFormatShell ::RegisterInterface(pMod);
172 : 51 : ScCellShell ::RegisterInterface(pMod);
173 : 51 : ScOleObjectShell ::RegisterInterface(pMod);
174 : 51 : ScChartShell ::RegisterInterface(pMod);
175 : 51 : ScGraphicShell ::RegisterInterface(pMod);
176 : 51 : ScMediaShell ::RegisterInterface(pMod);
177 : 51 : ScPageBreakShell ::RegisterInterface(pMod);
178 : :
179 : : // eigene Controller
180 : 51 : ScTbxInsertCtrl ::RegisterControl(SID_TBXCTL_INSERT, pMod);
181 : 51 : ScTbxInsertCtrl ::RegisterControl(SID_TBXCTL_INSCELLS, pMod);
182 : 51 : ScTbxInsertCtrl ::RegisterControl(SID_TBXCTL_INSOBJ, pMod);
183 : 51 : ScZoomSliderControl ::RegisterControl(SID_PREVIEW_SCALINGFACTOR, pMod);
184 : :
185 : : // Svx-Toolbox-Controller
186 : 51 : SvxTbxCtlDraw ::RegisterControl(SID_INSERT_DRAW, pMod);
187 : 51 : SvxTbxCtlCustomShapes ::RegisterControl(SID_DRAWTBX_CS_BASIC, pMod);
188 : 51 : SvxTbxCtlCustomShapes ::RegisterControl(SID_DRAWTBX_CS_SYMBOL, pMod);
189 : 51 : SvxTbxCtlCustomShapes ::RegisterControl(SID_DRAWTBX_CS_ARROW, pMod);
190 : 51 : SvxTbxCtlCustomShapes ::RegisterControl(SID_DRAWTBX_CS_FLOWCHART, pMod);
191 : 51 : SvxTbxCtlCustomShapes ::RegisterControl(SID_DRAWTBX_CS_CALLOUT, pMod);
192 : 51 : SvxTbxCtlCustomShapes ::RegisterControl(SID_DRAWTBX_CS_STAR, pMod);
193 : 51 : SvxTbxCtlAlign ::RegisterControl(SID_OBJECT_ALIGN, pMod);
194 : 51 : SvxFillToolBoxControl ::RegisterControl(0, pMod);
195 : 51 : SvxLineStyleToolBoxControl ::RegisterControl(0, pMod);
196 : 51 : SvxLineWidthToolBoxControl ::RegisterControl(0, pMod);
197 : 51 : SvxLineColorToolBoxControl ::RegisterControl(0, pMod);
198 : 51 : SvxLineEndToolBoxControl ::RegisterControl(SID_ATTR_LINEEND_STYLE, pMod);
199 : 51 : SvxStyleToolBoxControl ::RegisterControl(SID_STYLE_APPLY, pMod);
200 : 51 : SvxFontNameToolBoxControl ::RegisterControl(SID_ATTR_CHAR_FONT, pMod);
201 : 51 : SvxColorExtToolBoxControl ::RegisterControl(SID_ATTR_CHAR_COLOR, pMod);
202 : 51 : SvxColorExtToolBoxControl ::RegisterControl(SID_BACKGROUND_COLOR, pMod);
203 : 51 : SvxFrameToolBoxControl ::RegisterControl(SID_ATTR_BORDER, pMod);
204 : 51 : SvxFrameLineStyleToolBoxControl ::RegisterControl(SID_FRAME_LINESTYLE, pMod);
205 : 51 : SvxColorExtToolBoxControl ::RegisterControl(SID_FRAME_LINECOLOR, pMod);
206 : 51 : SvxClipBoardControl ::RegisterControl(SID_PASTE, pMod );
207 : 51 : SvxUndoRedoControl ::RegisterControl(SID_UNDO, pMod );
208 : 51 : SvxUndoRedoControl ::RegisterControl(SID_REDO, pMod );
209 : 51 : svx::FormatPaintBrushToolBoxControl::RegisterControl(SID_FORMATPAINTBRUSH, pMod );
210 : :
211 : 51 : SvxGrafModeToolBoxControl ::RegisterControl(SID_ATTR_GRAF_MODE, pMod);
212 : 51 : SvxGrafRedToolBoxControl ::RegisterControl(SID_ATTR_GRAF_RED, pMod);
213 : 51 : SvxGrafGreenToolBoxControl ::RegisterControl(SID_ATTR_GRAF_GREEN, pMod);
214 : 51 : SvxGrafBlueToolBoxControl ::RegisterControl(SID_ATTR_GRAF_BLUE, pMod);
215 : 51 : SvxGrafLuminanceToolBoxControl ::RegisterControl(SID_ATTR_GRAF_LUMINANCE, pMod);
216 : 51 : SvxGrafContrastToolBoxControl ::RegisterControl(SID_ATTR_GRAF_CONTRAST, pMod);
217 : 51 : SvxGrafGammaToolBoxControl ::RegisterControl(SID_ATTR_GRAF_GAMMA, pMod);
218 : 51 : SvxGrafTransparenceToolBoxControl::RegisterControl(SID_ATTR_GRAF_TRANSPARENCE, pMod);
219 : 51 : SvxGrafFilterToolBoxControl ::RegisterControl(SID_GRFFILTER, pMod);
220 : :
221 : 51 : SvxVertTextTbxCtrl::RegisterControl(SID_DRAW_CAPTION_VERTICAL, pMod);
222 : 51 : SvxVertTextTbxCtrl::RegisterControl(SID_DRAW_TEXT_VERTICAL, pMod);
223 : 51 : SvxVertTextTbxCtrl::RegisterControl(SID_TEXTDIRECTION_LEFT_TO_RIGHT, pMod);
224 : 51 : SvxVertTextTbxCtrl::RegisterControl(SID_TEXTDIRECTION_TOP_TO_BOTTOM, pMod);
225 : 51 : SvxCTLTextTbxCtrl::RegisterControl(SID_ATTR_PARA_LEFT_TO_RIGHT, pMod);
226 : 51 : SvxCTLTextTbxCtrl::RegisterControl(SID_ATTR_PARA_RIGHT_TO_LEFT, pMod);
227 : :
228 : : //Media Controller
229 : 51 : ::avmedia::MediaToolBoxControl::RegisterControl( SID_AVMEDIA_TOOLBOX, pMod );
230 : :
231 : : // common SFX controller
232 : 51 : ::sfx2::TaskPaneWrapper::RegisterChildWindow( false, pMod );
233 : :
234 : : // Svx-StatusBar-Controller
235 : 51 : SvxInsertStatusBarControl ::RegisterControl(SID_ATTR_INSERT, pMod);
236 : 51 : SvxSelectionModeControl ::RegisterControl(SID_STATUS_SELMODE, pMod);
237 : 51 : SvxZoomStatusBarControl ::RegisterControl(SID_ATTR_ZOOM, pMod);
238 : 51 : SvxZoomSliderControl ::RegisterControl(SID_ATTR_ZOOMSLIDER, pMod);
239 : 51 : SvxModifyControl ::RegisterControl(SID_DOC_MODIFIED, pMod);
240 : 51 : XmlSecStatusBarControl ::RegisterControl( SID_SIGNATURE, pMod );
241 : :
242 : 51 : SvxPosSizeStatusBarControl ::RegisterControl(SID_ATTR_SIZE, pMod);
243 : :
244 : : // Svx-Menue-Controller
245 : 51 : SvxFontMenuControl ::RegisterControl(SID_ATTR_CHAR_FONT, pMod);
246 : 51 : SvxFontSizeMenuControl ::RegisterControl(SID_ATTR_CHAR_FONTHEIGHT, pMod);
247 : :
248 : : // CustomShape extrusion controller
249 : 51 : svx::ExtrusionColorControl::RegisterControl( SID_EXTRUSION_3D_COLOR, pMod );
250 : 51 : 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 : 51 : ScInputWindowWrapper ::RegisterChildWindow(42, pMod, SFX_CHILDWIN_TASK|SFX_CHILDWIN_FORCEDOCK);
256 : : ScNavigatorDialogWrapper ::RegisterChildWindowContext(
257 : 51 : sal::static_int_cast<sal_uInt16>(ScTabViewShell::GetInterfaceId()), pMod);
258 : 51 : ScSolverDlgWrapper ::RegisterChildWindow(false, pMod);
259 : 51 : ScOptSolverDlgWrapper ::RegisterChildWindow(false, pMod);
260 : 51 : ScNameDlgWrapper ::RegisterChildWindow(false, pMod);
261 : 51 : ScNameDefDlgWrapper ::RegisterChildWindow(false, pMod);
262 : 51 : ScPivotLayoutWrapper ::RegisterChildWindow(false, pMod);
263 : 51 : ScTabOpDlgWrapper ::RegisterChildWindow(false, pMod);
264 : 51 : ScFilterDlgWrapper ::RegisterChildWindow(false, pMod);
265 : 51 : ScSpecialFilterDlgWrapper ::RegisterChildWindow(false, pMod);
266 : 51 : ScDbNameDlgWrapper ::RegisterChildWindow(false, pMod);
267 : 51 : ScConsolidateDlgWrapper ::RegisterChildWindow(false, pMod);
268 : 51 : ScPrintAreasDlgWrapper ::RegisterChildWindow(false, pMod);
269 : 51 : ScColRowNameRangesDlgWrapper::RegisterChildWindow(false, pMod);
270 : 51 : ScFormulaDlgWrapper ::RegisterChildWindow(false, pMod);
271 : :
272 : : // First docking Window for Calc
273 : 51 : ScFunctionChildWindow ::RegisterChildWindow(false, pMod);
274 : :
275 : : // Redlining- Window
276 : 51 : ScAcceptChgDlgWrapper ::RegisterChildWindow(false, pMod);
277 : 51 : ScSimpleRefDlgWrapper ::RegisterChildWindow(false, pMod, SFX_CHILDWIN_ALWAYSAVAILABLE|SFX_CHILDWIN_NEVERHIDE );
278 : 51 : ScHighlightChgDlgWrapper ::RegisterChildWindow(false, pMod);
279 : :
280 : 51 : SvxSearchDialogWrapper ::RegisterChildWindow(false, pMod);
281 : 51 : SvxHlinkDlgWrapper ::RegisterChildWindow(false, pMod);
282 : 51 : SvxFontWorkChildWindow ::RegisterChildWindow(false, pMod);
283 : 51 : SvxIMapDlgChildWindow ::RegisterChildWindow(false, pMod);
284 : 51 : GalleryChildWindow ::RegisterChildWindow(false, pMod);
285 : 51 : ScSpellDialogChildWindow ::RegisterChildWindow(false, pMod);
286 : :
287 : 51 : ScValidityRefChildWin::RegisterChildWindow(false, pMod);
288 : :
289 : : // Edit-Engine-Felder, soweit nicht schon in OfficeApplication::Init
290 : :
291 : 51 : SvClassManager& rClassManager = SvxFieldItem::GetClassManager();
292 : 51 : rClassManager.Register(SvxPagesField::StaticClassId(), SvxPagesField::CreateInstance);
293 : 51 : rClassManager.Register(SvxFileField::StaticClassId(), SvxFileField::CreateInstance);
294 : 51 : rClassManager.Register(SvxTableField::StaticClassId(), SvxTableField::CreateInstance);
295 : :
296 : 51 : SdrRegisterFieldClasses(); // SvDraw-Felder registrieren
297 : :
298 : : // 3D-Objekt-Factory eintragen
299 : 51 : E3dObjFactory();
300 : :
301 : : // ::com::sun::star::form::component::Form-Objekt-Factory eintragen
302 : 51 : FmFormObjFactory();
303 : :
304 [ + - ]: 51 : pMod->PutItem( SfxUInt16Item( SID_ATTR_METRIC, sal::static_int_cast<sal_uInt16>(pMod->GetAppOptions().GetAppMetric()) ) );
305 : :
306 : : // StarOne Services are now handled in the registry
307 : : }
308 : :
309 : : //------------------------------------------------------------------
310 : : // Statusbar
311 : : //------------------------------------------------------------------
312 : :
313 : : #define TEXT_WIDTH(s) rStatusBar.GetTextWidth((s))
314 : :
315 : : #undef TEXT_WIDTH
316 : :
317 : : // DetectFilter functionality has moved - please update your bookmarks
318 : : // see sc/source/ui/unoobj/scdetect.cxx, have a nice day.
319 : :
320 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|