1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
19 #ifndef _CPPUHELPER_BOOTSTRAP_HXX_
20 #define _CPPUHELPER_BOOTSTRAP_HXX_
22 #include "sal/config.h"
23 #include "com/sun/star/uno/Exception.hpp"
24 #include "com/sun/star/uno/Reference.hxx"
25 #include "rtl/ustring.hxx"
26 #include "sal/types.h"
27 #include "cppuhelperdllapi.h"
29 namespace com
{ namespace sun
{ namespace star
{
30 namespace container
{ class XHierarchicalNameAccess
; }
31 namespace uno
{ class XComponentContext
; }
37 /** Installs type description manager instance, i.e. registers a callback at cppu core.
39 @param xTDMgr manager instance
40 @return true, if successfully registered
42 CPPUHELPER_DLLPUBLIC sal_Bool SAL_CALL
installTypeDescriptionManager(
43 ::com::sun::star::uno::Reference
< ::com::sun::star::container::XHierarchicalNameAccess
> const & xTDMgr
)
46 /** Bootstraps an initial component context with service manager upon
47 information from bootstrap variables.
49 This function tries to find its parameters via these bootstrap variables:
51 - UNO_TYPES -- a space separated list of file urls of type rdbs
52 - UNO_SERVICES -- a space separated list of file urls of service rdbs
54 Please look at http://udk.openoffice.org/common/man/concept/uno_default_bootstrapping.html
57 @return component context
59 CPPUHELPER_DLLPUBLIC ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
> SAL_CALL
60 defaultBootstrap_InitialComponentContext() SAL_THROW( (::com::sun::star::uno::Exception
) );
63 /** Bootstraps an initial component context with service manager upon
64 information from an ini file.
66 This function tries to find its parameters via these bootstrap variables:
68 - UNO_TYPES -- a space separated list of file urls of type rdbs
69 - UNO_SERVICES -- a space separated list of file urls of service rdbs
71 Please look at http://udk.openoffice.org/common/man/concept/uno_default_bootstrapping.html
74 @param iniFile ini filename to get bootstrap variables
75 @return component context
77 CPPUHELPER_DLLPUBLIC ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
> SAL_CALL
78 defaultBootstrap_InitialComponentContext(const ::rtl::OUString
& iniFile
) SAL_THROW( (::com::sun::star::uno::Exception
) );
81 * An exception indicating a bootstrap error.
85 class CPPUHELPER_DLLPUBLIC BootstrapException
89 * Constructs a BootstrapException.
94 * Constructs a BootstrapException with the specified detail message.
97 * A message containing any details about the exception.
99 BootstrapException( const ::rtl::OUString
& rMessage
);
102 * Copy constructs a BootstrapException.
104 BootstrapException( const BootstrapException
& e
);
107 * Destructs a BootstrapException.
109 virtual ~BootstrapException();
112 * Assigns a BootstrapException.
114 BootstrapException
& operator=( const BootstrapException
& e
);
116 /** Gets the message.
119 A reference to the message. The reference is valid for the lifetime of
120 this BootstrapException.
122 const ::rtl::OUString
& getMessage() const;
125 ::rtl::OUString m_aMessage
;
129 * Bootstraps the component context from a UNO installation.
131 * @return a bootstrapped component context
132 * @exception BootstrapException
133 * Thrown in case bootstrap() signals an exception due to a
138 CPPUHELPER_DLLPUBLIC ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
>
139 SAL_CALL
bootstrap();
143 * Helper function to expand vnd.sun.star.expand URLs in contexts where no
144 * properly bootstrapped UNO is (yet) available.
147 * Some URI (but not a URI reference).
150 * If uri is a vnd.sun.star.expand URL, then the expansion of that URL is
151 * returned; expansion may lead to a string that is not a legal URI. Otherwise,
152 * the uri is returned unchanged.
154 * @exception com::sun::star::lang::IllegalArgumentException
155 * If uri is a vnd.sun.star.expand URL that contains unknown macros.
159 CPPUHELPER_DLLPUBLIC ::rtl::OUString
160 SAL_CALL
bootstrap_expandUri(::rtl::OUString
const & uri
);
163 } // end namespace cppu
167 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */