Update git submodules
[LibreOffice.git] / framework / source / inc / loadenv / loadenvexception.hxx
blob62a17d2ac828192652331e2d210d34085047b714
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 #pragma once
22 #include <com/sun/star/uno/Any.hxx>
23 #include <utility>
25 namespace framework{
27 /** @short specify an exception, which can be used inside the
28 load environment only.
30 @descr Of course outside code must wrap it, to transport
31 the occurred information to its caller.
33 class LoadEnvException
35 public:
36 /** @short Can be used as an ID for an instance of a LoadEnvException.
37 @descr To prevent errors on adding/removing/changing such IDs here,
38 an enum field is used. Its int values are self organized...
40 enum EIDs
42 /** @short The specified URL/Stream/etcpp. can not be handled by a LoadEnv instance. */
43 ID_UNSUPPORTED_CONTENT,
45 /** @short indicates a corrupted media descriptor.
46 @descr Some parts are required - some other ones are optional. Such exception
47 should be thrown, if a required item does not exists. */
48 ID_INVALID_MEDIADESCRIPTOR,
50 /** @short Its similar to a uno::RuntimeException...
51 @descr But such runtime exception can break the whole office code.
52 So its capsulated to this specialized load environment only.
53 Mostly it indicates a missing but needed resource ... e.g the
54 global desktop reference! */
55 ID_INVALID_ENVIRONMENT,
57 /** @short indicates a failed search for the right target frame. */
58 ID_NO_TARGET_FOUND,
60 /** @short TODO */
61 ID_COULD_NOT_REACTIVATE_CONTROLLER,
63 /** @short indicates an already running load operation. Of course the same
64 instance can't be used for multiple load requests at the same time.
66 ID_STILL_RUNNING,
68 /** @short sometimes we can't specify the reason for an error, because we
69 was interrupted by a called code in an unexpected way ...
71 ID_GENERAL_ERROR
74 sal_Int32 m_nID;
75 OUString m_sMessage;
76 css::uno::Any m_exOriginal;
78 LoadEnvException(
79 sal_Int32 id, OUString message = OUString(),
80 css::uno::Any original = css::uno::Any()):
81 m_nID(id), m_sMessage(std::move(message)), m_exOriginal(std::move(original))
85 } // namespace framework
87 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */