Update ooo320-m1
[ooovba.git] / binfilter / inc / bf_sw / swdll.hxx
blobeb9bcf1fb75b770c2c5735ef9dcb7ef5c8cb70c2
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: swdll.hxx,v $
10 * $Revision: 1.7 $
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 #ifndef SW_SWDLL_HXX
32 #define SW_SWDLL_HXX
34 class ResMgr;
35 class SvFactory;
36 class SotFactory;
37 class StatusBar;
39 class SfxMedium;
40 class SfxFilter;
42 #ifndef _SFXDEFS_HXX //autogen
43 #include <bf_sfx2/sfxdefs.hxx>
44 #endif
45 #ifndef _SFXMODULE_HXX //autogen
46 #include <bf_sfx2/module.hxx>
47 #endif
49 #include <bf_so3/pseudo.hxx>
51 namespace binfilter {
53 //#include <sal/types.h>
55 //-------------------------------------------------------------------------
57 class SwDLL
59 /* [Description]
61 This class is a wrapper for a Load-On-Demand-DLL. One instance
62 per SfxApplication will be created for the runtime of
63 SfxApplication-subclass::Main().
65 Remember: Do export this class! It is used by the application.
70 static void RegisterFactories();
72 public:
73 // Ctor/Dtor must be linked to the application
74 SwDLL();
75 ~SwDLL();
77 // static-init/exit-code must be linked to the application
78 static void LibInit(); // called from SfxApplication-subclass::Init()
79 static void LibExit(); // called from SfxApplication-subclass::Exit()
81 // DLL-init/exit-code must be linked to the DLL only
82 static void Init(); // called directly after loading the DLL
83 static void Exit(); // called directly befor unloading the DLL
85 static ULONG DetectFilter( SfxMedium& rMedium, const SfxFilter** ppFilter,
86 SfxFilterFlags nMust, SfxFilterFlags nDont );
87 static ULONG GlobDetectFilter( SfxMedium& rMedium, const SfxFilter** ppFilter,
88 SfxFilterFlags nMust, SfxFilterFlags nDont );
90 static sal_Bool RegisterFrameLoaders( void* pServiceManager, void* pRegistryKey );
91 static void* CreateFrameLoader( const sal_Char* pImplementationName, void* pServiceManager, void *pRegistryKey );
94 //-------------------------------------------------------------------------
96 class SwModuleDummy : public SfxModule
98 /* [Description]
100 This tricky class keeps pointers to the SvFactories while
101 the DLL isn`t loaded. A pointer to the one instance is available
102 through SXX_MOD() (shared-lib-app-data).
106 public:
107 virtual ~SwModuleDummy();
108 TYPEINFO();
109 // SvFactory name convention:
110 // 'p' + SfxObjectShell-subclass + 'Factory'
111 SotFactory* pSwDocShellFactory;
112 SotFactory* pSwWebDocShellFactory;
113 SotFactory* pSwGlobalDocShellFactory;
115 SwModuleDummy( ResMgr *pResMgr, BOOL bDummy,
116 SotFactory* pWebFact,
117 SotFactory* pFact,
118 SotFactory* pGlobalFact )
119 : SfxModule(pResMgr, bDummy,
120 (SfxObjectFactory*)pFact,
121 (SfxObjectFactory*)pWebFact,
122 (SfxObjectFactory*)pGlobalFact, 0L),
123 pSwDocShellFactory( pFact ),
124 pSwWebDocShellFactory( pWebFact ),
125 pSwGlobalDocShellFactory( pGlobalFact )
128 virtual SfxModule* Load();
131 //-------------------------------------------------------------------------
133 #define SW_DLL() ( *(SwModuleDummy**) GetAppData(BF_SHL_WRITER) )
135 } //namespace binfilter
136 #endif