14#include <com/sun/star/uno/DeploymentException.hpp>
15#include <com/sun/star/uno/Any.hxx>
16#include <com/sun/star/uno/Reference.hxx>
17#include <com/sun/star/lang/XSingleComponentFactory.hpp>
21#include <rtl/bootstrap.hxx>
23#include <rtl/ustring.hxx>
30namespace com :: sun :: star ::
uno {
class XComponentContext; }
34OUString getBootstrapVariable(
35 rtl::Bootstrap
const & bootstrap, OUString
const & name)
39 throw css::uno::DeploymentException(
40 "Cannot obtain " + name +
" from uno ini");
47css::uno::Reference< css::uno::XComponentContext >
50 rtl::Bootstrap bs(iniUri);
51 if (bs.getHandle() ==
nullptr) {
52 throw css::uno::DeploymentException(
53 "Cannot open uno ini " + iniUri);
57 smgr->init(getBootstrapVariable(bs,
"UNO_SERVICES"));
59 tmgr->init(getBootstrapVariable(bs,
"UNO_TYPES"));
60 std::vector< cppu::ContextEntry_Init > context_values
63 "/singletons/com.sun.star.lang.theServiceManager",
65 css::uno::Reference< css::uno::XInterface >(
69 "/singletons/com.sun.star.reflection.theTypeDescriptionManager",
71 css::uno::Reference< css::uno::XInterface >(
75 "/singletons/com.sun.star.util.theMacroExpander",
80 smgr->addSingletonContextEntries(&context_values);
81 context_values.push_back(
83 "/services/com.sun.star.security.AccessController/mode",
84 css::uno::Any(OUString(
"off")),
false));
85 context_values.push_back(
87 "/singletons/com.sun.star.security.theAccessController",
89 OUString(
"com.sun.star.security.AccessController")),
91 css::uno::Reference< css::uno::XComponentContext > context(
93 smgr->setContext(context);
98css::uno::Reference< css::uno::XComponentContext >
Base class to implement a UNO object supporting weak references, i.e.
sal_Bool SAL_CALL installTypeDescriptionManager(Reference< container::XHierarchicalNameAccess > const &xTDMgr_c)
Reference< XComponentContext > SAL_CALL createComponentContext(ContextEntry_Init const *pEntries, sal_Int32 nEntries, Reference< XComponentContext > const &xDelegate)
CPPUHELPER_DLLPUBLIC css::uno::Reference< css::uno::XComponentContext > SAL_CALL defaultBootstrap_InitialComponentContext()
Bootstraps an initial component context with service manager upon information from bootstrap variable...
Reference< lang::XSingleComponentFactory > create_bootstrap_macro_expander_factory()
Context entries init struct calling createComponentContext().