xref: /trunk/main/vos/inc/vos/module.hxx (revision d98e0520)
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 
25 #ifndef _VOS_MODULE_HXX_
26 #define _VOS_MODULE_HXX_
27 
28 #   include <vos/object.hxx>
29 #   include <rtl/ustring.hxx>
30 #   include <osl/module.h>
31 #   include <vos/vosdllapi.h>
32 
33 namespace vos
34 {
35 
36 class VOS_DLLPUBLIC OModule : public OObject
37 {
38     VOS_DECLARE_CLASSINFO(VOS_NAMESPACE(OModule, vos));
39 
40 public:
41 
42     /// default c'tor
43     OModule();
44 
45     /// this c'tor is a combination of the default c'tor and load()
46     OModule(const ::rtl::OUString& strModuleName, sal_Int32 nRtldMode = SAL_LOADMODULE_DEFAULT);
47     virtual ~OModule();
48 
49     /// loads the specified module
50     sal_Bool SAL_CALL load(const ::rtl::OUString& strModuleName, sal_Int32 nRtldMode = SAL_LOADMODULE_DEFAULT);
51 
52     /// unloads the currently loaded module
53     void SAL_CALL unload();
54 
55     /// returns sal_True, if a module is loaded, sal_False otherwise
56     sal_Bool SAL_CALL isLoaded();
57 
58 #if 0
59     // not implemented yet
60     // returns the name of the currently loaded module or an empty string if none.
61     ::rtl::OUString SAL_CALL getModuleName();
62 #endif
63 
64     /// returns a pointer to the specified Symbol if found, NULL otherwise
65     void* SAL_CALL getSymbol(const ::rtl::OUString& strSymbolName);
66 
67 protected:
68 
69     oslModule m_Module;
70 };
71 
72 }
73 
74 #endif
75 
76 
77