1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #ifndef _COMPHELPER_PROCESSFACTORY_HXX_ 25 #define _COMPHELPER_PROCESSFACTORY_HXX_ 26 27 #if ! defined(_COM_SUN_STAR_UNO_XCOMPONENTCONTEXT_HXX_) 28 #include "com/sun/star/uno/XComponentContext.hpp" 29 #endif 30 #include <com/sun/star/uno/Sequence.hxx> 31 #include "comphelper/comphelperdllapi.h" 32 33 namespace com { namespace sun { namespace star { namespace lang { 34 class XMultiServiceFactory; 35 } } } } 36 37 namespace comphelper 38 { 39 40 /** 41 * This function set the process service factory. 42 * 43 * @author Juergen Schmidt 44 */ 45 COMPHELPER_DLLPUBLIC void setProcessServiceFactory(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xSMgr); 46 47 /** 48 * This function get the process service factory. If no service factory is set the function returns 49 * a null interface. 50 * 51 * @author Juergen Schmidt 52 */ 53 COMPHELPER_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > getProcessServiceFactory(); 54 55 /** creates a component, using the process factory if set 56 @see getProcessServiceFactory 57 @see setProcessServiceFactory 58 */ 59 COMPHELPER_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > 60 createProcessComponent( 61 const ::rtl::OUString& _rServiceSpecifier 62 ) SAL_THROW( ( ::com::sun::star::uno::RuntimeException ) ); 63 64 /** creates a component with arguments, using the process factory if set 65 66 @see getProcessServiceFactory 67 @see setProcessServiceFactory 68 */ 69 COMPHELPER_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > 70 createProcessComponentWithArguments( 71 const ::rtl::OUString& _rServiceSpecifier, 72 const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& _rArgs 73 ) SAL_THROW( ( ::com::sun::star::uno::RuntimeException ) ); 74 75 /** 76 * This function gets the process service factory's default component context. 77 * If no service factory is set the function returns a null interface. 78 */ 79 COMPHELPER_DLLPUBLIC 80 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > 81 getProcessComponentContext(); 82 83 } 84 85 86 extern "C" { 87 /// @internal ATTENTION returns ACQUIRED pointer! release it explicitly! 88 COMPHELPER_DLLPUBLIC 89 ::com::sun::star::uno::XComponentContext * 90 comphelper_getProcessComponentContext(); 91 } // extern "C" 92 93 #endif // _COMPHELPER_PROCESSFACTORY_HXX_ 94 95