| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 |
|
|---|
| 30 |
|
|---|
| 31 |
|
|---|
| 32 |
|
|---|
| 33 |
#ifndef ___VBox_com_VirtualBoxErrorInfo_h |
|---|
| 34 |
#define ___VBox_com_VirtualBoxErrorInfo_h |
|---|
| 35 |
|
|---|
| 36 |
#include "VBox/com/defs.h" |
|---|
| 37 |
#include "VBox/com/string.h" |
|---|
| 38 |
#include "VBox/com/ptr.h" |
|---|
| 39 |
#include "VBox/com/Guid.h" |
|---|
| 40 |
|
|---|
| 41 |
|
|---|
| 42 |
#include "VBox/com/VirtualBox.h" |
|---|
| 43 |
|
|---|
| 44 |
namespace com |
|---|
| 45 |
{ |
|---|
| 46 |
|
|---|
| 47 |
|
|---|
| 48 |
|
|---|
| 49 |
|
|---|
| 50 |
|
|---|
| 51 |
|
|---|
| 52 |
|
|---|
| 53 |
|
|---|
| 54 |
|
|---|
| 55 |
|
|---|
| 56 |
|
|---|
| 57 |
class ATL_NO_VTABLE VirtualBoxErrorInfo |
|---|
| 58 |
#if !defined (VBOX_WITH_XPCOM) |
|---|
| 59 |
: public CComObjectRootEx <CComMultiThreadModel> |
|---|
| 60 |
#else |
|---|
| 61 |
: public CComObjectRootEx |
|---|
| 62 |
#endif |
|---|
| 63 |
, public IVirtualBoxErrorInfo |
|---|
| 64 |
{ |
|---|
| 65 |
public: |
|---|
| 66 |
|
|---|
| 67 |
DECLARE_NOT_AGGREGATABLE (VirtualBoxErrorInfo) |
|---|
| 68 |
|
|---|
| 69 |
DECLARE_PROTECT_FINAL_CONSTRUCT() |
|---|
| 70 |
|
|---|
| 71 |
BEGIN_COM_MAP (VirtualBoxErrorInfo) |
|---|
| 72 |
COM_INTERFACE_ENTRY (IErrorInfo) |
|---|
| 73 |
COM_INTERFACE_ENTRY (IVirtualBoxErrorInfo) |
|---|
| 74 |
END_COM_MAP() |
|---|
| 75 |
|
|---|
| 76 |
NS_DECL_ISUPPORTS |
|---|
| 77 |
|
|---|
| 78 |
VirtualBoxErrorInfo() : mResultCode (S_OK) {} |
|---|
| 79 |
|
|---|
| 80 |
|
|---|
| 81 |
|
|---|
| 82 |
HRESULT init (HRESULT aResultCode, const GUID *aIID, |
|---|
| 83 |
const char *aComponent, const char *aText, |
|---|
| 84 |
IVirtualBoxErrorInfo *aNext = NULL); |
|---|
| 85 |
|
|---|
| 86 |
|
|---|
| 87 |
STDMETHOD(COMGETTER(ResultCode)) (HRESULT *aResultCode); |
|---|
| 88 |
STDMETHOD(COMGETTER(InterfaceID)) (OUT_GUID aIID); |
|---|
| 89 |
STDMETHOD(COMGETTER(Component)) (BSTR *aComponent); |
|---|
| 90 |
STDMETHOD(COMGETTER(Text)) (BSTR *aText); |
|---|
| 91 |
STDMETHOD(COMGETTER(Next)) (IVirtualBoxErrorInfo **aNext); |
|---|
| 92 |
|
|---|
| 93 |
#if !defined (VBOX_WITH_XPCOM) |
|---|
| 94 |
|
|---|
| 95 |
HRESULT init (IErrorInfo *aInfo); |
|---|
| 96 |
|
|---|
| 97 |
STDMETHOD(GetGUID) (GUID *guid); |
|---|
| 98 |
STDMETHOD(GetSource) (BSTR *source); |
|---|
| 99 |
STDMETHOD(GetDescription) (BSTR *description); |
|---|
| 100 |
STDMETHOD(GetHelpFile) (BSTR *pBstrHelpFile); |
|---|
| 101 |
STDMETHOD(GetHelpContext) (DWORD *pdwHelpContext); |
|---|
| 102 |
|
|---|
| 103 |
#else |
|---|
| 104 |
|
|---|
| 105 |
HRESULT init (nsIException *aInfo); |
|---|
| 106 |
|
|---|
| 107 |
NS_DECL_NSIEXCEPTION |
|---|
| 108 |
|
|---|
| 109 |
#endif |
|---|
| 110 |
|
|---|
| 111 |
private: |
|---|
| 112 |
|
|---|
| 113 |
HRESULT mResultCode; |
|---|
| 114 |
Bstr mText; |
|---|
| 115 |
Guid mIID; |
|---|
| 116 |
Bstr mComponent; |
|---|
| 117 |
ComPtr <IVirtualBoxErrorInfo> mNext; |
|---|
| 118 |
}; |
|---|
| 119 |
|
|---|
| 120 |
|
|---|
| 121 |
|
|---|
| 122 |
|
|---|
| 123 |
|
|---|
| 124 |
|
|---|
| 125 |
|
|---|
| 126 |
|
|---|
| 127 |
class ATL_NO_VTABLE VirtualBoxErrorInfoGlue |
|---|
| 128 |
#if !defined (VBOX_WITH_XPCOM) |
|---|
| 129 |
: public CComObjectRootEx <CComMultiThreadModel> |
|---|
| 130 |
#else |
|---|
| 131 |
: public CComObjectRootEx |
|---|
| 132 |
#endif |
|---|
| 133 |
, public IVirtualBoxErrorInfo |
|---|
| 134 |
{ |
|---|
| 135 |
public: |
|---|
| 136 |
|
|---|
| 137 |
DECLARE_NOT_AGGREGATABLE (VirtualBoxErrorInfoGlue) |
|---|
| 138 |
|
|---|
| 139 |
DECLARE_PROTECT_FINAL_CONSTRUCT() |
|---|
| 140 |
|
|---|
| 141 |
BEGIN_COM_MAP (VirtualBoxErrorInfoGlue) |
|---|
| 142 |
COM_INTERFACE_ENTRY (IErrorInfo) |
|---|
| 143 |
COM_INTERFACE_ENTRY (IVirtualBoxErrorInfo) |
|---|
| 144 |
END_COM_MAP() |
|---|
| 145 |
|
|---|
| 146 |
NS_DECL_ISUPPORTS |
|---|
| 147 |
|
|---|
| 148 |
VirtualBoxErrorInfoGlue() {} |
|---|
| 149 |
|
|---|
| 150 |
|
|---|
| 151 |
|
|---|
| 152 |
HRESULT init (IVirtualBoxErrorInfo *aReal, IVirtualBoxErrorInfo *aNext); |
|---|
| 153 |
|
|---|
| 154 |
protected: |
|---|
| 155 |
|
|---|
| 156 |
HRESULT protectedInit (IVirtualBoxErrorInfo *aReal, IVirtualBoxErrorInfo *aNext); |
|---|
| 157 |
|
|---|
| 158 |
private: |
|---|
| 159 |
|
|---|
| 160 |
|
|---|
| 161 |
COM_FORWARD_IVirtualBoxErrorInfo_GETTER_ResultCode_TO_OBJ (mReal) |
|---|
| 162 |
COM_FORWARD_IVirtualBoxErrorInfo_GETTER_InterfaceID_TO_OBJ (mReal) |
|---|
| 163 |
COM_FORWARD_IVirtualBoxErrorInfo_GETTER_Component_TO_OBJ (mReal) |
|---|
| 164 |
COM_FORWARD_IVirtualBoxErrorInfo_GETTER_Text_TO_OBJ (mReal) |
|---|
| 165 |
STDMETHOD(COMGETTER(Next)) (IVirtualBoxErrorInfo **aNext); |
|---|
| 166 |
|
|---|
| 167 |
#if !defined (VBOX_WITH_XPCOM) |
|---|
| 168 |
|
|---|
| 169 |
STDMETHOD(GetGUID) (GUID *guid) { return mReal->GetGUID (guid); } |
|---|
| 170 |
STDMETHOD(GetSource) (BSTR *source) { return mReal->GetSource (source); } |
|---|
| 171 |
STDMETHOD(GetDescription) (BSTR *description) { return mReal->GetDescription (description); } |
|---|
| 172 |
STDMETHOD(GetHelpFile) (BSTR *pBstrHelpFile) { return mReal->GetHelpFile (pBstrHelpFile); } |
|---|
| 173 |
STDMETHOD(GetHelpContext) (DWORD *pdwHelpContext) { return mReal->GetHelpContext (pdwHelpContext); } |
|---|
| 174 |
|
|---|
| 175 |
#else |
|---|
| 176 |
|
|---|
| 177 |
NS_FORWARD_NSIEXCEPTION (mReal->) |
|---|
| 178 |
|
|---|
| 179 |
#endif |
|---|
| 180 |
|
|---|
| 181 |
private: |
|---|
| 182 |
|
|---|
| 183 |
ComPtr <IVirtualBoxErrorInfo> mReal; |
|---|
| 184 |
ComPtr <IVirtualBoxErrorInfo> mNext; |
|---|
| 185 |
}; |
|---|
| 186 |
|
|---|
| 187 |
} |
|---|
| 188 |
|
|---|
| 189 |
#endif |
|---|
| 190 |
|
|---|