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