|
1 /* |
|
2 * Copyright (c) 2002-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: ASY Proxy Handler |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CACCSRVASYPROXYHANDLER_H |
|
21 #define CACCSRVASYPROXYHANDLER_H |
|
22 |
|
23 // INCLUDE FILES |
|
24 #include "AccSrvHandlerBase.h" |
|
25 #include "AccSrvNotificationQueue.h" |
|
26 #include <AsyCmdTypes.h> |
|
27 |
|
28 // CONSTANTS |
|
29 |
|
30 // MACROS |
|
31 |
|
32 // DATA TYPES |
|
33 |
|
34 // FUNCTION PROTOTYPES |
|
35 |
|
36 // FORWARD DECLARATIONS |
|
37 class CAccSrvConnectionController; |
|
38 class CAccPolAccessoryPolicy; |
|
39 |
|
40 // CLASS DECLARATION |
|
41 |
|
42 /** |
|
43 * ASY transaction related tasks are handled here. |
|
44 * |
|
45 * @lib AccServer.lib |
|
46 * @since S60 3.1 |
|
47 */ |
|
48 NONSHARABLE_CLASS( CAccSrvASYProxyHandler ) |
|
49 { |
|
50 public: // Constructors and destructor |
|
51 |
|
52 /** |
|
53 * Two-phased constructor. |
|
54 */ |
|
55 static CAccSrvASYProxyHandler* NewL( CAccSrvConnectionController* aConnectionController ); |
|
56 |
|
57 /** |
|
58 * Destructor. |
|
59 */ |
|
60 virtual ~CAccSrvASYProxyHandler(); |
|
61 |
|
62 public: // New functions |
|
63 |
|
64 /** |
|
65 * Starts command handling towards ASY. |
|
66 * @since S60 3.1 |
|
67 * @param aCmdId Defines the ASY command in question. |
|
68 * @param aASYCommand Data for ASY command. |
|
69 * @param aPtrBuf Pointer to CBufFlat buffer where CAccPolObjectCon object |
|
70 * is externalized to. |
|
71 * @return Transaction ID assigned to this operation. |
|
72 */ |
|
73 TInt HandleASYCommsL( TProcessCmdId aCmdId, |
|
74 TASYCommandParamRecord& aASYCommand, |
|
75 TPtr8* aPtrBuf=NULL ); |
|
76 |
|
77 /** |
|
78 * Removes data related to transaction towards ASY. |
|
79 * Called when response to ASY request is received. |
|
80 * |
|
81 * @since S60 3.1 |
|
82 * @param aTransactionID Transaction in question. |
|
83 * @return void |
|
84 * @see StoreTransactionID() |
|
85 */ |
|
86 void RemoveTransactionID( TInt aTransactionID ); |
|
87 |
|
88 public: // Functions from base classes |
|
89 |
|
90 protected: // New functions |
|
91 |
|
92 protected: // Functions from base classes |
|
93 |
|
94 private: |
|
95 |
|
96 /** |
|
97 * Constructor with notify handling. |
|
98 */ |
|
99 CAccSrvASYProxyHandler( CAccSrvConnectionController* aConnectionController ); |
|
100 |
|
101 /** |
|
102 * By default Symbian 2nd phase constructor is private. |
|
103 */ |
|
104 void ConstructL(); |
|
105 |
|
106 struct TAccSrvTrIDMatchingRecord |
|
107 { |
|
108 TInt iUniqueID;//Unique DBID of the Generic ID |
|
109 TAccPolNameRecord iNameRecord; |
|
110 TInt64 iCommand; |
|
111 TInt iTransactionID; |
|
112 }; |
|
113 |
|
114 /** |
|
115 * Stores data related to transaction towards ASY. |
|
116 * Used internally to filter ASY commands. |
|
117 * |
|
118 * @since S60 3.1 |
|
119 * @param aCmdId Defines the ASY command in question. |
|
120 * @param aASYCommand Data for ASY command. |
|
121 * @param aPtrBuf Pointer to CBufFlat buffer where CAccPolObjectCon object |
|
122 * is externalized to. |
|
123 * @return Transaction ID assigned to this operation. |
|
124 * @see RemoveTransactionID |
|
125 */ |
|
126 TInt StoreTransactionID( TProcessCmdId aCmdId, |
|
127 TASYCommandParamRecord& aASYCommand, |
|
128 TPtr8* aPtrBuf ); |
|
129 |
|
130 /** |
|
131 * Generate a new unique transaction id for ASY transaction handling. |
|
132 * |
|
133 * @since S60 3.1 |
|
134 * @return New transaction id. |
|
135 */ |
|
136 TInt GenerateNewTransactionID(); |
|
137 |
|
138 |
|
139 public: // Data |
|
140 |
|
141 protected: // Data |
|
142 |
|
143 private: //Data |
|
144 |
|
145 //Handle to Connection Controller |
|
146 CAccSrvConnectionController* iConnectionController; //not owned |
|
147 |
|
148 //Ongoing transactions towards ASY are stored here to be able |
|
149 //to use existing Transaction ID for filtered ASY commands |
|
150 RArray<TAccSrvTrIDMatchingRecord> iOngoingTransactions; |
|
151 |
|
152 //Transaction id for ASY communication |
|
153 TInt iTransactionId; |
|
154 |
|
155 public: // Friend classes |
|
156 |
|
157 protected: // Friend classes |
|
158 |
|
159 private: // Friend classes |
|
160 |
|
161 }; |
|
162 |
|
163 #endif // CACCSRVASYPROXYHANDLER_H |
|
164 |
|
165 // End of File |