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