1 | /** @file
|
---|
2 | *
|
---|
3 | * VirtualBoxErrorInfo COM classe definition
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2006-2007 Oracle Corporation
|
---|
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 |
|
---|
18 | #ifndef ____H_VIRTUALBOXERRORINFOIMPL
|
---|
19 | #define ____H_VIRTUALBOXERRORINFOIMPL
|
---|
20 |
|
---|
21 | #include "VirtualBoxBase.h"
|
---|
22 |
|
---|
23 | using namespace com;
|
---|
24 |
|
---|
25 | class ATL_NO_VTABLE VirtualBoxErrorInfo
|
---|
26 | : public CComObjectRootEx <CComMultiThreadModel>
|
---|
27 | , public IVirtualBoxErrorInfo
|
---|
28 | {
|
---|
29 | public:
|
---|
30 |
|
---|
31 | DECLARE_NOT_AGGREGATABLE(VirtualBoxErrorInfo)
|
---|
32 |
|
---|
33 | DECLARE_PROTECT_FINAL_CONSTRUCT()
|
---|
34 |
|
---|
35 | BEGIN_COM_MAP(VirtualBoxErrorInfo)
|
---|
36 | COM_INTERFACE_ENTRY(IErrorInfo)
|
---|
37 | COM_INTERFACE_ENTRY(IVirtualBoxErrorInfo)
|
---|
38 | END_COM_MAP()
|
---|
39 |
|
---|
40 | #if defined (RT_OS_WINDOWS)
|
---|
41 |
|
---|
42 | HRESULT init (IErrorInfo *aInfo);
|
---|
43 |
|
---|
44 | STDMETHOD(GetGUID) (GUID *guid);
|
---|
45 | STDMETHOD(GetSource) (BSTR *source);
|
---|
46 | STDMETHOD(GetDescription) (BSTR *description);
|
---|
47 | STDMETHOD(GetHelpFile) (BSTR *pBstrHelpFile);
|
---|
48 | STDMETHOD(GetHelpContext) (DWORD *pdwHelpContext);
|
---|
49 |
|
---|
50 | #else // !defined (RT_OS_WINDOWS)
|
---|
51 |
|
---|
52 | HRESULT init (nsIException *aInfo);
|
---|
53 |
|
---|
54 | NS_DECL_NSIEXCEPTION
|
---|
55 |
|
---|
56 | #endif
|
---|
57 |
|
---|
58 | VirtualBoxErrorInfo() : mResultCode (S_OK) {}
|
---|
59 |
|
---|
60 | // public initializer/uninitializer for internal purposes only
|
---|
61 | HRESULT init (HRESULT aResultCode, const GUID &aIID,
|
---|
62 | CBSTR aComponent, CBSTR aText,
|
---|
63 | IVirtualBoxErrorInfo *aNext = NULL);
|
---|
64 |
|
---|
65 | // IVirtualBoxErrorInfo properties
|
---|
66 | STDMETHOD(COMGETTER(ResultCode)) (LONG *aResultCode);
|
---|
67 | STDMETHOD(COMGETTER(InterfaceID)) (BSTR *aIID);
|
---|
68 | STDMETHOD(COMGETTER(Component)) (BSTR *aComponent);
|
---|
69 | STDMETHOD(COMGETTER(Text)) (BSTR *aText);
|
---|
70 | STDMETHOD(COMGETTER(Next)) (IVirtualBoxErrorInfo **aNext);
|
---|
71 |
|
---|
72 | private:
|
---|
73 | // FIXME: declare these here until VBoxSupportsTranslation base
|
---|
74 | // is available in this class.
|
---|
75 | static const char *tr (const char *a) { return a; }
|
---|
76 | static HRESULT setError(HRESULT rc,
|
---|
77 | const char * /* a */,
|
---|
78 | const char * /* b */,
|
---|
79 | void * /* c */) { return rc; }
|
---|
80 |
|
---|
81 | HRESULT mResultCode;
|
---|
82 | Bstr mText;
|
---|
83 | Guid mIID;
|
---|
84 | Bstr mComponent;
|
---|
85 | ComPtr<IVirtualBoxErrorInfo> mNext;
|
---|
86 | };
|
---|
87 |
|
---|
88 | #endif // ____H_VIRTUALBOXERRORINFOIMPL
|
---|
89 |
|
---|
90 | /* vi: set tabstop=4 shiftwidth=4 expandtab: */
|
---|