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 #ifndef _CPPUHELPER_SHLIB_HXX_
24 #define _CPPUHELPER_SHLIB_HXX_
25 
26 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
27 #include <com/sun/star/registry/XRegistryKey.hpp>
28 #include <com/sun/star/loader/CannotActivateFactoryException.hpp>
29 #include <com/sun/star/registry/CannotRegisterImplementationException.hpp>
30 
31 
32 namespace cppu
33 {
34 
35 /** Loads a shared library component and gets the factory out of it.  You can give either a
36     fully qualified libname or single lib name.  The libname need not be pre/postfixed
37     (e.g. xxx.dll).  You can give parameter rPath to force lookup of the library in a specific
38     directory.  The resulting path of the library will be checked against environment variable
39     CPLD_ACCESSPATH if set.
40 
41 	@param rLibName name of the library
42 	@param rPath optional path
43 	@param rImplName implementation to be retrieved from the library
44 	@param xMgr service manager to be provided to the component
45 	@param xKey registry key to be provided to the component
46     @return
47     factory instance (::com::sun::star::lang::XSingleComponentFactory or
48     ::com::sun::star::lang::XSingleComponentFactory)
49 */
50 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
51 SAL_CALL loadSharedLibComponentFactory(
52 	::rtl::OUString const & rLibName, ::rtl::OUString const & rPath,
53 	::rtl::OUString const & rImplName,
54 	::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > const & xMgr,
55 	::com::sun::star::uno::Reference< ::com::sun::star::registry::XRegistryKey > const & xKey )
56 	SAL_THROW( (::com::sun::star::loader::CannotActivateFactoryException) );
57 
58 /** Invokes component_writeInfo() function of specified component library.  You can give either
59     a fully qualified libname or single lib name. The libname need not be pre/postfixed
60     (e.g. xxx.dll).  You can give parameter rPath to force lookup of the library in a specific
61     directory.  The resulting path of the library will be checked against environment variable
62     CPLD_ACCESSPATH if set.
63 
64     @obsolete component_writeInfo should no longer be used in new components
65 
66 	@param rLibName name of the library
67 	@param rPath optional path
68 	@param xMgr service manager to be provided to the component
69 	@param xKey registry key to be provided to the component
70 */
71 void
72 SAL_CALL writeSharedLibComponentInfo(
73 	::rtl::OUString const & rLibName, ::rtl::OUString const & rPath,
74 	::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > const & xMgr,
75 	::com::sun::star::uno::Reference< ::com::sun::star::registry::XRegistryKey > const & xKey )
76 	SAL_THROW( (::com::sun::star::registry::CannotRegisterImplementationException) );
77 
78 } // end namespace cppu
79 
80 #endif
81