|
1 /* |
|
2 * Copyright (c) 2004 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: Attribute fetch handler. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef CPENGATTRIBUTEFETCHHANDLER_H__ |
|
19 #define CPENGATTRIBUTEFETCHHANDLER_H__ |
|
20 |
|
21 |
|
22 // INCLUDES |
|
23 #include <E32base.h> |
|
24 #include "MPEngOutgoingTransactionHandler.h" |
|
25 #include "PEngWVCspVersion.h" |
|
26 |
|
27 |
|
28 |
|
29 //FORWARD DECLARATION |
|
30 class CPEngTransactionStatus; |
|
31 class MPEngPresenceAttrManager; |
|
32 class MPEngPresenceAttrModel2; |
|
33 class MPEngAttrFetchProcessor; |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 // CLASS DECLARATION |
|
39 |
|
40 /** |
|
41 * Attribute fetcher. |
|
42 * |
|
43 * Handles presence attribute fetch XML request |
|
44 * generation and response decoding. |
|
45 * |
|
46 * @lib PEngAttrLib |
|
47 * @since 3.0 |
|
48 */ |
|
49 NONSHARABLE_CLASS( CPEngAttributeFetchHandler ) : public CActive, |
|
50 public MPEngOutgoingTransactionHandler |
|
51 { |
|
52 public: // Constructors and destructor |
|
53 |
|
54 /** |
|
55 * Two-phased constructor. |
|
56 */ |
|
57 static CPEngAttributeFetchHandler* NewLC( MPEngPresenceAttrManager& aAttrManager, |
|
58 const TDesC& aDomain, |
|
59 const TDesC16& aData, |
|
60 TInt aTransactionOperation, |
|
61 TPEngWVCspVersion aCspVersion ); |
|
62 |
|
63 |
|
64 /** |
|
65 * Destructor. |
|
66 */ |
|
67 virtual ~CPEngAttributeFetchHandler(); |
|
68 |
|
69 |
|
70 |
|
71 |
|
72 private: //Constructors |
|
73 |
|
74 /** |
|
75 * C++ default constructor. |
|
76 */ |
|
77 CPEngAttributeFetchHandler( MPEngPresenceAttrManager& aAttrManager, |
|
78 TInt aTransactionOperation ); |
|
79 |
|
80 /** |
|
81 * By default Symbian 2nd phase constructor is private. |
|
82 */ |
|
83 void ConstructL( const TDesC& aDomain, |
|
84 TPEngWVCspVersion aCspVersion, |
|
85 const TDesC16& aData ); |
|
86 |
|
87 |
|
88 |
|
89 public: // Functions from MPEngOutgoingTransactionHandler |
|
90 |
|
91 /** |
|
92 * From MPEngOutgoingTransactionHandler |
|
93 * |
|
94 * @since 3.0 |
|
95 */ |
|
96 void RequestL( TDes8& aSendBuffer ); |
|
97 |
|
98 void LastRunningTransactionHandler(); |
|
99 |
|
100 void ProcessResponseL( const TDesC8& aResponse, TRequestStatus& aStatus ); |
|
101 void CancelProcessing(); |
|
102 |
|
103 void NewTransactionHandlersL( RPointerArray<MPEngOutgoingTransactionHandler>& aHandlers ); |
|
104 |
|
105 TBool TransactionCompleted(); |
|
106 CPEngTransactionStatus* TransactionResult(); |
|
107 |
|
108 void ReleaseHandler(); |
|
109 |
|
110 |
|
111 |
|
112 protected: //from CActive |
|
113 |
|
114 void RunL(); |
|
115 TInt RunError( TInt aError ); |
|
116 void DoCancel(); |
|
117 |
|
118 |
|
119 |
|
120 private: //Request helpers |
|
121 |
|
122 |
|
123 /** |
|
124 * Issues new active object run round. |
|
125 * |
|
126 * @since 3.0 |
|
127 */ |
|
128 void IssueNewRound(); |
|
129 |
|
130 |
|
131 private: // Data |
|
132 |
|
133 |
|
134 //REF: Attribute Manager |
|
135 MPEngPresenceAttrManager& iAttributeManager; |
|
136 |
|
137 //OWN: Operation id |
|
138 const TInt iTransactionOperation; |
|
139 |
|
140 //OWN: Fetch processor |
|
141 MPEngAttrFetchProcessor* iFetchedProcessor; |
|
142 |
|
143 //OWN: Decoded attribute models |
|
144 RPointerArray< MPEngPresenceAttrModel2 > iResultModels; |
|
145 |
|
146 //OWN: Fetcher transaction status |
|
147 CPEngTransactionStatus* iResultStatus; |
|
148 |
|
149 //REF: Status to complete |
|
150 TRequestStatus* iRequest; |
|
151 |
|
152 }; |
|
153 |
|
154 #endif // CPENGATTRIBUTEFETCHHANDLER_H__ |
|
155 |
|
156 // End of File |
|
157 |