|
1 /* |
|
2 * Copyright (c) 2002 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: |
|
15 * classes for IMPS encoder. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef MImpsMessageInterpreterApi_H |
|
21 #define MImpsMessageInterpreterApi_H |
|
22 |
|
23 // FORWARD DECLARATIONS |
|
24 class MImpsDataAccessor; |
|
25 class CBufFlat; |
|
26 class MImpsCSPSession; |
|
27 |
|
28 // CLASS DECLARATION |
|
29 |
|
30 /** |
|
31 * Abstract Encoder class |
|
32 */ |
|
33 class MImpsEncoder |
|
34 { |
|
35 |
|
36 public: |
|
37 |
|
38 /** |
|
39 * Method builds (wb)xml encoded message based on data |
|
40 * included in class aImpsData |
|
41 * @param aImpsData reference to MImpsDataAccessor class. |
|
42 * @param aEncodeBuffer buffer to hold the encoded message, |
|
43 */ |
|
44 virtual void EncodeMessageL( |
|
45 MImpsDataAccessor& aImpsData, |
|
46 CBufFlat& aEncodeBuffer ) = 0; |
|
47 |
|
48 /** |
|
49 * Destructor |
|
50 */ |
|
51 virtual void Destroy() = 0; |
|
52 |
|
53 /** |
|
54 * MIME type supported |
|
55 * @return MIME type |
|
56 */ |
|
57 virtual TPtrC8 MimeType() = 0; |
|
58 |
|
59 }; |
|
60 |
|
61 /** |
|
62 * Abstract Decoder class |
|
63 */ |
|
64 class MImpsDecoder |
|
65 { |
|
66 |
|
67 public: // New functions |
|
68 |
|
69 /** |
|
70 * Method decodes (wb)xml message to internal data structures and stores |
|
71 * it in aImpsData |
|
72 * @param aImpsData reference to MImpsDataAccessor class. |
|
73 * @param pointer to aEncodeBuffer buffer to hold the encoded message |
|
74 * Please note that the buffer ownership is taken. |
|
75 * It is taken in such way that the aEncodeBuffer will point to |
|
76 * NULL if the transfer was successful. |
|
77 */ |
|
78 virtual void DecodeMessageL( |
|
79 MImpsDataAccessor& aImpsData, |
|
80 HBufC8** aEncodeBuffer ) = 0; |
|
81 |
|
82 /** |
|
83 * Method decodes (wb)xml message to internal data structures |
|
84 * in asynchronous manner. The completion of the operation is signaled in |
|
85 * MImpsCSPSession::TransportResponseParsedL() method. |
|
86 * @param aEncodeBuffer buffer to hold the encoded message |
|
87 * Please note that the buffer ownership is taken!!! |
|
88 * @return operation ID |
|
89 */ |
|
90 virtual TInt DecodeMsgAsyncL( |
|
91 HBufC8** aBuffer ) = 0; |
|
92 |
|
93 /** |
|
94 * Method to cancel the asynchronous decoding |
|
95 */ |
|
96 virtual void CancelDecoding() = 0; |
|
97 |
|
98 /** |
|
99 * Destructor |
|
100 */ |
|
101 virtual void Destroy() = 0; |
|
102 |
|
103 }; |
|
104 |
|
105 /** |
|
106 * This creates the actual message decoder instance. |
|
107 * This replaces dynamic DLL loading because of |
|
108 * static loading is a little bit faster. |
|
109 * @return a pointer to the actual C-class instance. |
|
110 */ |
|
111 IMPORT_C GLDEF_C MImpsDecoder* NewDecoderL( MImpsCSPSession* aCallback ); |
|
112 |
|
113 /** |
|
114 * This creates the actual message encoder instance. |
|
115 * This replaces dynamic DLL loading because of |
|
116 * static loading is a little bit faster. |
|
117 * @return a pointer to the actual C-class instance |
|
118 */ |
|
119 IMPORT_C GLDEF_C MImpsEncoder* NewEncoderL( ); |
|
120 |
|
121 #endif |
|
122 |
|
123 // End of File |