|
1 /* |
|
2 * Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Conversion for private error codes to public syncML errors. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef TNSMLERRORCONVERSION_H |
|
21 #define TNSMLERRORCONVERSION_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32std.h> |
|
25 |
|
26 // CLASS DECLARATION |
|
27 |
|
28 /** |
|
29 * Converts private error code to public SyncML error code. |
|
30 * |
|
31 * @lib SyncMLClientAPI.lib |
|
32 */ |
|
33 class TNSmlErrorConversion |
|
34 { |
|
35 public: |
|
36 struct TNSmlErrorMapping |
|
37 { |
|
38 TInt iErrorCode; |
|
39 TInt iSyncMLError; |
|
40 }; |
|
41 |
|
42 struct TNSmlErrorMappingRange |
|
43 { |
|
44 TInt iErrorCodeRangeStart; |
|
45 TInt iErrorCodeRangeEnd; |
|
46 TInt iSyncMLError; |
|
47 }; |
|
48 |
|
49 public: // Constructors and destructor |
|
50 |
|
51 /** |
|
52 * C++ default constructor. |
|
53 */ |
|
54 IMPORT_C TNSmlErrorConversion( TInt aErrorCode ); |
|
55 |
|
56 public: // New functions |
|
57 |
|
58 void SetErrorCode( TInt aErrorCode ); |
|
59 |
|
60 IMPORT_C TInt Convert() const; |
|
61 |
|
62 private: // New functions |
|
63 |
|
64 // Prohibit copy constructor |
|
65 TNSmlErrorConversion( const TNSmlErrorConversion& ); |
|
66 // Prohibit assigment operator. |
|
67 TNSmlErrorConversion& operator=( const TNSmlErrorConversion& ); |
|
68 |
|
69 protected: // Data |
|
70 TInt iErrorCode; |
|
71 static const TNSmlErrorMapping KErrors[]; |
|
72 static const TNSmlErrorMappingRange KErrorRanges[]; |
|
73 }; |
|
74 |
|
75 #endif // TNSMLERRORCONVERSION_H |
|
76 |
|
77 // End of File |