|
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: Server-side sub-session of Accessory Connection Base |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CACCSRVSUBCONNECTIONBASE_H |
|
21 #define CACCSRVSUBCONNECTIONBASE_H |
|
22 |
|
23 // INCLUDES |
|
24 #include "AsyProxyAPI.h" |
|
25 #include "AccSrvSubBase.h" |
|
26 #include <e32base.h> |
|
27 |
|
28 // CONSTANTS |
|
29 |
|
30 // MACROS |
|
31 |
|
32 // DATA TYPES |
|
33 |
|
34 // FUNCTION PROTOTYPES |
|
35 |
|
36 // FORWARD DECLARATIONS |
|
37 class CAccSrvMainSession; |
|
38 class CAccPolObjectCon; |
|
39 |
|
40 // CLASS DECLARATION |
|
41 |
|
42 /** |
|
43 * Accessory Connection Base server-side sub-session implementation. |
|
44 * |
|
45 * AccServer.lib |
|
46 * @since S60 3.1 |
|
47 */ |
|
48 NONSHARABLE_CLASS( CAccSrvSubConnectionBase ) : public CAccSrvSubBase |
|
49 { |
|
50 public: // Constructors and destructor |
|
51 |
|
52 /** |
|
53 * Destructor. |
|
54 */ |
|
55 ~CAccSrvSubConnectionBase(); |
|
56 |
|
57 public: // New functions |
|
58 |
|
59 public: // Functions from base classes |
|
60 |
|
61 /** |
|
62 * From CAccSrvSubBase |
|
63 * Handles received messages from client. Sub classes of this base class |
|
64 * may or may not implement this also. However, if message is not handled |
|
65 * in sub class, it should call this base class to handle it. |
|
66 * @since S60 3.1 |
|
67 * @param aMessage Client request. |
|
68 * @return void |
|
69 */ |
|
70 virtual void DispatchMessageL( const RMessage2& aMessage ); |
|
71 |
|
72 /** |
|
73 * From MQueueObserver. |
|
74 * Called when Queue passes message completion handling to registered observers. |
|
75 * This is meant for GetValue() and SetValue() type of operations. |
|
76 * |
|
77 * @since S60 3.1 |
|
78 * @param aMsgID Message in question. |
|
79 * @param aCmdResponse Value of the operation, used in GetValue() |
|
80 * type of operations. |
|
81 * @param aErrorCode Error Code of the operation. |
|
82 * @param aTrId Transaction Id of the operation. |
|
83 * @return void |
|
84 */ |
|
85 virtual void HandleValueMessageL( TMsgID aMsgID, |
|
86 TAccValueTypeTBool aCmdResponse, |
|
87 TInt aErrorCode, |
|
88 TInt aTrId ); |
|
89 |
|
90 /** |
|
91 * From MQueueObserver. |
|
92 * Called when Queue passes message completion handling to registered observers. |
|
93 * This is meant for GetValue() and SetValue() type of operations. |
|
94 * |
|
95 * @since S60 3.1 |
|
96 * @param aMsgID Message in question. |
|
97 * @param aCmdResponse Value of the operation, used in GetValue() |
|
98 * type of operations. |
|
99 * @param aErrorCode Error Code of the operation. |
|
100 * @param aTrId Transaction Id of the operation. |
|
101 * @return void |
|
102 */ |
|
103 virtual void HandleValueMessageL( TMsgID aMsgID, |
|
104 TAccValueTypeTInt aCmdResponse, |
|
105 TInt aErrorCode, |
|
106 TInt aTrId ); |
|
107 |
|
108 /** |
|
109 * From MQueueObserver. |
|
110 * Called when Queue passes message completion handling to registered observers. |
|
111 * This is meant for GetValue() and SetValue() type of operations. |
|
112 * |
|
113 * @since S60 3.1 |
|
114 * @param aMsgID Message in question. |
|
115 * @param aCmdResponse Value of the operation, used in GetValue() |
|
116 * type of operations. |
|
117 * @param aErrorCode Error Code of the operation. |
|
118 * @param aTrId Transaction Id of the operation. |
|
119 * @return void |
|
120 */ |
|
121 virtual void HandleValueMessageL( TMsgID aMsgID, |
|
122 TDesC8& aCmdResponse, |
|
123 TInt aErrorCode, |
|
124 TInt aTrId ); |
|
125 |
|
126 /** |
|
127 * From MQueueObserver. |
|
128 * Called when Queue passes message completion handling to registered observers. |
|
129 * This is meant for GetValue() and SetValue() type of operations. |
|
130 * |
|
131 * @param aMsgID Message in question. |
|
132 * @param aTrId Transaction Id of the operation. |
|
133 * @param aPtrBuf Value of the operation, used in GetValue() |
|
134 * type of operations. |
|
135 * @param aErrorCode Error Code of the operation. |
|
136 * @return void |
|
137 */ |
|
138 virtual void HandleValueMessageL( TMsgID aMsgID, |
|
139 TInt aTrId, |
|
140 TPtr8* aPtrBuf, |
|
141 TInt aErrorCode ); |
|
142 |
|
143 protected: // New functions |
|
144 |
|
145 /** |
|
146 * C++ default constructor. |
|
147 */ |
|
148 CAccSrvSubConnectionBase( CASYProxyAPI* aSession, |
|
149 CAccSrvConnectionController* aConnectionController, |
|
150 CAccSrvServerModel* aServerModel ); |
|
151 |
|
152 /** |
|
153 * Symbian 2nd phase constructor. |
|
154 */ |
|
155 void ConstructL(); |
|
156 |
|
157 private: // New functions |
|
158 |
|
159 /** |
|
160 * Handles GetSubblockNameArray() client request. |
|
161 * If leave occurs, the client request is completed with that error code. |
|
162 * |
|
163 * @since S60 3.1 |
|
164 * @param aMessage Client request. |
|
165 * @return void |
|
166 */ |
|
167 virtual void GetSubblockNameArrayL( const RMessage2& aMessage ); |
|
168 |
|
169 /** |
|
170 * Handles GetValueL() TBool client request. |
|
171 * If leave occurs, the client request is completed with that error code. |
|
172 * |
|
173 * @since S60 3.1 |
|
174 * @param aMessage Client request. |
|
175 * @return void |
|
176 */ |
|
177 void GetValueTBoolL( const RMessage2& aMessage ); |
|
178 |
|
179 /** |
|
180 * Handles GetValueL() TInt client request. |
|
181 * If leave occurs, the client request is completed with that error code. |
|
182 * |
|
183 * @since S60 3.1 |
|
184 * @param aMessage Client request. |
|
185 * @return void |
|
186 */ |
|
187 void GetValueTIntL( const RMessage2& aMessage ); |
|
188 |
|
189 /** |
|
190 * Handles GetValueL() TDesC8 client request. |
|
191 * If leave occurs, the client request is completed with that error code. |
|
192 * |
|
193 * @since S60 3.1 |
|
194 * @param aMessage Client request. |
|
195 * @return void |
|
196 */ |
|
197 void GetValueTDes8L( const RMessage2& aMessage ); |
|
198 |
|
199 /** |
|
200 * Handles GetValueL() CAccPolObjectBase client request. |
|
201 * If leave occurs, the client request is completed with that error code. |
|
202 * |
|
203 * @param aMessage Client request. |
|
204 * @return void |
|
205 */ |
|
206 void GetValueObjectBaseL( const RMessage2& aMessage ); |
|
207 |
|
208 /** |
|
209 * Stores the value for the name to server model. |
|
210 * |
|
211 * @since S60 3.1 |
|
212 * @param aGenericID Generic ID in question. |
|
213 * @param aNameRecord Capability name which value is stored. |
|
214 * @param aValue Value to be stored. |
|
215 * @return void |
|
216 */ |
|
217 void StoreValueL( const TAccPolGenericID& aGenericID, |
|
218 TAccPolNameRecord& aNameRecord, |
|
219 TInt aValue ); |
|
220 |
|
221 /** |
|
222 * Handles GetValueL() CAccPolObjectBase client request. |
|
223 * If leave occurs, the client request is completed with that error code. |
|
224 * |
|
225 * @param aMessage Client request. |
|
226 * @return void |
|
227 */ |
|
228 void GetObjectValueL( const RMessage2& aMessage ); |
|
229 |
|
230 public: // Data |
|
231 |
|
232 protected: // Data |
|
233 |
|
234 private: // Data |
|
235 |
|
236 // Messages for later completion are stored here |
|
237 // Only one iMessage needed as long as RAccessoryConnectionBase has |
|
238 // only synchronous requests. |
|
239 RMessage2 iMessage; |
|
240 |
|
241 // Data buffer where object container is streamed. |
|
242 CBufFlat* iDataBuf; // Owned |
|
243 |
|
244 public: // Friend classes |
|
245 |
|
246 protected: // Friend classes |
|
247 |
|
248 private: // Friend classes |
|
249 |
|
250 }; |
|
251 |
|
252 #endif // CACCSRVSUBCONNECTIONBASE_H |
|
253 |
|
254 // End of File |