update credits
[LibreOffice.git] / include / cppuhelper / shlib.hxx
blob666359fac8514441e6efcb2b12f8a8fea1b525a0
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef _CPPUHELPER_SHLIB_HXX_
20 #define _CPPUHELPER_SHLIB_HXX_
22 #include <osl/module.hxx>
23 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
24 #include <com/sun/star/registry/XRegistryKey.hpp>
25 #include <com/sun/star/loader/CannotActivateFactoryException.hpp>
26 #include <com/sun/star/registry/CannotRegisterImplementationException.hpp>
27 #include "cppuhelperdllapi.h"
30 namespace cppu
33 // Note the pointless redundancy
34 // "::com::sun::star::lang::XSingleComponentFactory or
35 // ::com::sun::star::lang::XSingleComponentFactory" in the doc
36 // comments below. Whether the documentation is supposed to mean only
37 // XSingleComponentFactory, or whether the other one should be
38 // something else, I don't know.
40 /** Loads a shared library component and gets the factory out of it. You can give either a
41 fully qualified libname or single lib name. The libname need not be pre/postfixed
42 (e.g. xxx.dll). You can give parameter rPath to force lookup of the library in a specific
43 directory. The resulting path of the library will be checked against environment variable
44 CPLD_ACCESSPATH if set.
46 @param rLibName name of the library
47 @param rPath optional path
48 @param rImplName implementation to be retrieved from the library
49 @param xMgr service manager to be provided to the component
50 @param xKey registry key to be provided to the component
51 @return
52 factory instance (com::sun::star::lang::XSingleComponentFactory or
53 com::sun::star::lang::XSingleComponentFactory)
55 CPPUHELPER_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
56 SAL_CALL loadSharedLibComponentFactory(
57 ::rtl::OUString const & rLibName, ::rtl::OUString const & rPath,
58 ::rtl::OUString const & rImplName,
59 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > const & xMgr,
60 ::com::sun::star::uno::Reference< ::com::sun::star::registry::XRegistryKey > const & xKey )
61 SAL_THROW( (::com::sun::star::loader::CannotActivateFactoryException) );
63 /** Loads a shared library component and gets the factory out of it. You can give either a
64 fully qualified libname or single lib name. The libname need not be pre/postfixed
65 (e.g. xxx.dll). You can give parameter rPath to force lookup of the library in a specific
66 directory. The resulting path of the library will be checked against environment variable
67 CPLD_ACCESSPATH if set. An optional 'prefix' parameter is used to determine the symbol
68 name of the entry point in the library.
70 @param rLibName name of the library
71 @param rPath optional path
72 @param rImplName implementation to be retrieved from the library
73 @param xMgr service manager to be provided to the component
74 @param xKey registry key to be provided to the component
75 @param rPrefix optional component prefix
76 @return
77 factory instance (com::sun::star::lang::XSingleComponentFactory or
78 com::sun::star::lang::XSingleComponentFactory)
80 CPPUHELPER_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
81 SAL_CALL loadSharedLibComponentFactory(
82 ::rtl::OUString const & rLibName, ::rtl::OUString const & rPath,
83 ::rtl::OUString const & rImplName,
84 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > const & xMgr,
85 ::com::sun::star::uno::Reference< ::com::sun::star::registry::XRegistryKey > const & xKey,
86 ::rtl::OUString const & rPrefix )
87 SAL_THROW( (::com::sun::star::loader::CannotActivateFactoryException) );
89 /** Gets the factory out of an already loaded (for instance statically linked) component.
91 @param pGetter the component's component_getFactory function
92 @param rImplName implementation to be retrieved from the library
93 @param xMgr service manager to be provided to the component
94 @param xKey registry key to be provided to the component
95 @param rPrefix optional component prefix
96 @return
97 factory instance (com::sun::star::lang::XSingleComponentFactory or
98 com::sun::star::lang::XSingleComponentFactory)
100 CPPUHELPER_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
101 SAL_CALL invokeStaticComponentFactory(
102 oslGenericFunction pGetter,
103 ::rtl::OUString const & rImplName,
104 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > const & xMgr,
105 ::com::sun::star::uno::Reference< ::com::sun::star::registry::XRegistryKey > const & xKey,
106 ::rtl::OUString const & rPrefix )
107 SAL_THROW( (::com::sun::star::loader::CannotActivateFactoryException) );
109 /** Invokes component_writeInfo() function of specified component library. You can give either
110 a fully qualified libname or single lib name. The libname need not be pre/postfixed
111 (e.g. xxx.dll). You can give parameter rPath to force lookup of the library in a specific
112 directory. The resulting path of the library will be checked against environment variable
113 CPLD_ACCESSPATH if set.
115 @deprecated component_writeInfo should no longer be used in new components
117 @param rLibName name of the library
118 @param rPath optional path
119 @param xMgr service manager to be provided to the component
120 @param xKey registry key to be provided to the component
122 CPPUHELPER_DLLPUBLIC void
123 SAL_CALL writeSharedLibComponentInfo(
124 ::rtl::OUString const & rLibName, ::rtl::OUString const & rPath,
125 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > const & xMgr,
126 ::com::sun::star::uno::Reference< ::com::sun::star::registry::XRegistryKey > const & xKey )
127 SAL_THROW( (::com::sun::star::registry::CannotRegisterImplementationException) );
129 } // end namespace cppu
131 #endif
133 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */