|
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: Base class for attribute list transactions |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __CPENGATTRIBUTELISTTRANSBASE_H__ |
|
19 #define __CPENGATTRIBUTELISTTRANSBASE_H__ |
|
20 |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include <bamdesca.h> |
|
25 #include "MPEngOutgoingTransactionHandler.h" |
|
26 #include "PEngWVCspVersion.h" |
|
27 |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 class MPEngAttributeListTransactionManager; |
|
31 class CPEngContactListTransactionManager; |
|
32 class CPEngTransactionStatus; |
|
33 class MPEngXMLSerializer; |
|
34 class CDesC16Array; |
|
35 |
|
36 // CLASS DECLARATION |
|
37 |
|
38 /** |
|
39 * Base class for Attribute list transactions |
|
40 * Derived classes handle creation and deletion. |
|
41 * of the attribute lists from Network server. |
|
42 * This class is intended for derivation. |
|
43 * |
|
44 * @lib PEngListLib2 |
|
45 * @since 3.0 |
|
46 */ |
|
47 NONSHARABLE_CLASS( CPEngAttributeListTransBase ) : |
|
48 public CBase, |
|
49 public MPEngOutgoingTransactionHandler |
|
50 { |
|
51 public: |
|
52 |
|
53 /** |
|
54 * Destructor. |
|
55 */ |
|
56 virtual ~CPEngAttributeListTransBase(); |
|
57 |
|
58 |
|
59 public: // From MPEngOutgoingTransactionHandler |
|
60 |
|
61 /** |
|
62 * Signals to the transaction handler thst it is last |
|
63 * @see <MPEngOutgoingTransactionHandler.h> |
|
64 */ |
|
65 void LastRunningTransactionHandler(); |
|
66 |
|
67 /** |
|
68 * Process the response to the request. |
|
69 * @see <MPEngOutgoingTransactionHandler.h> |
|
70 */ |
|
71 void ProcessResponseL( const TDesC8& aResponse, |
|
72 TRequestStatus& aStatus ); |
|
73 |
|
74 /** |
|
75 * Cancels asynchronous processing of the request |
|
76 * @see <MPEngOutgoingTransactionHandler.h> |
|
77 */ |
|
78 void CancelProcessing(); |
|
79 |
|
80 |
|
81 /** |
|
82 * Support for simultaneous transaction handling |
|
83 * @see <MPEngOutgoingTransactionHandler.h> |
|
84 */ |
|
85 void NewTransactionHandlersL( |
|
86 RPointerArray<MPEngOutgoingTransactionHandler>& aHandlers ); |
|
87 |
|
88 |
|
89 /** |
|
90 * Function to signal completing of the transaction |
|
91 * @see <MPEngOutgoingTransactionHandler.h> |
|
92 */ |
|
93 TBool TransactionCompleted( ); |
|
94 |
|
95 |
|
96 /** |
|
97 * Gets transaction status result class |
|
98 * @see <MPEngOutgoingTransactionHandler.h> |
|
99 */ |
|
100 CPEngTransactionStatus* TransactionResult(); |
|
101 |
|
102 |
|
103 /** |
|
104 * Releases the handler |
|
105 * @see <MPEngOutgoingTransactionHandler.h> |
|
106 */ |
|
107 void ReleaseHandler(); |
|
108 |
|
109 |
|
110 public: // Template functions for derived classes |
|
111 |
|
112 /** |
|
113 * Consume XML message response from the WV server |
|
114 * @since 3.0 |
|
115 * @param aResponse buffer with the response |
|
116 */ |
|
117 virtual void DoConsumeMessageFromServerL( const TDesC8& aResponse ) = 0; |
|
118 |
|
119 |
|
120 |
|
121 protected: // new functions used by the derived classes |
|
122 |
|
123 /** |
|
124 * Append lists of contact lists to the buffer |
|
125 * |
|
126 * @since 3.0 |
|
127 * @param aXmlSerializer XML serializer |
|
128 * @param aContactLists contact list name to append |
|
129 */ |
|
130 void XMLAppendContactListsL( MPEngXMLSerializer& aXmlSerializer, |
|
131 const MDesCArray& aContactLists ); |
|
132 |
|
133 /** |
|
134 * Append lists of contact Ids to the buffer |
|
135 * |
|
136 * @since 3.0 |
|
137 * @param aXmlSerializer XML serializer |
|
138 * @param aContactIds array of wv IDs to be appended |
|
139 */ |
|
140 void XMLAppendContactIdsL( MPEngXMLSerializer& aXmlSerializer, |
|
141 const MDesCArray& aContactIds ); |
|
142 |
|
143 /** |
|
144 * Append settings of the default list, according to passed flag |
|
145 * |
|
146 * @since 3.0 |
|
147 * @param aXmlSerializer XML serializer |
|
148 * @param aFlag flag if attribute list is default |
|
149 */ |
|
150 void XMLAppendDefaultFlagL( MPEngXMLSerializer& aXmlSerializer, |
|
151 const TBool aFlag ); |
|
152 |
|
153 /** |
|
154 * Copy content of the old descriptor array to the new descriptor array |
|
155 * |
|
156 * @since 3.0 |
|
157 * @param aOldDesArray original descriptor array |
|
158 * @param aNewArray new descriptor array |
|
159 */ |
|
160 void CopyDesArrayL( const MDesC16Array& aOldDesArray, |
|
161 CDesC16Array& aNewArray ); |
|
162 |
|
163 |
|
164 |
|
165 protected: // constructor |
|
166 |
|
167 /** |
|
168 * C++ constructor. |
|
169 */ |
|
170 CPEngAttributeListTransBase( |
|
171 MPEngAttributeListTransactionManager& aAttrListTransManager, |
|
172 CPEngContactListTransactionManager& aCntListTransManager, |
|
173 TPEngWVCspVersion& aCSPVersion, |
|
174 TInt aOperationId ); |
|
175 |
|
176 /** |
|
177 * Symbian constructor. |
|
178 */ |
|
179 void ConstructL(); |
|
180 |
|
181 protected: // Data |
|
182 |
|
183 // OWN: transaction status class |
|
184 CPEngTransactionStatus* iTransactionStatus; |
|
185 |
|
186 /// OWN: Flag if transaction is completed |
|
187 TBool iTransactionCompleted; |
|
188 |
|
189 /// REF: Pointer to the attribute list manager |
|
190 MPEngAttributeListTransactionManager& iAttributeListTransManager; |
|
191 |
|
192 /// REF: Contact list transaction manager |
|
193 CPEngContactListTransactionManager& iCntListTransManager; |
|
194 |
|
195 /// REF: CSP Version |
|
196 TPEngWVCspVersion& iCSPVersion; |
|
197 |
|
198 /// OWN: Operation Id how client called request |
|
199 TInt iOperationId; |
|
200 |
|
201 }; |
|
202 |
|
203 #endif // __CPENGATTRIBUTELISTTRANSBASE_H__ |
|
204 |
|
205 // End of File |
|
206 |