Version 5.4.3.2, tag libreoffice-5.4.3.2
[LibreOffice.git] / include / comphelper / processfactory.hxx
blobbf4645124c12b442db3941b224b9b589d204f18e
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_COMPHELPER_PROCESSFACTORY_HXX
21 #define INCLUDED_COMPHELPER_PROCESSFACTORY_HXX
23 #include <com/sun/star/uno/XComponentContext.hpp>
24 #include <comphelper/comphelperdllapi.h>
26 namespace com { namespace sun { namespace star { namespace lang {
27 class XMultiServiceFactory;
28 } } } }
30 namespace comphelper
33 /**
34 * This function set the process service factory.
36 * @author Juergen Schmidt
38 COMPHELPER_DLLPUBLIC void setProcessServiceFactory(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMgr);
40 /**
41 * This function gets the process service factory.
43 * If no service factory is set the function throws a RuntimeException.
45 * @author Juergen Schmidt
47 COMPHELPER_DLLPUBLIC css::uno::Reference< css::lang::XMultiServiceFactory > getProcessServiceFactory();
49 /** Obtains a component context from a service factory.
51 Throws a RuntimeException if no component context can be obtained.
53 @param factory may be null
54 @return may be null
56 COMPHELPER_DLLPUBLIC
57 css::uno::Reference< css::uno::XComponentContext >
58 getComponentContext(
59 css::uno::Reference< css::lang::XMultiServiceFactory >
60 const & factory);
62 /**
63 * This function gets the process service factory's default component context.
65 * Throws a RuntimeException if no component context can be obtained.
67 COMPHELPER_DLLPUBLIC
68 css::uno::Reference< css::uno::XComponentContext >
69 getProcessComponentContext();
73 #endif // INCLUDED_COMPHELPER_PROCESSFACTORY_HXX
75 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */