1 /* |
|
2 * Copyright (c) 2002-2010 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 "CSatCommandHandler.h" |
|
25 #include "SatSTypes.h" |
|
26 |
|
27 class CSetupCallRequestHandler; |
|
28 |
|
29 /** |
|
30 * Command handler for SetUpCall command. |
|
31 * |
|
32 * @lib SetUpCallCmd.lib |
|
33 * @since S60 v3.0 |
|
34 */ |
|
35 class CSetUpCallHandler : public CSatCommandHandler |
|
36 { |
|
37 |
|
38 public: |
|
39 |
|
40 static CSetUpCallHandler* NewL( MSatUtils* aUtils ); |
|
41 |
|
42 virtual ~CSetUpCallHandler(); |
|
43 |
|
44 // from base class MSatEventObserver |
|
45 |
|
46 /** |
|
47 * From MSatEventObserver.? |
|
48 * Event notification. |
|
49 * |
|
50 * @param aEvent Identifies the event. |
|
51 */ |
|
52 void Event( TInt aEvent ); |
|
53 |
|
54 // from base class MSatCommand |
|
55 |
|
56 /** |
|
57 * From MSatCommand. |
|
58 * Response from the client |
|
59 * |
|
60 */ |
|
61 void ClientResponse(); |
|
62 |
|
63 /** |
|
64 * Handle the setup call Request Complete. |
|
65 * |
|
66 * @param aErrCode Result of ETelMM Api calling. |
|
67 */ |
|
68 void SetupCallRequestComplete( const TInt aErrCode ); |
|
69 |
|
70 protected: |
|
71 |
|
72 // from base class CActive |
|
73 |
|
74 /** |
|
75 * From CActive |
|
76 * Cancels the usat request. |
|
77 * |
|
78 */ |
|
79 void DoCancel(); |
|
80 |
|
81 // from base class CSatCommandHandler |
|
82 |
|
83 /** |
|
84 * From CSatCommandHandler |
|
85 * Requests the command notification. |
|
86 * |
|
87 * @param aStatus Request status |
|
88 */ |
|
89 void IssueUSATRequest( TRequestStatus& aStatus ); |
|
90 |
|
91 /** |
|
92 * From CSatCommandHandler |
|
93 * Precheck before executing the command. |
|
94 * |
|
95 * @return TBool indicating command is currently allowed. |
|
96 */ |
|
97 TBool CommandAllowed(); |
|
98 |
|
99 /** |
|
100 * From CSatCommandHandler |
|
101 * Need for ui session. |
|
102 * |
|
103 * @return TBool indicating need of ui session. |
|
104 */ |
|
105 TBool NeedUiSession(); |
|
106 |
|
107 /** |
|
108 * From CSatCommandHandler |
|
109 * Called when USAT API notifies that command. |
|
110 * |
|
111 */ |
|
112 void HandleCommand(); |
|
113 |
|
114 /** |
|
115 * From CSatCommandHandler |
|
116 * Indication that UI launching failed. |
|
117 * |
|
118 */ |
|
119 void UiLaunchFailed(); |
|
120 |
|
121 private: |
|
122 |
|
123 CSetUpCallHandler(); |
|
124 |
|
125 void ConstructL(); |
|
126 |
|
127 /** |
|
128 * Performs the request to dial |
|
129 * |
|
130 * @since S60 3.2 |
|
131 */ |
|
132 void DoSetupCall( CSetupCallRequestHandler& aHandler ); |
|
133 |
|
134 /** |
|
135 * Return terminal response filled according to dial result. |
|
136 * |
|
137 * @since S60 3.2 |
|
138 * @param aStatus Dial status from phone. |
|
139 */ |
|
140 void CompleteSetupCallWithStatus( |
|
141 const TInt32 aStatus ); |
|
142 |
|
143 /** |
|
144 * Return terminal response filled according to result. |
|
145 * |
|
146 * @since S60 3.2 |
|
147 * @param aGeneralResult Completion status. |
|
148 */ |
|
149 void CompleteSetupCall( |
|
150 const RSat::TPCmdResult aGeneralResult ); |
|
151 |
|
152 /** |
|
153 * Return terminal response filled according to result. |
|
154 * |
|
155 * @since S60 3.2 |
|
156 * @param aGeneralResult Completion status. |
|
157 * @param aAdditionalInfo Completion status additional info. |
|
158 */ |
|
159 void CompleteSetupCall( |
|
160 const RSat::TPCmdResult aGeneralResult, |
|
161 const TInt16 aAdditionalInfo ); |
|
162 |
|
163 /** |
|
164 * Checks the dialling number string for extended BCD |
|
165 * values. Changes them to correct characters |
|
166 * see ETSI 11.11 10.5.1 |
|
167 * |
|
168 * @param aNumber dialling number string |
|
169 */ |
|
170 void CheckNumber( TDes& aNumber ) const; |
|
171 |
|
172 /** |
|
173 * Create emergency call |
|
174 */ |
|
175 void CreateEmergencyCall( CSetupCallRequestHandler& aHandler ); |
|
176 |
|
177 /** |
|
178 * Check the Param of the setup call |
|
179 */ |
|
180 TBool CheckSetupCallParam(); |
|
181 |
|
182 private: // data |
|
183 |
|
184 /** |
|
185 * SetUpCall command data from SIM. |
|
186 */ |
|
187 RSat::TSetUpCallV1 iSetUpCallData; |
|
188 |
|
189 /** |
|
190 * SetUpCall command package. |
|
191 */ |
|
192 RSat::TSetUpCallV1Pckg iSetUpCallPckg; |
|
193 |
|
194 /** |
|
195 * SetUpCall response data from client. |
|
196 */ |
|
197 RSat::TSetUpCallRspV2 iSetUpCallRsp; |
|
198 |
|
199 /** |
|
200 * SetUpCall response package |
|
201 */ |
|
202 RSat::TSetUpCallRspV2Pckg iSetUpCallRspPckg; |
|
203 |
|
204 /** |
|
205 * Query command data. |
|
206 */ |
|
207 TSatQueryV1 iQueryData; |
|
208 |
|
209 /** |
|
210 * Query package. |
|
211 */ |
|
212 TSatQueryV1Pckg iQueryPckg; |
|
213 |
|
214 /** |
|
215 * Query response. |
|
216 */ |
|
217 TSatQueryRspV1 iQueryRsp; |
|
218 |
|
219 /** |
|
220 * Query rsp package. |
|
221 */ |
|
222 TSatQueryRspV1Pckg iQueryRspPckg; |
|
223 |
|
224 /** |
|
225 * Handing the asynchronous request |
|
226 */ |
|
227 CSetupCallRequestHandler* iRequestHandler; |
|
228 |
|
229 /** |
|
230 * Current call is an emergency call. |
|
231 */ |
|
232 TBool iEmergencyCall; |
|
233 |
|
234 /** |
|
235 * Indicates if call control is active |
|
236 */ |
|
237 TBool iCallControlActive; |
|
238 |
|
239 /** |
|
240 * wait scheduler |
|
241 */ |
|
242 CActiveSchedulerWait iWait; |
|
243 |
|
244 /** |
|
245 * Boolean indicating is command pending for CallControl completion |
|
246 */ |
|
247 TBool iPCmdPending; |
|
248 |
|
249 /** |
|
250 * Flag to signal that command has icon data |
|
251 * To be removed when icons are allowed in this command |
|
252 */ |
|
253 TBool iIconCommand; |
|
254 |
|
255 }; |
|
256 |
|
257 #endif // CSETUPCALLHANDLER_H |
|