LibreOffice
LibreOffice 6.2 SDK C/C++ API Reference
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 
31 
32 namespace com { namespace sun { namespace star { namespace lang { class XMultiServiceFactory; } } } }
33 namespace com { namespace sun { namespace star { namespace lang { class XSingleComponentFactory; } } } }
34 namespace com { namespace sun { namespace star { namespace lang { class XSingleServiceFactory; } } } }
35 namespace com { namespace sun { namespace star { namespace registry { class XRegistryKey; } } } }
36 namespace com { namespace sun { namespace star { namespace uno { class XComponentContext; } } } }
37 namespace com { namespace sun { namespace star { namespace uno { class XInterface; } } } }
38 namespace com { namespace sun { namespace star { namespace uno { template <class E> class Sequence; } } } }
39 
40 #define COMPONENT_GETENV "component_getImplementationEnvironment"
41 #define COMPONENT_GETENVEXT "component_getImplementationEnvironmentExt"
42 #define COMPONENT_WRITEINFO "component_writeInfo"
43 #define COMPONENT_GETFACTORY "component_getFactory"
44 
46 
57  const sal_Char ** ppEnvTypeName, uno_Environment ** ppEnv );
58 
70  sal_Char const ** ppEnvTypeName,
71  uno_Environment ** ppEnv,
72  sal_Char const * pImplName,
73  uno_Environment * pTargetEnv
74 );
75 
82 typedef const sal_Char * (SAL_CALL * component_getDescriptionFunc)(void);
83 
98 typedef sal_Bool (SAL_CALL * component_writeInfoFunc)(
99  void * pServiceManager, void * pRegistryKey );
100 
116 typedef void * (SAL_CALL * component_getFactoryFunc)(
117  const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey );
118 
119 
120 namespace cppu
121 {
122 
129 typedef css::uno::Reference< css::uno::XInterface >(
130  SAL_CALL * ComponentFactoryFunc)(
131  css::uno::Reference< css::uno::XComponentContext > const & xContext );
132 
141 CPPUHELPER_DLLPUBLIC css::uno::Reference< css::lang::XSingleComponentFactory >
144  ::rtl::OUString const & rImplementationName,
145  css::uno::Sequence< ::rtl::OUString > const & rServiceNames,
146  rtl_ModuleCount * pModCount = NULL );
147 
158 CPPUHELPER_DLLPUBLIC css::uno::Reference< css::lang::XSingleComponentFactory > SAL_CALL
161  ::rtl::OUString const & rImplementationName,
162  css::uno::Sequence< ::rtl::OUString > const & rServiceNames,
163  rtl_ModuleCount * pModCount = NULL );
164 
171 typedef css::uno::Reference< css::uno::XInterface >(SAL_CALL * ComponentInstantiation)(
172  const css::uno::Reference< css::lang::XMultiServiceFactory > & rServiceManager );
173 
188 CPPUHELPER_DLLPUBLIC css::uno::Reference< css::lang::XSingleServiceFactory > SAL_CALL
190  const css::uno::Reference< css::lang::XMultiServiceFactory > & rServiceManager,
191  const ::rtl::OUString & rImplementationName,
192  ComponentInstantiation pCreateFunction,
193  const css::uno::Sequence< ::rtl::OUString > & rServiceNames,
194  rtl_ModuleCount * pModCount = NULL );
195 
210 CPPUHELPER_DLLPUBLIC css::uno::Reference< css::lang::XSingleServiceFactory > SAL_CALL
212  const css::uno::Reference< css::lang::XMultiServiceFactory > & rServiceManager,
213  const css::uno::Reference< css::lang::XSingleServiceFactory > & rFactory );
214 
229 CPPUHELPER_DLLPUBLIC css::uno::Reference< css::lang::XSingleServiceFactory > SAL_CALL
231  const css::uno::Reference< css::lang::XMultiServiceFactory > & rServiceManager,
232  const ::rtl::OUString & rComponentName,
233  ComponentInstantiation pCreateFunction,
234  const css::uno::Sequence< ::rtl::OUString > & rServiceNames,
235  rtl_ModuleCount * pModCount = NULL );
236 
246 CPPUHELPER_DLLPUBLIC css::uno::Reference< css::lang::XSingleServiceFactory > SAL_CALL
248  const css::uno::Reference< css::lang::XMultiServiceFactory > & rServiceManager,
249  const ::rtl::OUString & rImplementationName,
250  const css::uno::Reference< css::registry::XRegistryKey > & rImplementationKey );
251 
264 CPPUHELPER_DLLPUBLIC css::uno::Reference< css::lang::XSingleServiceFactory > SAL_CALL
266  const css::uno::Reference< css::lang::XMultiServiceFactory > & rServiceManager,
267  const ::rtl::OUString & rComponentName,
268  const css::uno::Reference< css::registry::XRegistryKey > & rImplementationKey );
269 
270 }
271 
272 #endif
273 
274 /* 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.
css::uno::Reference< css::uno::XInterface >(* ComponentFactoryFunc)(css::uno::Reference< css::uno::XComponentContext > const &xContext)
Function pointer declaration.
Definition: factory.hxx:130
sal_Bool(* component_writeInfoFunc)(void *pServiceManager, void *pRegistryKey)
Function pointer declaration.
Definition: factory.hxx:98
char sal_Char
A legacy synonym for char.
Definition: types.h:120
Definition: Enterable.hxx:26
The binary specification of an UNO environment.
Definition: environment.h:41
const sal_Char *(* component_getDescriptionFunc)(void)
Function pointer declaration.
Definition: factory.hxx:82
void *(* component_getFactoryFunc)(const sal_Char *pImplName, void *pServiceManager, void *pRegistryKey)
Function pointer declaration.
Definition: factory.hxx:116
Definition: types.h:377
unsigned char sal_Bool
Definition: types.h:38
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:123
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:56
css::uno::Reference< css::uno::XInterface >(* ComponentInstantiation)(const css::uno::Reference< css::lang::XMultiServiceFactory > &rServiceManager)
Deprecated.
Definition: factory.hxx:171
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.
void(* component_getImplementationEnvironmentExtFunc)(sal_Char const **ppEnvTypeName, uno_Environment **ppEnv, sal_Char const *pImplName, uno_Environment *pTargetEnv)
Function pointer declaration.
Definition: factory.hxx:69
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.