|
1 /* |
|
2 * Copyright (c) 2002-2008 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: SetUpCall command handler |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CSETUPCALLHANDLER_H |
|
20 #define CSETUPCALLHANDLER_H |
|
21 |
|
22 #include <etelsat.h> |
|
23 |
|
24 #include <AiwServiceHandler.h> |
|
25 #include <CPhCltEmergencyCall.h> |
|
26 #include <MPhCltEmergencyCallObserver.h> |
|
27 |
|
28 #include "CSatCommandHandler.h" |
|
29 #include "SatSTypes.h" |
|
30 |
|
31 /** |
|
32 * Command handler for SetUpCall command. |
|
33 * |
|
34 * @lib SetUpCallCmd.lib |
|
35 * @since S60 v3.0 |
|
36 */ |
|
37 class CSetUpCallHandler : public CSatCommandHandler, |
|
38 public MAiwNotifyCallback, |
|
39 public MPhCltEmergencyCallObserver |
|
40 { |
|
41 |
|
42 public: |
|
43 |
|
44 static CSetUpCallHandler* NewL( MSatUtils* aUtils ); |
|
45 |
|
46 virtual ~CSetUpCallHandler(); |
|
47 |
|
48 // from base class MSatEventObserver |
|
49 |
|
50 /** |
|
51 * From MSatEventObserver.? |
|
52 * Event notification. |
|
53 * |
|
54 * @param aEvent Identifies the event. |
|
55 */ |
|
56 void Event( TInt aEvent ); |
|
57 |
|
58 // from base class MSatCommand |
|
59 |
|
60 /** |
|
61 * From MSatCommand. |
|
62 * Response from the client |
|
63 * |
|
64 */ |
|
65 void ClientResponse(); |
|
66 |
|
67 protected: |
|
68 |
|
69 // from base class CActive |
|
70 |
|
71 /** |
|
72 * From CActive |
|
73 * Cancels the usat request. |
|
74 * |
|
75 */ |
|
76 void DoCancel(); |
|
77 |
|
78 // from base class CSatCommandHandler |
|
79 |
|
80 /** |
|
81 * From CSatCommandHandler |
|
82 * Requests the command notification. |
|
83 * |
|
84 * @param aStatus Request status |
|
85 */ |
|
86 void IssueUSATRequest( TRequestStatus& aStatus ); |
|
87 |
|
88 /** |
|
89 * From CSatCommandHandler |
|
90 * Precheck before executing the command. |
|
91 * |
|
92 * @return TBool indicating command is currently allowed. |
|
93 */ |
|
94 TBool CommandAllowed(); |
|
95 |
|
96 /** |
|
97 * From CSatCommandHandler |
|
98 * Need for ui session. |
|
99 * |
|
100 * @return TBool indicating need of ui session. |
|
101 */ |
|
102 TBool NeedUiSession(); |
|
103 |
|
104 /** |
|
105 * From CSatCommandHandler |
|
106 * Called when USAT API notifies that command. |
|
107 * |
|
108 */ |
|
109 void HandleCommand(); |
|
110 |
|
111 /** |
|
112 * From CSatCommandHandler |
|
113 * Indication that UI launching failed. |
|
114 * |
|
115 */ |
|
116 void UiLaunchFailed(); |
|
117 |
|
118 // from base class MAiwNotifyCallback |
|
119 |
|
120 /** |
|
121 * From MAiwNotifyCallback |
|
122 * Called when dial request is completed. |
|
123 * |
|
124 * @param aCmdId Identifier of requested Aiw operation. |
|
125 * @param aEventId Identifier of status event. |
|
126 * @param aEventParamList Parameters of status event. |
|
127 * @param aInParamList Parameters of Aiw operation. |
|
128 */ |
|
129 TInt HandleNotifyL( |
|
130 const TInt aCmdId, |
|
131 const TInt aEventId, |
|
132 CAiwGenericParamList& aEventParamList, |
|
133 const CAiwGenericParamList& aInParamList ); |
|
134 |
|
135 // from base class MPhCltEmergencyCallObserver |
|
136 |
|
137 /** |
|
138 * From MPhCltEmergencyCallObserver |
|
139 * Called when emergency dial request is completed. |
|
140 * |
|
141 * @param aStatus Non zero value means failure. |
|
142 */ |
|
143 void HandleEmergencyDialL( const TInt aStatus ); |
|
144 |
|
145 private: |
|
146 |
|
147 CSetUpCallHandler(); |
|
148 |
|
149 void ConstructL(); |
|
150 |
|
151 /** |
|
152 * Performs the request to dial |
|
153 * |
|
154 * @since S60 3.2 |
|
155 */ |
|
156 void DoSetupCallL(); |
|
157 |
|
158 /** |
|
159 * Return terminal response filled according to dial result. |
|
160 * |
|
161 * @since S60 3.2 |
|
162 * @param aStatus Dial status from phone. |
|
163 */ |
|
164 void CompleteSetupCallWithStatus( |
|
165 const TInt32 aStatus ); |
|
166 |
|
167 /** |
|
168 * Return terminal response filled according to result. |
|
169 * |
|
170 * @since S60 3.2 |
|
171 * @param aGeneralResult Completion status. |
|
172 */ |
|
173 void CompleteSetupCall( |
|
174 const RSat::TPCmdResult aGeneralResult ); |
|
175 |
|
176 /** |
|
177 * Return terminal response filled according to result. |
|
178 * |
|
179 * @since S60 3.2 |
|
180 * @param aGeneralResult Completion status. |
|
181 * @param aAdditionalInfo Completion status additional info. |
|
182 */ |
|
183 void CompleteSetupCall( |
|
184 const RSat::TPCmdResult aGeneralResult, |
|
185 const TInt16 aAdditionalInfo ); |
|
186 |
|
187 /** |
|
188 * Checks the dialling number string for extended BCD |
|
189 * values. Changes them to correct characters |
|
190 * see ETSI 11.11 10.5.1 |
|
191 * |
|
192 * @param aNumber dialling number string |
|
193 */ |
|
194 void CheckNumber( TDes& aNumber ) const; |
|
195 |
|
196 /** |
|
197 * Converts a TCCP error to the corresponding symbian error. |
|
198 * |
|
199 * @param aTccpError A TCCP error number to be converted into |
|
200 * a symbian one. |
|
201 * |
|
202 * @return The corresponding symbian error from TCCP error. |
|
203 */ |
|
204 TInt TccpErrorToSymbianError( const TInt aTccpError ) const; |
|
205 |
|
206 /** |
|
207 * Create emergency call |
|
208 */ |
|
209 void CreateEmergencyCallL(); |
|
210 |
|
211 private: // data |
|
212 |
|
213 /** |
|
214 * SetUpCall command data from SIM. |
|
215 */ |
|
216 RSat::TSetUpCallV1 iSetUpCallData; |
|
217 |
|
218 /** |
|
219 * SetUpCall command package. |
|
220 */ |
|
221 RSat::TSetUpCallV1Pckg iSetUpCallPckg; |
|
222 |
|
223 /** |
|
224 * SetUpCall response data from client. |
|
225 */ |
|
226 RSat::TSetUpCallRspV2 iSetUpCallRsp; |
|
227 |
|
228 /** |
|
229 * SetUpCall response package |
|
230 */ |
|
231 RSat::TSetUpCallRspV2Pckg iSetUpCallRspPckg; |
|
232 |
|
233 /** |
|
234 * Query command data. |
|
235 */ |
|
236 TSatQueryV1 iQueryData; |
|
237 |
|
238 /** |
|
239 * Query package. |
|
240 */ |
|
241 TSatQueryV1Pckg iQueryPckg; |
|
242 |
|
243 /** |
|
244 * Query response. |
|
245 */ |
|
246 TSatQueryRspV1 iQueryRsp; |
|
247 |
|
248 /** |
|
249 * Query rsp package. |
|
250 */ |
|
251 TSatQueryRspV1Pckg iQueryRspPckg; |
|
252 |
|
253 /** |
|
254 * Service handler to make normal call. |
|
255 */ |
|
256 CAiwServiceHandler* iServiceHandler; |
|
257 |
|
258 /** |
|
259 * Utility to handle emergency calls. |
|
260 */ |
|
261 CPhCltEmergencyCall* iEmergencyCallApi; |
|
262 |
|
263 /** |
|
264 * Current call is an emergency call. |
|
265 */ |
|
266 TBool iEmergencyCall; |
|
267 |
|
268 /** |
|
269 * Indicates if call control is active |
|
270 */ |
|
271 TBool iCallControlActive; |
|
272 |
|
273 /** |
|
274 * Dial completion status |
|
275 */ |
|
276 TInt iSetUpCallStatus; |
|
277 |
|
278 /** |
|
279 * wait scheduler |
|
280 */ |
|
281 CActiveSchedulerWait iWait; |
|
282 |
|
283 /** |
|
284 * Boolean indicating is command pending for CallControl completion |
|
285 */ |
|
286 TBool iPCmdPending; |
|
287 |
|
288 /** |
|
289 * Flag to signal that command has icon data |
|
290 * To be removed when icons are allowed in this command |
|
291 */ |
|
292 TBool iIconCommand; |
|
293 |
|
294 }; |
|
295 |
|
296 #endif // CSETUPCALLHANDLER_H |