1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: loadenvexception.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef __FRAMEWORK_LOADENV_LOADENVEXCEPTION_HXX_
32 #define __FRAMEWORK_LOADENV_LOADENVEXCEPTION_HXX_
34 //_______________________________________________
35 // includes of own project
37 //_______________________________________________
38 // includes of uno interface
40 #include <com/sun/star/uno/Any.h>
41 #include <com/sun/star/uno/Exception.hpp>
43 //_______________________________________________
44 // includes of an other project
45 #include <rtl/string.hxx>
47 //_______________________________________________
52 #ifndef css // conflict with define :-(
53 namespace css
= ::com::sun::star
;
56 //_______________________________________________
59 /** @short specify an exception, which can be used inside the
60 load environment only.
62 @descr Of course outside code must wrapp it, to transport
63 the occured information to its caller.
67 class LoadEnvException
69 //___________________________________________
74 /** @short Can be used as an ID for an instance of a LoadEnvException.
75 @descr To prevent errors on adding/removing/changing such IDs here,
76 an enum field is used. Its int values are self organized ...
80 /** @short The specified URL/Stream/etcpp. can not be handled by a LoadEnv instance. */
81 ID_UNSUPPORTED_CONTENT
,
83 /** @short It was not possible to get access to global filter configuration.
84 @descr Might som neccsessary services could not be created. */
87 /** @short Some data obtained from the filter configuration seems to incorrect.
88 @descr Might a filter-type relation ship seem to be damaged. */
89 ID_INVALID_FILTER_CONFIG
,
91 /** @short indicates a corrupted media descriptor.
92 @descr Some parts are required - some other ones are optional. Such exception
93 should be thrown, if a required item does not exists. */
94 ID_INVALID_MEDIADESCRIPTOR
,
96 /** @short Its similar to an uno::RuntimeException ....
97 @descr But such runtime exception can break the whole office code.
98 So its capsulated to this specialized load environment only.
99 Mostly it indicates a missing but needed resource ... e.g the
100 global desktop reference! */
101 ID_INVALID_ENVIRONMENT
,
103 /** @short indicates a failed search for the right target frame. */
106 /** @short An already existing document was found inside a target frame.
107 But its controller could not be suspended successfully. Thats
108 why the new load request was cancelled. The document could not
110 ID_COULD_NOT_SUSPEND_CONTROLLER
,
113 ID_COULD_NOT_REACTIVATE_CONTROLLER
,
115 /** @short inidcates an already running load operation. Of yourse the same
116 instance cant be used for multiple load requests at the same time.
120 /** @short sometiems we cant specify the reason for an error, because we
121 was interrupted by an called code in an unexpected way ...
126 //___________________________________________
131 /** @short contains a suitable message, which describes the reason for this
133 ::rtl::OString m_sMessage
;
135 /** @short An ID, which make this exception unique among others. */
138 /** @short Contains the original exception, if any occured. */
139 css::uno::Any m_exOriginal
;
142 Experimental use! May it can be usefully to know, if an exception was already
143 catched and handled by an interaction and was might be rethrowed! */
146 //___________________________________________
151 /** @short initialize a new instance with an ID.
152 @descr Some other items of this exception
153 (e.g. a suitable message) will be generated
157 One of the defined const IDs of this class.
159 LoadEnvException(sal_Int32 nID
)
164 //_______________________________________
166 /** @short initialize a new instance with an ID
167 an wrap a detected exception into this one.
168 @descr Some other items of this exception
169 (e.g. a suitable message) will be generated
173 One of the defined const IDs of this class.
176 the original catched uno exception.
178 LoadEnvException( sal_Int32 nID
,
179 const css::uno::Exception
& exUno
)
182 m_exOriginal
<<= exUno
;
185 //_______________________________________
187 /** @short destruct an instance of this exception.
191 m_sMessage
= ::rtl::OString();
194 m_exOriginal
.clear();
198 } // namespace framework
200 #endif // __FRAMEWORK_LOADENV_LOADENVEXCEPTION_HXX_