bump product version to 4.1.6.2
[LibreOffice.git] / include / cppuhelper / bootstrap.hxx
blobd76379a2f3e395e833d99f268300d2217dab0af1
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 .
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; }
32 } } }
34 namespace cppu
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 )
44 SAL_THROW(());
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
55 for further info.
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
72 for further info.
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) );
80 /**
81 * An exception indicating a bootstrap error.
83 * @since UDK 3.2.0
85 class CPPUHELPER_DLLPUBLIC BootstrapException
87 public:
88 /**
89 * Constructs a BootstrapException.
91 BootstrapException();
93 /**
94 * Constructs a BootstrapException with the specified detail message.
96 * @param rMessage
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.
118 @return
119 A reference to the message. The reference is valid for the lifetime of
120 this BootstrapException.
122 const ::rtl::OUString & getMessage() const;
124 private:
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
134 * bootstrap error.
136 * @since UDK 3.2.0
138 CPPUHELPER_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
139 SAL_CALL bootstrap();
141 /// @cond INTERNAL
143 * Helper function to expand vnd.sun.star.expand URLs in contexts where no
144 * properly bootstrapped UNO is (yet) available.
146 * @param uri
147 * Some URI (but not a URI reference).
149 * @return
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.
157 * @since UDK 3.2.8
159 CPPUHELPER_DLLPUBLIC ::rtl::OUString
160 SAL_CALL bootstrap_expandUri(::rtl::OUString const & uri);
161 /// @endcond
163 } // end namespace cppu
165 #endif
167 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */