VirtualBox

source: vbox/trunk/src/VBox/Main/include/VirtualBoxErrorInfoImpl.h@ 16560

Last change on this file since 16560 was 15051, checked in by vboxsync, 15 years ago

Main: Cleaned up the long standing const BSTR = const (OLECHAR *) on WIn32 vs (const PRunichar) * on XPCOM clash. Cleaned up BSTR/GUID macros (IN_BSTR replaces INPTR BSTR, IN_GUID replaces INPTR GUIDPARAM, OUT_GUID replaces GUIDPARAMOUT).

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.8 KB
Line 
1/** @file
2 *
3 * VirtualBoxErrorInfo COM classe definition
4 */
5
6/*
7 * Copyright (C) 2006-2007 Sun Microsystems, Inc.
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 *
17 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
18 * Clara, CA 95054 USA or visit http://www.sun.com if you need
19 * additional information or have any questions.
20 */
21
22#ifndef ____H_VIRTUALBOXERRORINFOIMPL
23#define ____H_VIRTUALBOXERRORINFOIMPL
24
25#include "VirtualBoxBase.h"
26
27using namespace com;
28
29class ATL_NO_VTABLE VirtualBoxErrorInfo
30#if defined (RT_OS_WINDOWS)
31 : public CComObjectRootEx <CComMultiThreadModel>
32#else
33 : public CComObjectRootEx
34#endif
35 , public IVirtualBoxErrorInfo
36{
37public:
38
39 DECLARE_NOT_AGGREGATABLE(VirtualBoxErrorInfo)
40
41 DECLARE_PROTECT_FINAL_CONSTRUCT()
42
43 BEGIN_COM_MAP(VirtualBoxErrorInfo)
44 COM_INTERFACE_ENTRY(IErrorInfo)
45 COM_INTERFACE_ENTRY(IVirtualBoxErrorInfo)
46 END_COM_MAP()
47
48 NS_DECL_ISUPPORTS
49
50#if defined (RT_OS_WINDOWS)
51
52 HRESULT init (IErrorInfo *aInfo);
53
54 STDMETHOD(GetGUID) (GUID *guid);
55 STDMETHOD(GetSource) (BSTR *source);
56 STDMETHOD(GetDescription) (BSTR *description);
57 STDMETHOD(GetHelpFile) (BSTR *pBstrHelpFile);
58 STDMETHOD(GetHelpContext) (DWORD *pdwHelpContext);
59
60#else // !defined (RT_OS_WINDOWS)
61
62 HRESULT init (nsIException *aInfo);
63
64 NS_DECL_NSIEXCEPTION
65
66#endif
67
68 VirtualBoxErrorInfo() : mResultCode (S_OK) {}
69
70 // public initializer/uninitializer for internal purposes only
71 HRESULT init (HRESULT aResultCode, const GUID &aIID,
72 CBSTR aComponent, CBSTR aText,
73 IVirtualBoxErrorInfo *aNext = NULL);
74
75 // IVirtualBoxErrorInfo properties
76 STDMETHOD(COMGETTER(ResultCode)) (HRESULT *aResultCode);
77 STDMETHOD(COMGETTER(InterfaceID)) (OUT_GUID aIID);
78 STDMETHOD(COMGETTER(Component)) (BSTR *aComponent);
79 STDMETHOD(COMGETTER(Text)) (BSTR *aText);
80 STDMETHOD(COMGETTER(Next)) (IVirtualBoxErrorInfo **aNext);
81
82private:
83 // FIXME: declare these here until VBoxSupportsTranslation base
84 // is available in this class.
85 static const char *tr (const char *a) { return a; }
86 static HRESULT setError (HRESULT rc, const char *a,
87 const char *b, void *c) { return rc; }
88
89 HRESULT mResultCode;
90 Bstr mText;
91 Guid mIID;
92 Bstr mComponent;
93 ComPtr <IVirtualBoxErrorInfo> mNext;
94};
95
96#endif // ____H_VIRTUALBOXERRORINFOIMPL
97
98/* vi: set tabstop=4 shiftwidth=4 expandtab: */
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use