LibreOffice
LibreOffice 5.0 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 <rtl/ustring.hxx>
23 #include <rtl/unload.h>
24 
25 #include <com/sun/star/uno/XComponentContext.hpp>
26 #include <com/sun/star/lang/XSingleComponentFactory.hpp>
27 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
28 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
29 #include <com/sun/star/registry/XRegistryKey.hpp>
31 
32 
33 
34 #define COMPONENT_GETENV "component_getImplementationEnvironment"
35 #define COMPONENT_GETENVEXT "component_getImplementationEnvironmentExt"
36 #define COMPONENT_WRITEINFO "component_writeInfo"
37 #define COMPONENT_GETFACTORY "component_getFactory"
38 
40 
51  const sal_Char ** ppEnvTypeName, uno_Environment ** ppEnv );
52 
64  sal_Char const ** ppEnvTypeName,
65  uno_Environment ** ppEnv,
66  sal_Char const * pImplName,
67  uno_Environment * pTargetEnv
68 );
69 
76 typedef const sal_Char * (SAL_CALL * component_getDescriptionFunc)(void);
77 
92 typedef sal_Bool (SAL_CALL * component_writeInfoFunc)(
93  void * pServiceManager, void * pRegistryKey );
94 
110 typedef void * (SAL_CALL * component_getFactoryFunc)(
111  const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey );
112 
113 
114 
115 namespace cppu
116 {
117 
124 typedef ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >(
125  SAL_CALL * ComponentFactoryFunc)(
127 
136 CPPUHELPER_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleComponentFactory >
139  ::rtl::OUString const & rImplementationName,
140  ::com::sun::star::uno::Sequence< ::rtl::OUString > const & rServiceNames,
141  rtl_ModuleCount * pModCount = 0 );
142 
153 CPPUHELPER_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleComponentFactory > SAL_CALL
156  ::rtl::OUString const & rImplementationName,
157  ::com::sun::star::uno::Sequence< ::rtl::OUString > const & rServiceNames,
158  rtl_ModuleCount * pModCount = 0 );
159 
166 typedef ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >(SAL_CALL * ComponentInstantiation)(
167  const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rServiceManager );
168 
183 CPPUHELPER_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > SAL_CALL
185  const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rServiceManager,
186  const ::rtl::OUString & rImplementationName,
187  ComponentInstantiation pCreateFunction,
188  const ::com::sun::star::uno::Sequence< ::rtl::OUString > & rServiceNames,
189  rtl_ModuleCount * pModCount = 0 );
190 
205 CPPUHELPER_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > SAL_CALL
207  const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rServiceManager,
208  const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > & rFactory );
209 
224 CPPUHELPER_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > SAL_CALL
226  const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rServiceManager,
227  const ::rtl::OUString & rComponentName,
228  ComponentInstantiation pCreateFunction,
229  const ::com::sun::star::uno::Sequence< ::rtl::OUString > & rServiceNames,
230  rtl_ModuleCount * pModCount = 0 );
231 
241 CPPUHELPER_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > SAL_CALL
243  const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rServiceManager,
244  const ::rtl::OUString & rImplementationName,
245  const ::com::sun::star::uno::Reference< ::com::sun::star::registry::XRegistryKey > & rImplementationKey );
246 
259 CPPUHELPER_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > SAL_CALL
261  const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rServiceManager,
262  const ::rtl::OUString & rComponentName,
263  const ::com::sun::star::uno::Reference< ::com::sun::star::registry::XRegistryKey > & rImplementationKey );
264 
265 }
266 
267 #endif
268 
269 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
CPPUHELPER_DLLPUBLIC::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > createFactoryProxy(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > &rServiceManager, const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > &rFactory)
Deprecated.
char sal_Char
A legacy synonym for char.
Definition: types.h:130
The binary specification of an UNO environment.
Definition: environment.h:41
CPPUHELPER_DLLPUBLIC::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > createOneInstanceFactory(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > &rServiceManager, const ::rtl::OUString &rComponentName, ComponentInstantiation pCreateFunction, const ::com::sun::star::uno::Sequence< ::rtl::OUString > &rServiceNames, rtl_ModuleCount *pModCount=0)
Deprecated.
CPPUHELPER_DLLPUBLIC::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > createSingleRegistryFactory(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > &rServiceManager, const ::rtl::OUString &rImplementationName, const ::com::sun::star::uno::Reference< ::com::sun::star::registry::XRegistryKey > &rImplementationKey)
Deprecated.
CPPUHELPER_DLLPUBLIC::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleComponentFactory > createSingleComponentFactory(ComponentFactoryFunc fptr,::rtl::OUString const &rImplementationName,::com::sun::star::uno::Sequence< ::rtl::OUString > const &rServiceNames, rtl_ModuleCount *pModCount=0)
Creates a single component factory supporting the XSingleComponentFactory interface.
CPPUHELPER_DLLPUBLIC::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleComponentFactory > createOneInstanceComponentFactory(ComponentFactoryFunc fptr,::rtl::OUString const &rImplementationName,::com::sun::star::uno::Sequence< ::rtl::OUString > const &rServiceNames, rtl_ModuleCount *pModCount=0)
Creates a single service factory which holds the instance created only once.
unsigned char sal_Bool
Definition: types.h:48
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >(* ComponentFactoryFunc)(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const &xContext)
Function pointer declaration.
Definition: factory.hxx:125
sal_Bool(* component_writeInfoFunc)(void *pServiceManager, void *pRegistryKey)
Function pointer declaration.
Definition: factory.hxx:92
Template C++ class representing an IDL sequence.
Definition: unotype.hxx:38
This String class provides base functionality for C++ like Unicode character array handling...
Definition: ustring.hxx:115
struct SAL_DLLPUBLIC_RTTI _rtl_ModuleCount rtl_ModuleCount
Backwards-compatibility remainder of a removed library unloading feature.
CPPUHELPER_DLLPUBLIC::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > createOneInstanceRegistryFactory(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > &rServiceManager, const ::rtl::OUString &rComponentName, const ::com::sun::star::uno::Reference< ::com::sun::star::registry::XRegistryKey > &rImplementationKey)
Deprecated.
void(* component_getImplementationEnvironmentFunc)(const sal_Char **ppEnvTypeName, uno_Environment **ppEnv)
Function pointer declaration.
Definition: factory.hxx:50
CPPUHELPER_DLLPUBLIC::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > createSingleFactory(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > &rServiceManager, const ::rtl::OUString &rImplementationName, ComponentInstantiation pCreateFunction, const ::com::sun::star::uno::Sequence< ::rtl::OUString > &rServiceNames, rtl_ModuleCount *pModCount=0)
Deprecated.
void *(* component_getFactoryFunc)(const sal_Char *pImplName, void *pServiceManager, void *pRegistryKey)
Function pointer declaration.
Definition: factory.hxx:110
Backwards-compatibility remainders of a removed library unloading feature.
struct SAL_DLLPUBLIC_RTTI _uno_Environment uno_Environment
The binary specification of an UNO environment.
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >(* ComponentInstantiation)(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > &rServiceManager)
Deprecated.
Definition: factory.hxx:166
const sal_Char *(* component_getDescriptionFunc)(void)
Function pointer declaration.
Definition: factory.hxx:76
void(* component_getImplementationEnvironmentExtFunc)(sal_Char const **ppEnvTypeName, uno_Environment **ppEnv, sal_Char const *pImplName, uno_Environment *pTargetEnv)
Function pointer declaration.
Definition: factory.hxx:63
Template reference class for interface type derived from BaseReference.
Definition: unotype.hxx:37