LibreOffice
LibreOffice 5.3 SDK C/C++ API Reference
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
factory.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 #ifndef INCLUDED_CPPUHELPER_FACTORY_HXX
20 #define INCLUDED_CPPUHELPER_FACTORY_HXX
21 
22 #include <sal/config.h>
23 
24 #include <cstddef>
25 
26 #include <rtl/ustring.hxx>
27 #include <rtl/unload.h>
28 
29 #include <com/sun/star/uno/XComponentContext.hpp>
30 #include <com/sun/star/lang/XSingleComponentFactory.hpp>
31 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
32 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
33 #include <com/sun/star/registry/XRegistryKey.hpp>
35 
36 
37 #define COMPONENT_GETENV "component_getImplementationEnvironment"
38 #define COMPONENT_GETENVEXT "component_getImplementationEnvironmentExt"
39 #define COMPONENT_WRITEINFO "component_writeInfo"
40 #define COMPONENT_GETFACTORY "component_getFactory"
41 
43 
54  const sal_Char ** ppEnvTypeName, uno_Environment ** ppEnv );
55 
67  sal_Char const ** ppEnvTypeName,
68  uno_Environment ** ppEnv,
69  sal_Char const * pImplName,
70  uno_Environment * pTargetEnv
71 );
72 
79 typedef const sal_Char * (SAL_CALL * component_getDescriptionFunc)(void);
80 
95 typedef sal_Bool (SAL_CALL * component_writeInfoFunc)(
96  void * pServiceManager, void * pRegistryKey );
97 
113 typedef void * (SAL_CALL * component_getFactoryFunc)(
114  const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey );
115 
116 
117 namespace cppu
118 {
119 
126 typedef css::uno::Reference< css::uno::XInterface >(
127  SAL_CALL * ComponentFactoryFunc)(
128  css::uno::Reference< css::uno::XComponentContext > const & xContext );
129 
138 CPPUHELPER_DLLPUBLIC css::uno::Reference< css::lang::XSingleComponentFactory >
141  ::rtl::OUString const & rImplementationName,
142  css::uno::Sequence< ::rtl::OUString > const & rServiceNames,
143  rtl_ModuleCount * pModCount = NULL );
144 
155 CPPUHELPER_DLLPUBLIC css::uno::Reference< css::lang::XSingleComponentFactory > SAL_CALL
158  ::rtl::OUString const & rImplementationName,
159  css::uno::Sequence< ::rtl::OUString > const & rServiceNames,
160  rtl_ModuleCount * pModCount = NULL );
161 
168 typedef css::uno::Reference< css::uno::XInterface >(SAL_CALL * ComponentInstantiation)(
169  const css::uno::Reference< css::lang::XMultiServiceFactory > & rServiceManager );
170 
185 CPPUHELPER_DLLPUBLIC css::uno::Reference< css::lang::XSingleServiceFactory > SAL_CALL
187  const css::uno::Reference< css::lang::XMultiServiceFactory > & rServiceManager,
188  const ::rtl::OUString & rImplementationName,
189  ComponentInstantiation pCreateFunction,
190  const css::uno::Sequence< ::rtl::OUString > & rServiceNames,
191  rtl_ModuleCount * pModCount = NULL );
192 
207 CPPUHELPER_DLLPUBLIC css::uno::Reference< css::lang::XSingleServiceFactory > SAL_CALL
209  const css::uno::Reference< css::lang::XMultiServiceFactory > & rServiceManager,
210  const css::uno::Reference< css::lang::XSingleServiceFactory > & rFactory );
211 
226 CPPUHELPER_DLLPUBLIC css::uno::Reference< css::lang::XSingleServiceFactory > SAL_CALL
228  const css::uno::Reference< css::lang::XMultiServiceFactory > & rServiceManager,
229  const ::rtl::OUString & rComponentName,
230  ComponentInstantiation pCreateFunction,
231  const css::uno::Sequence< ::rtl::OUString > & rServiceNames,
232  rtl_ModuleCount * pModCount = NULL );
233 
243 CPPUHELPER_DLLPUBLIC css::uno::Reference< css::lang::XSingleServiceFactory > SAL_CALL
245  const css::uno::Reference< css::lang::XMultiServiceFactory > & rServiceManager,
246  const ::rtl::OUString & rImplementationName,
247  const css::uno::Reference< css::registry::XRegistryKey > & rImplementationKey );
248 
261 CPPUHELPER_DLLPUBLIC css::uno::Reference< css::lang::XSingleServiceFactory > SAL_CALL
263  const css::uno::Reference< css::lang::XMultiServiceFactory > & rServiceManager,
264  const ::rtl::OUString & rComponentName,
265  const css::uno::Reference< css::registry::XRegistryKey > & rImplementationKey );
266 
267 }
268 
269 #endif
270 
271 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
CPPUHELPER_DLLPUBLIC css::uno::Reference< css::lang::XSingleComponentFactory > createOneInstanceComponentFactory(ComponentFactoryFunc fptr,::rtl::OUString const &rImplementationName, css::uno::Sequence< ::rtl::OUString > const &rServiceNames, rtl_ModuleCount *pModCount=NULL)
Creates a single service factory which holds the instance created only once.
char sal_Char
A legacy synonym for char.
Definition: types.h:130
The binary specification of an UNO environment.
Definition: environment.h:41
css::uno::Reference< css::uno::XInterface >(* ComponentInstantiation)(const css::uno::Reference< css::lang::XMultiServiceFactory > &rServiceManager)
Deprecated.
Definition: factory.hxx:168
unsigned char sal_Bool
Definition: types.h:48
sal_Bool(* component_writeInfoFunc)(void *pServiceManager, void *pRegistryKey)
Function pointer declaration.
Definition: factory.hxx:95
css::uno::Reference< css::uno::XInterface >(* ComponentFactoryFunc)(css::uno::Reference< css::uno::XComponentContext > const &xContext)
Function pointer declaration.
Definition: factory.hxx:127
CPPUHELPER_DLLPUBLIC css::uno::Reference< css::lang::XSingleServiceFactory > createOneInstanceFactory(const css::uno::Reference< css::lang::XMultiServiceFactory > &rServiceManager, const ::rtl::OUString &rComponentName, ComponentInstantiation pCreateFunction, const css::uno::Sequence< ::rtl::OUString > &rServiceNames, rtl_ModuleCount *pModCount=NULL)
Deprecated.
#define CPPUHELPER_DLLPUBLIC
Definition: cppuhelperdllapi.h:28
CPPUHELPER_DLLPUBLIC css::uno::Reference< css::lang::XSingleServiceFactory > createSingleFactory(const css::uno::Reference< css::lang::XMultiServiceFactory > &rServiceManager, const ::rtl::OUString &rImplementationName, ComponentInstantiation pCreateFunction, const css::uno::Sequence< ::rtl::OUString > &rServiceNames, rtl_ModuleCount *pModCount=NULL)
Deprecated.
CPPUHELPER_DLLPUBLIC css::uno::Reference< css::lang::XSingleServiceFactory > createSingleRegistryFactory(const css::uno::Reference< css::lang::XMultiServiceFactory > &rServiceManager, const ::rtl::OUString &rImplementationName, const css::uno::Reference< css::registry::XRegistryKey > &rImplementationKey)
Deprecated.
This String class provides base functionality for C++ like Unicode character array handling...
Definition: ustring.hxx:106
struct SAL_DLLPUBLIC_RTTI _rtl_ModuleCount rtl_ModuleCount
Backwards-compatibility remainder of a removed library unloading feature.
CPPUHELPER_DLLPUBLIC css::uno::Reference< css::lang::XSingleComponentFactory > createSingleComponentFactory(ComponentFactoryFunc fptr,::rtl::OUString const &rImplementationName, css::uno::Sequence< ::rtl::OUString > const &rServiceNames, rtl_ModuleCount *pModCount=NULL)
Creates a single component factory supporting the XSingleComponentFactory interface.
void(* component_getImplementationEnvironmentFunc)(const sal_Char **ppEnvTypeName, uno_Environment **ppEnv)
Function pointer declaration.
Definition: factory.hxx:53
void *(* component_getFactoryFunc)(const sal_Char *pImplName, void *pServiceManager, void *pRegistryKey)
Function pointer declaration.
Definition: factory.hxx:113
Backwards-compatibility remainders of a removed library unloading feature.
CPPUHELPER_DLLPUBLIC css::uno::Reference< css::lang::XSingleServiceFactory > createOneInstanceRegistryFactory(const css::uno::Reference< css::lang::XMultiServiceFactory > &rServiceManager, const ::rtl::OUString &rComponentName, const css::uno::Reference< css::registry::XRegistryKey > &rImplementationKey)
Deprecated.
struct SAL_DLLPUBLIC_RTTI _uno_Environment uno_Environment
The binary specification of an UNO environment.
const sal_Char *(* component_getDescriptionFunc)(void)
Function pointer declaration.
Definition: factory.hxx:79
CPPUHELPER_DLLPUBLIC css::uno::Reference< css::lang::XSingleServiceFactory > createFactoryProxy(const css::uno::Reference< css::lang::XMultiServiceFactory > &rServiceManager, const css::uno::Reference< css::lang::XSingleServiceFactory > &rFactory)
Deprecated.
void(* component_getImplementationEnvironmentExtFunc)(sal_Char const **ppEnvTypeName, uno_Environment **ppEnv, sal_Char const *pImplName, uno_Environment *pTargetEnv)
Function pointer declaration.
Definition: factory.hxx:66