1 /****************************************************************************
3 * $Id: rmaerror.h 7 2003-05-30 02:18:02Z gabest $
5 * Copyright (C) 1995-1999 RealNetworks, Inc. All rights reserved.
7 * http://www.real.com/devzone
9 * This program contains proprietary
10 * information of Progressive Networks, Inc, and is licensed
11 * subject to restrictions on use and distribution.
14 * RealMedia Architecture error reporting interfaces.
22 * Forward declarations of some interfaces defined here-in.
24 typedef _INTERFACE IRMABuffer IRMABuffer
;
25 typedef _INTERFACE IRMAErrorSinkControl IRMAErrorSinkControl
;
28 /* Message Severity values */
31 PNLOG_EMERG
= 0, /* A panic condition. Server / Player will halt or
34 PNLOG_ALERT
= 1, /* A condition that should be corrected immediately.
35 Needs user intervention to prevent problems. */
37 PNLOG_CRIT
= 2, /* Critical conditions. */
39 PNLOG_ERR
= 3, /* Errors. */
41 PNLOG_WARNING
= 4, /* Warning messages. */
43 PNLOG_NOTICE
= 5, /* Conditions that are not error conditions, but
44 should possibly be handled specially. */
46 PNLOG_INFO
= 6, /* Informational messages. */
48 PNLOG_DEBUG
= 7 /* Messages that contain information normally of use
49 only when debugging a program. */
53 /****************************************************************************
61 * Error, event, and status message reporting interface
63 * IID_IRMAErrorMessages:
65 * {00000800-0901-11d1-8B06-00A024406D59}
68 DEFINE_GUID(IID_IRMAErrorMessages
, 0x00000800, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
69 0xa0, 0x24, 0x40, 0x6d, 0x59);
72 #define INTERFACE IRMAErrorMessages
74 DECLARE_INTERFACE_(IRMAErrorMessages
, IUnknown
)
79 STDMETHOD(QueryInterface
) (THIS_
83 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
85 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
88 * IRMAErrorMessages methods
91 /************************************************************************
93 * IRMAErrorMessages::Report
95 * Call this method to report an error, event, or status message.
98 * const UINT8 unSeverity
99 * Type of report. This value will impact how the player, tool, or
100 * server will react to the report. Possible values are described
101 * above. Depending on the error type, an error message with the
102 * RMA code, anda string translation of that code will be displayed.
103 * The error dialog includes a "more info" section that displays the
104 * user code and string, and a link to the more info URL. In the
105 * server these messages are logged to the log file.
107 * const ULONG32 ulRMACode
108 * Well known RMA error code. This will be translated to a text
109 * representation for display in an error dialog box or log file.
111 * const ULONG32 ulUserCode
112 * User specific error code. This will NOT be translated to a text
113 * representation. This can be any value the caller wants, it will
114 * be logged or displayed but not interpretted.
116 * const char* pUserString
117 * User specific error string. This will NOT be translated or
118 * modified. This can be any value the caller wants, it will
119 * be logged or displayed but not interpretted.
121 * const char* pMoreInfoURL
122 * User specific more info URL string.
125 STDMETHOD(Report
) (THIS_
126 const UINT8 unSeverity
,
128 const ULONG32 ulUserCode
,
129 const char* pUserString
,
130 const char* pMoreInfoURL
) PURE
;
132 /************************************************************************
134 * IRMAErrorMessages::GetErrorText
136 * Call this method to get the text description of a RMA error code.
138 * PN_RESULT ulRMACode (A RMA error code)
140 * IRMABuffer* containing error text.
142 STDMETHOD_(IRMABuffer
*, GetErrorText
) (THIS_
143 PN_RESULT ulRMACode
) PURE
;
147 /****************************************************************************
155 * Error Sink Interface
159 * {00000801-0901-11d1-8B06-00A024406D59}
162 DEFINE_GUID(IID_IRMAErrorSink
, 0x00000801, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
163 0xa0, 0x24, 0x40, 0x6d, 0x59);
166 #define INTERFACE IRMAErrorSink
168 DECLARE_INTERFACE_(IRMAErrorSink
, IUnknown
)
173 STDMETHOD(QueryInterface
) (THIS_
177 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
179 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
182 * IRMAErrorSink methods
185 /************************************************************************
187 * IRMAErrorSink::ErrorOccurred
189 * After you have registered your error sink with an
190 * IRMAErrorSinkControl (either in the server or player core) this
191 * method will be called to report an error, event, or status message.
193 * The meaning of the arguments is exactly as described in
196 STDMETHOD(ErrorOccurred
) (THIS_
197 const UINT8 unSeverity
,
198 const ULONG32 ulRMACode
,
199 const ULONG32 ulUserCode
,
200 const char* pUserString
,
201 const char* pMoreInfoURL
206 /****************************************************************************
210 * IRMAErrorSinkControl
214 * Error Sink Control Interface
216 * IID_IRMAErrorSinkControl:
218 * {00000802-0901-11d1-8B06-00A024406D59}
221 DEFINE_GUID(IID_IRMAErrorSinkControl
, 0x00000802, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
222 0xa0, 0x24, 0x40, 0x6d, 0x59);
225 #define INTERFACE IRMAErrorSinkControl
228 DECLARE_INTERFACE_(IRMAErrorSinkControl
, IUnknown
)
233 STDMETHOD(QueryInterface
) (THIS_
237 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
239 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
242 * IRMAErrorSinkControl methods
245 /************************************************************************
247 * IRMAErrorSinkControl::AddErrorSink
249 * Call this method to tell the sink controller to handle an error
252 * This method also allows you to set a range of severity levels which
253 * you will receive reports for.
255 * Note: You should specify an invalid range (Low = 1, High = 0 for
256 * example) if you don't want to receive any errors.
258 * The default severity range is PNLOG_EMERG to PNLOG_INFO (0-6).
260 STDMETHOD(AddErrorSink
) (THIS_
261 IRMAErrorSink
* pErrorSink
,
262 const UINT8 unLowSeverity
,
263 const UINT8 unHighSeverity
) PURE
;
265 /************************************************************************
267 * IRMAErrorSinkControl::AddErrorSink
269 * Call this method to remove an error sink.
271 STDMETHOD(RemoveErrorSink
) (THIS_
272 IRMAErrorSink
* pErrorSink
) PURE
;
276 #endif /* _RMAERROR_H_ */