xref: /AOO41X/main/sd/inc/sddll.hxx (revision 54628ca40d27d15cc98fe861da7fff7e60c2f7d6)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _SDDLL_HXX
25 #define _SDDLL_HXX
26 
27 #include "sdmod.hxx"
28 #include <sfx2/module.hxx>
29 #include <sfx2/sfxdefs.hxx>
30 
31 class SvFactory;
32 class SotFactory;
33 class SfxMedium;
34 class SfxFilter;
35 
36 
37 /*************************************************************************
38 |*
39 |* This class is a wrapper for a Load-On-Demand-DLL. One instance
40 |* per SfxApplication will be created for the runtime of
41 |* SfxApplication-subclass::Main().
42 |*
43 |* Remember: Do export this class! It is used by the application.
44 |*
45 \************************************************************************/
46 
47 class SdDLL
48 {
49 protected:
50     static void     RegisterFactorys();
51     static void     RegisterInterfaces();
52     static void     RegisterControllers();
53 
54 public:
55                     // Ctor/Dtor must be linked to the application
56                     SdDLL();
57                     ~SdDLL();
58 
59                     // static-init/exit-code must be linked to the application
60     static void     LibInit();  // called from SfxApplication-subclass::Init()
61     static void     LibExit();  // called from SfxApplication-subclass::Exit()
62 
63                     // DLL-init/exit-code must be linked to the DLL only
64     static void     Init();     // called directly after loading the DLL
65     static void     Exit();     // called directly befor unloading the DLL
66 };
67 
68 
69 
70 #ifndef _SD_DLL                      // Das define muss im Draw gesetzt werden
71 #define SD_MOD() ( *(SdModule**) GetAppData(SHL_DRAW) )
72 #endif
73 
74 #endif                               // _SDDLL_HXX
75 
76