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 : #include <editeng/editeng.hxx>
23 : #include <svx/svdobj.hxx>
24 : #include <unotools/moduleoptions.hxx>
25 : #include <svx/fmobjfac.hxx>
26 : #include <svx/svdfield.hxx>
27 : #include <svx/objfac3d.hxx>
28 :
29 : #include "sddll.hxx"
30 : #include "DrawDocShell.hxx"
31 : #include "GraphicDocShell.hxx"
32 : #include "sdresid.hxx"
33 : #include "sdobjfac.hxx"
34 : #include "cfgids.hxx"
35 : #include "strmname.h"
36 : #include "SdShapeTypes.hxx"
37 :
38 : #include <svx/SvxShapeTypes.hxx>
39 : #include <sfx2/docfilt.hxx>
40 : #include <sfx2/docfile.hxx>
41 : #include <sfx2/fcontnr.hxx>
42 : #include <svtools/FilterConfigItem.hxx>
43 : #include <comphelper/processfactory.hxx>
44 :
45 : using namespace ::rtl;
46 : using namespace ::com::sun::star;
47 :
48 :
49 : /*************************************************************************
50 : |*
51 : |* Init
52 : |*
53 : \************************************************************************/
54 :
55 10 : void SdDLL::Init()
56 : {
57 10 : if ( SD_MOD() )
58 17 : return;
59 :
60 3 : SfxObjectFactory* pDrawFact = NULL;
61 3 : SfxObjectFactory* pImpressFact = NULL;
62 :
63 3 : if (SvtModuleOptions().IsImpress())
64 2 : pImpressFact = &::sd::DrawDocShell::Factory();
65 :
66 3 : if (SvtModuleOptions().IsDraw())
67 2 : pDrawFact = &::sd::GraphicDocShell::Factory();
68 :
69 : // the SdModule must be created
70 3 : SdModule** ppShlPtr = (SdModule**) GetAppData(SHL_DRAW);
71 :
72 : // #i46427#
73 : // The SfxModule::SfxModule stops when the first given factory
74 : // is 0, so we must not give a 0 as first factory
75 3 : if( pImpressFact )
76 : {
77 2 : (*ppShlPtr) = new SdModule( pImpressFact, pDrawFact );
78 : }
79 : else
80 : {
81 1 : (*ppShlPtr) = new SdModule( pDrawFact, pImpressFact );
82 : }
83 :
84 3 : if (SvtModuleOptions().IsImpress())
85 : {
86 : // Register the Impress shape types in order to make the shapes accessible.
87 2 : ::accessibility::RegisterImpressShapeTypes ();
88 2 : ::sd::DrawDocShell::Factory().SetDocumentServiceName( "com.sun.star.presentation.PresentationDocument" );
89 : }
90 :
91 3 : if (SvtModuleOptions().IsDraw())
92 : {
93 2 : ::sd::GraphicDocShell::Factory().SetDocumentServiceName( "com.sun.star.drawing.DrawingDocument" );
94 : }
95 :
96 : // register your view-factories here
97 3 : RegisterFactorys();
98 :
99 : // register your shell-interfaces here
100 3 : RegisterInterfaces();
101 :
102 : // register your controllers here
103 3 : RegisterControllers();
104 :
105 : // SvDraw-Felder registrieren
106 3 : SdrRegisterFieldClasses();
107 :
108 : // 3D-Objekt-Factory eintragen
109 3 : E3dObjFactory();
110 :
111 : // ::com::sun::star::form::component::Form-Objekt-Factory eintragen
112 3 : FmFormObjFactory();
113 :
114 : // Objekt-Factory eintragen
115 3 : SdrObjFactory::InsertMakeUserDataHdl(LINK(&aSdObjectFactory, SdObjectFactory, MakeUserData));
116 :
117 : // register your exotic remote controlls here
118 : #ifdef ENABLE_SDREMOTE
119 3 : RegisterRemotes();
120 : #endif
121 9 : }
122 :
123 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|