|
1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // Started by DWW, May 1997 |
|
15 // Error handler |
|
16 // |
|
17 // |
|
18 |
|
19 #if !defined(__BAERRHAN_H__) |
|
20 #define __BAERRHAN_H__ |
|
21 |
|
22 #if !defined(__E32BASE_H__) |
|
23 #include <e32base.h> |
|
24 #endif |
|
25 /** |
|
26 @internalComponent |
|
27 */ |
|
28 #ifdef _UNICODE |
|
29 #define KUidBaflErrorHandlerValue KUidBaflErrorHandlerValue16 |
|
30 #define KUidBaflErrorHandler KUidBaflErrorHandler16 |
|
31 #else |
|
32 #define KUidBaflErrorHandlerValue KUidBaflErrorHandlerValue8 |
|
33 #define KUidBaflErrorHandler KUidBaflErrorHandler8 |
|
34 #endif |
|
35 |
|
36 |
|
37 /** |
|
38 @internalComponent |
|
39 */ |
|
40 const TInt KUidBaflErrorHandlerValue8=0x10000257; |
|
41 const TUid KUidBaflErrorHandler8={KUidBaflErrorHandlerValue8}; |
|
42 const TInt KUidBaflErrorHandlerValue16=0x10003A13; |
|
43 const TUid KUidBaflErrorHandler16={KUidBaflErrorHandlerValue16}; |
|
44 |
|
45 /** |
|
46 @internalComponent |
|
47 */ |
|
48 enum TErrorHandlerResponse |
|
49 { |
|
50 EErrorNotHandled, |
|
51 ENoDisplay, |
|
52 EAlertDisplay, |
|
53 EInfoDisplay |
|
54 }; |
|
55 |
|
56 class CBaErrorHandler : public CBase |
|
57 /** |
|
58 deliberately *not* mixable - else couldn't be freely cast |
|
59 @internalComponent |
|
60 */ |
|
61 { |
|
62 public: |
|
63 virtual TErrorHandlerResponse HandleError(TDes& aErrorText,TDes& aContextText)=0; |
|
64 inline static TErrorHandlerResponse CallBack(TInt aErrorNumber,TDes& aErrorText,TDes& aContextText); |
|
65 }; |
|
66 |
|
67 inline TErrorHandlerResponse CBaErrorHandler::CallBack(TInt aErrorNumber,TDes& aErrorText,TDes& aContextText) |
|
68 { |
|
69 return((CBaErrorHandler*)(aErrorNumber))->HandleError(aErrorText,aContextText); |
|
70 } |
|
71 |
|
72 #endif |