LibreOffice
LibreOffice 7.4 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 
20 /*
21  * This file is part of LibreOffice published API.
22  */
23 #ifndef INCLUDED_CPPUHELPER_FACTORY_HXX
24 #define INCLUDED_CPPUHELPER_FACTORY_HXX
25 
26 #include "sal/config.h"
27 
28 #include <cstddef>
29 
30 #include "rtl/ustring.hxx"
31 #include "rtl/unload.h"
32 
35 
36 namespace com { namespace sun { namespace star { namespace lang { class XMultiServiceFactory; } } } }
37 namespace com { namespace sun { namespace star { namespace lang { class XSingleComponentFactory; } } } }
38 namespace com { namespace sun { namespace star { namespace lang { class XSingleServiceFactory; } } } }
39 namespace com { namespace sun { namespace star { namespace registry { class XRegistryKey; } } } }
40 namespace com { namespace sun { namespace star { namespace uno { class XComponentContext; } } } }
41 namespace com { namespace sun { namespace star { namespace uno { class XInterface; } } } }
42 namespace com { namespace sun { namespace star { namespace uno { template <class E> class Sequence; } } } }
43 
44 #define COMPONENT_GETENV "component_getImplementationEnvironment"
45 #define COMPONENT_GETENVEXT "component_getImplementationEnvironmentExt"
46 #define COMPONENT_WRITEINFO "component_writeInfo"
47 #define COMPONENT_GETFACTORY "component_getFactory"
48 
49 typedef struct _uno_Environment uno_Environment;
50 
61  const char ** ppEnvTypeName, uno_Environment ** ppEnv );
62 
74  char const ** ppEnvTypeName,
75  uno_Environment ** ppEnv,
76  char const * pImplName,
77  uno_Environment * pTargetEnv
78 );
79 
86 typedef const char * (SAL_CALL * component_getDescriptionFunc)(void);
87 
102 typedef sal_Bool (SAL_CALL * component_writeInfoFunc)(
103  void * pServiceManager, void * pRegistryKey );
104 
120 typedef void * (SAL_CALL * component_getFactoryFunc)(
121  const char * pImplName, void * pServiceManager, void * pRegistryKey );
122 
123 
124 namespace cppu
125 {
126 
133 typedef css::uno::Reference< css::uno::XInterface >(
134  SAL_CALL * ComponentFactoryFunc)(
135  css::uno::Reference< css::uno::XComponentContext > const & xContext );
136 
145 CPPUHELPER_DLLPUBLIC css::uno::Reference< css::lang::XSingleComponentFactory >
148  ::rtl::OUString const & rImplementationName,
149  css::uno::Sequence< ::rtl::OUString > const & rServiceNames,
150  rtl_ModuleCount * pModCount = NULL );
151 
162 CPPUHELPER_DLLPUBLIC css::uno::Reference< css::lang::XSingleComponentFactory > SAL_CALL
165  ::rtl::OUString const & rImplementationName,
166  css::uno::Sequence< ::rtl::OUString > const & rServiceNames,
167  rtl_ModuleCount * pModCount = NULL );
168 
175 typedef css::uno::Reference< css::uno::XInterface >(SAL_CALL * ComponentInstantiation)(
176  const css::uno::Reference< css::lang::XMultiServiceFactory > & rServiceManager );
177 
192 CPPUHELPER_DLLPUBLIC css::uno::Reference< css::lang::XSingleServiceFactory > SAL_CALL
194  const css::uno::Reference< css::lang::XMultiServiceFactory > & rServiceManager,
195  const ::rtl::OUString & rImplementationName,
196  ComponentInstantiation pCreateFunction,
197  const css::uno::Sequence< ::rtl::OUString > & rServiceNames,
198  rtl_ModuleCount * pModCount = NULL );
199 
214 CPPUHELPER_DLLPUBLIC css::uno::Reference< css::lang::XSingleServiceFactory > SAL_CALL
216  const css::uno::Reference< css::lang::XMultiServiceFactory > & rServiceManager,
217  const css::uno::Reference< css::lang::XSingleServiceFactory > & rFactory );
218 
233 CPPUHELPER_DLLPUBLIC css::uno::Reference< css::lang::XSingleServiceFactory > SAL_CALL
235  const css::uno::Reference< css::lang::XMultiServiceFactory > & rServiceManager,
236  const ::rtl::OUString & rComponentName,
237  ComponentInstantiation pCreateFunction,
238  const css::uno::Sequence< ::rtl::OUString > & rServiceNames,
239  rtl_ModuleCount * pModCount = NULL );
240 
250 CPPUHELPER_DLLPUBLIC css::uno::Reference< css::lang::XSingleServiceFactory > SAL_CALL
252  const css::uno::Reference< css::lang::XMultiServiceFactory > & rServiceManager,
253  const ::rtl::OUString & rImplementationName,
254  const css::uno::Reference< css::registry::XRegistryKey > & rImplementationKey );
255 
268 CPPUHELPER_DLLPUBLIC css::uno::Reference< css::lang::XSingleServiceFactory > SAL_CALL
270  const css::uno::Reference< css::lang::XMultiServiceFactory > & rServiceManager,
271  const ::rtl::OUString & rComponentName,
272  const css::uno::Reference< css::registry::XRegistryKey > & rImplementationKey );
273 
274 }
275 
276 #endif
277 
278 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
unsigned char sal_Bool
Definition: types.h:38
Backwards-compatibility remainders of a removed library unloading feature.
struct SAL_DLLPUBLIC_RTTI _rtl_ModuleCount rtl_ModuleCount
Backwards-compatibility remainder of a removed library unloading feature.
struct SAL_DLLPUBLIC_RTTI _uno_Environment uno_Environment
The binary specification of a UNO environment.
#define CPPUHELPER_DLLPUBLIC
Definition: cppuhelperdllapi.h:32
sal_Bool(* component_writeInfoFunc)(void *pServiceManager, void *pRegistryKey)
Function pointer declaration.
Definition: factory.hxx:102
void(* component_getImplementationEnvironmentFunc)(const char **ppEnvTypeName, uno_Environment **ppEnv)
Function pointer declaration.
Definition: factory.hxx:60
void(* component_getImplementationEnvironmentExtFunc)(char const **ppEnvTypeName, uno_Environment **ppEnv, char const *pImplName, uno_Environment *pTargetEnv)
Function pointer declaration.
Definition: factory.hxx:73
void *(* component_getFactoryFunc)(const char *pImplName, void *pServiceManager, void *pRegistryKey)
Function pointer declaration.
Definition: factory.hxx:120
const char *(* component_getDescriptionFunc)(void)
Function pointer declaration.
Definition: factory.hxx:86
Definition: types.h:359
Definition: Enterable.hxx:31
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.
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::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 >(* ComponentInstantiation)(const css::uno::Reference< css::lang::XMultiServiceFactory > &rServiceManager)
Deprecated.
Definition: factory.hxx:175
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.
css::uno::Reference< css::uno::XInterface >(* ComponentFactoryFunc)(css::uno::Reference< css::uno::XComponentContext > const &xContext)
Function pointer declaration.
Definition: factory.hxx:134
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.
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.
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.
This String class provides base functionality for C++ like Unicode character array handling.
Definition: ustring.hxx:203
The binary specification of a UNO environment.
Definition: environment.h:46