VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/globals/UIErrorString.h

Last change on this file was 98103, checked in by vboxsync, 16 months ago

Copyright year updates by scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.0 KB
Line 
1/* $Id: UIErrorString.h 98103 2023-01-17 14:15:46Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - UIErrorString class declaration.
4 */
5
6/*
7 * Copyright (C) 2006-2023 Oracle and/or its affiliates.
8 *
9 * This file is part of VirtualBox base platform packages, as
10 * available from https://www.virtualbox.org.
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation, in version 3 of the
15 * License.
16 *
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, see <https://www.gnu.org/licenses>.
24 *
25 * SPDX-License-Identifier: GPL-3.0-only
26 */
27
28#ifndef FEQT_INCLUDED_SRC_globals_UIErrorString_h
29#define FEQT_INCLUDED_SRC_globals_UIErrorString_h
30#ifndef RT_WITHOUT_PRAGMA_ONCE
31# pragma once
32#endif
33
34/* Qt includes: */
35#include <QString>
36
37/* GUI includes: */
38#include "UILibraryDefs.h"
39
40/* Other VBox includes: */
41#include <VBox/com/defs.h>
42
43/* Forward declarations: */
44class COMBaseWithEI;
45class COMErrorInfo;
46class COMResult;
47class CProgress;
48class CVirtualBoxErrorInfo;
49
50/** Namespace simplifying COM error formatting. */
51class SHARED_LIBRARY_STUFF UIErrorString
52{
53public:
54
55 /** Returns formatted @a rc information. */
56 static QString formatRC(HRESULT rc);
57 /** Returns full formatted @a rc information. */
58 static QString formatRCFull(HRESULT rc);
59 /** Returns formatted error information for passed @a comProgress. */
60 static QString formatErrorInfo(const CProgress &comProgress);
61 /** Returns formatted error information for passed @a comInfo and @a wrapperRC. */
62 static QString formatErrorInfo(const COMErrorInfo &comInfo, HRESULT wrapperRC = S_OK);
63 /** Returns formatted error information for passed @a comInfo. */
64 static QString formatErrorInfo(const CVirtualBoxErrorInfo &comInfo);
65 /** Returns formatted error information for passed @a comWrapper. */
66 static QString formatErrorInfo(const COMBaseWithEI &comWrapper);
67 /** Returns formatted error information for passed @a comRc. */
68 static QString formatErrorInfo(const COMResult &comRc);
69
70 /** Returns simplified error information for passed @a comInfo and @a wrapperRC. */
71 static QString simplifiedErrorInfo(const COMErrorInfo &comInfo, HRESULT wrapperRC = S_OK);
72 /** Returns simplified error information for passed @a comWrapper. */
73 static QString simplifiedErrorInfo(const COMBaseWithEI &comWrapper);
74
75private:
76
77 /** Converts passed @a comInfo and @a wrapperRC to string. */
78 static QString errorInfoToString(const COMErrorInfo &comInfo, HRESULT wrapperRC = S_OK);
79
80 /** Converts passed @a comInfo and @a wrapperRC to simplified string. */
81 static QString errorInfoToSimpleString(const COMErrorInfo &comInfo, HRESULT wrapperRC = S_OK);
82};
83
84#endif /* !FEQT_INCLUDED_SRC_globals_UIErrorString_h */
85
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use