Update ooo320-m1
[ooovba.git] / binfilter / inc / bf_sc / scdll.hxx
blobb61a15c4cfc91612f007378c937f15fbf42f2919
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: scdll.hxx,v $
10 * $Revision: 1.6 $
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 SC_SCDLL_HXX
32 #define SC_SCDLL_HXX
34 class ResMgr;
35 class SvFactory;
36 class SotFactory;
37 class StatusBar;
38 class SfxMedium;
39 class SfxFilter;
41 #ifndef _SFXDEFS_HXX //autogen
42 #include <bf_sfx2/sfxdefs.hxx>
43 #endif
44 #ifndef _SFXMODULE_HXX //autogen
45 #include <bf_sfx2/module.hxx>
46 #endif
47 #ifndef _SFX_OBJFAC_HXX
48 #include <bf_sfx2/docfac.hxx>
49 #endif
50 namespace binfilter {
52 //-------------------------------------------------------------------------
54 class ScDLL
56 /* [Description]
58 This class is a wrapper for a Load-On-Demand-DLL. One instance
59 per SfxApplication will be created for the runtime of
60 SfxApplication-subclass::Main().
62 Remember: Do export this class! It is used by the application.
66 public:
67 // Ctor/Dtor must be linked to the application
68 ScDLL();
69 ~ScDLL();
71 // static-init/exit-code must be linked to the application
72 static void LibInit(); // called from SfxApplication-subclass::Init()
73 static void LibExit(); // called from SfxApplication-subclass::Exit()
74 static void PreExit(); // muss vor LibExit gerufen werden
76 // DLL-init/exit-code must be linked to the DLL only
77 static void Init(); // called directly after loading the DLL
78 static void Exit(); // called directly befor unloading the DLL
81 static ULONG DetectFilter( SfxMedium& rMedium, const SfxFilter** ppFilter,
82 SfxFilterFlags nMust, SfxFilterFlags nDont );
85 //-------------------------------------------------------------------------
87 class ScModuleDummy: public SfxModule
89 /* [Description]
91 This tricky class keeps pointers to the SvFactories while
92 the DLL isn`t loaded. A pointer to the one instance is available
93 through SXX_MOD() (shared-lib-app-data).
97 public:
98 // SvFactory name convention:
99 // 'p' + SfxObjectShell-subclass + 'Factory'
100 SotFactory* pScDocShellFactory;
102 ScModuleDummy( ResMgr *pResMgr, BOOL bDummy, SfxObjectFactory* pFact )
103 : SfxModule(pResMgr, bDummy, pFact, NULL),
104 pScDocShellFactory(pFact)
107 virtual SfxModule* Load();
110 //-------------------------------------------------------------------------
112 #define SC_DLL() ( *(ScModuleDummy**) GetAppData(BF_SHL_CALC) )
114 } //namespace binfilter
115 #endif