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_IMPLEMENTATIONENTRY_HXX 20 #define INCLUDED_CPPUHELPER_IMPLEMENTATIONENTRY_HXX 21 22 #include "cppuhelper/factory.hxx" 23 #include "cppuhelper/cppuhelperdllapi.h" 24 25 namespace cppu 26 { 27 /** One struct instance represents all data necessary for registering one service implementation. 28 29 */ 30 struct SAL_WARN_UNUSED ImplementationEntry 31 { 32 /** Function that creates an instance of the implementation 33 */ 34 ComponentFactoryFunc create; 35 36 /** Function that returns the implementation-name of the implementation 37 (same as XServiceInfo.getImplementationName() ). 38 */ 39 rtl::OUString (SAL_CALL * getImplementationName)(); 40 41 /** Function that returns all supported servicenames of the implementation 42 ( same as XServiceInfo.getSupportedServiceNames() ). 43 */ 44 css::uno::Sequence< rtl::OUString > (SAL_CALL * getSupportedServiceNames) (); 45 46 /** Function that creates a SingleComponentFactory. 47 48 The pModCount parameter is a backwards-compatibility remainder of a 49 removed library unloading feature; always set to null. 50 */ 51 css::uno::Reference< css::lang::XSingleComponentFactory > 52 (SAL_CALL * createFactory)( 53 ComponentFactoryFunc fptr, 54 ::rtl::OUString const & rImplementationName, 55 css::uno::Sequence< ::rtl::OUString > const & rServiceNames, 56 rtl_ModuleCount * pModCount ); 57 58 /** Backwards-compatibility remainder of a removed library unloading 59 feature; always set to null. 60 */ 61 rtl_ModuleCount * moduleCounter; 62 63 /** Must be set to 0 ! 64 For future extensions. 65 */ 66 sal_Int32 nFlags; 67 }; 68 69 /** Helper function for implementation of the component_writeInfo()-function. 70 71 @deprecated component_writeInfo should no longer be used in new components 72 73 @param pServiceManager The first parameter passed to component_writeInfo()-function 74 (This is an instance of the service manager, that creates the factory). 75 @param pRegistryKey The second parameter passed to the component_writeInfo()-function. 76 This is a reference to the registry key, into which the implementation 77 data shall be written to. 78 @param entries Each element of the entries-array must contains a function pointer 79 table for registering an implementation. The end of the array 80 must be marked with a 0 entry in the create-function. 81 @return sal_True, if all implementations could be registered, otherwise sal_False. 82 */ 83 CPPUHELPER_DLLPUBLIC sal_Bool component_writeInfoHelper( 84 void *pServiceManager, void *pRegistryKey , const struct ImplementationEntry entries[] ); 85 86 /** Helper function for implementation of the component_getFactory()-function, 87 that must be implemented by every shared library component. 88 89 @param pImplName The implementation-name to be instantiated ( This is the 90 first parameter passed to the component_getFactory 91 @param pServiceManager The second parameter passed to component_getFactory()-function 92 (This is a of the service manager, that creates the factory). 93 @param pRegistryKey The third parameter passed to the component_getFactory()-function. 94 This is a reference to the registry key, where the implementation 95 data has been written to. 96 @param entries Each element of the entries-array must contains a function pointer 97 table for creating a factor of the implementation. The end of the array 98 must be marked with a 0 entry in the create-function. 99 @return 0 if the helper failed to instantiate a factory, otherwise an acquired pointer 100 to a factory. 101 */ 102 CPPUHELPER_DLLPUBLIC void *component_getFactoryHelper( 103 const sal_Char * pImplName, 104 void * pServiceManager, 105 void * pRegistryKey, 106 const struct ImplementationEntry entries[] ); 107 108 } 109 #endif 110 111 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 112