1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: swdll.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_sw.hxx"
35 #include <svx/svdobj.hxx>
36 #include <rtl/logfile.hxx>
39 #include "globdoc.hrc"
46 #include <globdoc.hxx>
48 #include <swmodule.hxx>
49 #include <swtypes.hxx>
51 #include <dobjfac.hxx>
54 #include <svtools/moduleoptions.hxx>
56 #ifndef _FM_FMOBJFAC_HXX
57 #include <svx/fmobjfac.hxx>
59 #include <svx/svdfield.hxx>
60 #include <svx/objfac3d.hxx>
65 /*************************************************************************
69 \************************************************************************/
73 RTL_LOGFILE_CONTEXT_AUTHOR( aLog
, "SW", "JP93722", "SwDLL" );
75 // the SdModule must be created
76 SwModule
** ppShlPtr
= (SwModule
**) GetAppData(SHL_WRITER
);
80 SvtModuleOptions aOpt
;
81 SfxObjectFactory
* pDocFact
= 0;
82 SfxObjectFactory
* pGlobDocFact
= 0;
83 if ( aOpt
.IsWriter() )
85 pDocFact
= &SwDocShell::Factory();
86 pGlobDocFact
= &SwGlobalDocShell::Factory();
89 SfxObjectFactory
* pWDocFact
= &SwWebDocShell::Factory();
91 SwModule
* pModule
= new SwModule( pWDocFact
, pDocFact
, pGlobDocFact
);
92 (*ppShlPtr
) = pModule
;
94 pWDocFact
->SetDocumentServiceName(C2S("com.sun.star.text.WebDocument"));
96 if ( aOpt
.IsWriter() )
98 pGlobDocFact
->SetDocumentServiceName(C2S("com.sun.star.text.GlobalDocument"));
99 pDocFact
->SetDocumentServiceName(C2S("com.sun.star.text.TextDocument"));
102 // SvDraw-Felder registrieren
103 SdrRegisterFieldClasses();
105 // 3D-Objekt-Factory eintragen
108 // form::component::Form-Objekt-Factory eintragen
111 SdrObjFactory::InsertMakeObjectHdl( LINK( &aSwObjectFactory
, SwObjectFactory
, MakeObject
) );
113 RTL_LOGFILE_CONTEXT_TRACE( aLog
, "Init Core/UI/Filter" );
115 //Initialisierung der Statics
120 pModule
->InitAttrPool();
121 //jetzt darf das SwModule seinen Pool anlegen
123 // register your view-factories here
126 // register your shell-interfaces here
127 RegisterInterfaces();
129 // register your controllers here
135 /*************************************************************************
139 \************************************************************************/
143 // called directly befor unloading the DLL
144 // do whatever you want, Sw-DLL is accessible
146 // der Pool muss vor den statics geloescht werden
147 SW_MOD()->RemoveAttrPool();
152 // Objekt-Factory austragen
153 SdrObjFactory::RemoveMakeObjectHdl(LINK(&aSwObjectFactory
, SwObjectFactory
, MakeObject
));
154 // the SwModule must be destroyed
155 SwModule
** ppShlPtr
= (SwModule
**) GetAppData(SHL_WRITER
);