|
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: Authorization in transaction handler. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __CPENGAUTHORIZATIONTRANSACTIONIN_H__ |
|
19 #define __CPENGAUTHORIZATIONTRANSACTIONIN_H__ |
|
20 |
|
21 // INCLUDES |
|
22 #include <e32base.h> |
|
23 #include "MPEngIncomingTransactionHandler.h" |
|
24 |
|
25 // CPS Version |
|
26 #include "PEngWVCspVersion.h" |
|
27 |
|
28 |
|
29 // FORWARD DECLARATION |
|
30 class MPEngAuthorizationEngine; |
|
31 class MPEngPresenceAttrManager; |
|
32 class CPEngAuthorizationResponse; |
|
33 class CPEngAuthorizationRequest; |
|
34 class MPEngXMLParser; |
|
35 |
|
36 // CLASS DECLARATION |
|
37 /** |
|
38 * Authorization in transaction handler. |
|
39 * |
|
40 * @lib PEngListLib2 |
|
41 * @since 3.0 |
|
42 */ |
|
43 class CPEngAuthorizationTransactionIn : public CBase, |
|
44 public MPEngIncomingTransactionHandler |
|
45 { |
|
46 public: // Enumerations |
|
47 |
|
48 /** |
|
49 * In authorization sub types. |
|
50 */ |
|
51 enum TPEngAuthorizationTransType |
|
52 { |
|
53 EPEngAuthorizationRequest = 1, |
|
54 EPEngAuthorizationResponse = 2 |
|
55 }; |
|
56 |
|
57 |
|
58 public: |
|
59 |
|
60 /** |
|
61 * Two-phased constructor. |
|
62 */ |
|
63 static CPEngAuthorizationTransactionIn* NewL( |
|
64 MPEngAuthorizationEngine& aAuthEngine, |
|
65 MPEngPresenceAttrManager& aAttrManager, |
|
66 MPEngXMLParser& aXMLParser, |
|
67 const TDesC8& aParseBlock, |
|
68 TPEngAuthorizationTransType aType ); |
|
69 |
|
70 /** |
|
71 * Two-phased constructor. |
|
72 */ |
|
73 static CPEngAuthorizationTransactionIn* NewLC( |
|
74 MPEngAuthorizationEngine& aAuthEngine, |
|
75 MPEngPresenceAttrManager& aAttrManager, |
|
76 MPEngXMLParser& aXMLParser, |
|
77 const TDesC8& aParseBlock, |
|
78 TPEngAuthorizationTransType aType ); |
|
79 |
|
80 /** |
|
81 * Destructor. |
|
82 */ |
|
83 virtual ~CPEngAuthorizationTransactionIn(); |
|
84 |
|
85 |
|
86 public: // From MPEngIncomingTransactionHandler |
|
87 |
|
88 /** |
|
89 * Process the incoming request. |
|
90 * @see <MPEngIncomingTransactionHandler.h> |
|
91 */ |
|
92 void ProcessRequestL( const TDesC8& aRequest, |
|
93 TRequestStatus& aStatus ); |
|
94 |
|
95 /** |
|
96 * Cancels asynchronous processing of the request |
|
97 * @see <MPEngIncomingTransactionHandler.h> |
|
98 */ |
|
99 void CancelProcessing(); |
|
100 |
|
101 private: // new helpers |
|
102 |
|
103 /** |
|
104 * Parse User id from the message |
|
105 * |
|
106 * @since 3.0 |
|
107 * @return user id buffer |
|
108 */ |
|
109 HBufC* ParseUserIdLC(); |
|
110 |
|
111 |
|
112 /** |
|
113 * Parse Attribute list |
|
114 * |
|
115 * @since 3.0 |
|
116 * @param aAuthItem authorization item to add attributes |
|
117 * @param aAddFunc function called on item to add attributes |
|
118 */ |
|
119 template <class AuthItem> |
|
120 void ParseAttrListL( AuthItem& aAuthItem, void ( AuthItem::* aAddFunc )( TUint32 ) ); |
|
121 |
|
122 |
|
123 /** |
|
124 * Parse authorization status |
|
125 * |
|
126 * @since 3.0 |
|
127 * @param aAuthStatus authorization status |
|
128 */ |
|
129 void ParseAuthorizationStatusL( CPEngAuthorizationResponse& aAuthStatus ); |
|
130 |
|
131 |
|
132 private: // Constructors |
|
133 |
|
134 /** |
|
135 * C++ constructor. |
|
136 */ |
|
137 CPEngAuthorizationTransactionIn( |
|
138 MPEngAuthorizationEngine& aAuthEngine, |
|
139 MPEngPresenceAttrManager& aAttrManager, |
|
140 MPEngXMLParser& aXMLParser, |
|
141 const TDesC8& aParseBlock, |
|
142 TPEngAuthorizationTransType aType ); |
|
143 |
|
144 |
|
145 /** |
|
146 * Symbian constructor. |
|
147 */ |
|
148 void ConstructL(); |
|
149 |
|
150 |
|
151 private: // Data |
|
152 |
|
153 /// REF: Authorization engine |
|
154 MPEngAuthorizationEngine& iAuthEngine; |
|
155 |
|
156 /// REF: Attribute manager |
|
157 MPEngPresenceAttrManager& iAttributeManager; |
|
158 |
|
159 /// REF: XML Parser |
|
160 MPEngXMLParser& iXMLParser; |
|
161 |
|
162 /// REF: Block to parse |
|
163 TPtrC8 iParseBlock; |
|
164 |
|
165 /// OWN: Type of response to parse |
|
166 TPEngAuthorizationTransType iResponseType; |
|
167 |
|
168 }; |
|
169 |
|
170 #endif // __CPENGAUTHORIZATIONTRANSACTIONIN_H__ |
|
171 |
|
172 |
|
173 |
|
174 |
|
175 // End of File |
|
176 |