33
|
1 |
/*
|
48
|
2 |
* Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies).
|
33
|
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: SendUssd command handler
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#ifndef CSENDUSSDHANDLER_H
|
|
20 |
#define CSENDUSSDHANDLER_H
|
|
21 |
|
|
22 |
#include <etelsat.h>
|
|
23 |
|
|
24 |
#include "CSatCommandHandler.h"
|
|
25 |
#include "SatSTypes.h"
|
|
26 |
|
|
27 |
class MSatUtils;
|
|
28 |
class CPhCltUssdSatClient;
|
|
29 |
|
|
30 |
/**
|
|
31 |
* Command handler for SendUssd command.
|
|
32 |
*
|
|
33 |
* @lib SendUssd.lib
|
|
34 |
* @since S60 v3.0
|
|
35 |
*/
|
|
36 |
class CSendUssdHandler : public CSatCommandHandler
|
|
37 |
{
|
|
38 |
|
|
39 |
public:
|
|
40 |
|
|
41 |
static CSendUssdHandler* NewL( MSatUtils* aUtils );
|
|
42 |
|
|
43 |
virtual ~CSendUssdHandler();
|
|
44 |
|
|
45 |
// from base class MSatCommand
|
|
46 |
|
|
47 |
/**
|
|
48 |
* From MSatCommand.
|
|
49 |
* Response from the client
|
|
50 |
*
|
|
51 |
*/
|
|
52 |
void ClientResponse();
|
|
53 |
|
|
54 |
// from base class CSatCommandHandler
|
|
55 |
|
|
56 |
/**
|
|
57 |
* From CSatCommandHandler
|
|
58 |
* Overrides the default implementation.
|
|
59 |
*
|
|
60 |
* @param aEvent Identifies the event.
|
|
61 |
*/
|
|
62 |
void Event( TInt aEvent );
|
|
63 |
|
|
64 |
protected:
|
|
65 |
|
|
66 |
// from base class CActive
|
|
67 |
|
|
68 |
/**
|
|
69 |
* From CActive
|
|
70 |
* Cancels the usat request.
|
|
71 |
*
|
|
72 |
*/
|
|
73 |
void DoCancel();
|
|
74 |
|
|
75 |
// from base class CSatCommandHandler
|
|
76 |
|
|
77 |
/**
|
|
78 |
* From CSatCommandHandler
|
|
79 |
* Requests the command notification.
|
|
80 |
*
|
|
81 |
* @param aStatus Request status
|
|
82 |
*/
|
|
83 |
void IssueUSATRequest( TRequestStatus& aStatus );
|
|
84 |
|
|
85 |
/**
|
|
86 |
* From CSatCommandHandler
|
|
87 |
* Precheck before executing the command.
|
|
88 |
*
|
|
89 |
* @return TBool indicating command is currently allowed.
|
|
90 |
*/
|
|
91 |
TBool CommandAllowed();
|
|
92 |
|
|
93 |
/**
|
|
94 |
* From CSatCommandHandler
|
|
95 |
* Need for ui session.
|
|
96 |
*
|
|
97 |
* @return TBool indicating need of ui session.
|
|
98 |
*/
|
|
99 |
TBool NeedUiSession();
|
|
100 |
|
|
101 |
/**
|
|
102 |
* From CSatCommandHandler
|
|
103 |
* Called when USAT API notifies that command.
|
|
104 |
*
|
|
105 |
*/
|
|
106 |
void HandleCommand();
|
|
107 |
|
|
108 |
/**
|
|
109 |
* From CSatCommandHandler.
|
|
110 |
* Indicates the failure of launching ui client
|
|
111 |
*
|
|
112 |
*/
|
|
113 |
void UiLaunchFailed();
|
|
114 |
|
|
115 |
private:
|
|
116 |
|
|
117 |
CSendUssdHandler();
|
|
118 |
|
|
119 |
/**
|
|
120 |
* Handles the Ussd string sending
|
|
121 |
*
|
|
122 |
*/
|
|
123 |
void SendUssdString();
|
|
124 |
|
|
125 |
/**
|
|
126 |
* Handles the Ussd string sending
|
|
127 |
*
|
|
128 |
* @param aSendMessage The USSD string to be sent
|
|
129 |
* @param aSendDcs Data coding scheme of the USSD string
|
|
130 |
* @param aReceiveMessage Response message from NW
|
|
131 |
* @param aSendCompletedFirst Indicates is this function completed
|
|
132 |
* before response
|
|
133 |
* @param aReceivedDcs Data coding scheme of the received USSD string
|
|
134 |
*/
|
|
135 |
void SendUssdStringL(
|
|
136 |
const TDesC& aSendMessage,
|
|
137 |
const TUint8 aSendDcs,
|
|
138 |
TDes& aReceiveMessage,
|
|
139 |
TBool& aSendCompletedFirst,
|
|
140 |
TUint8& aReceivedDcs );
|
|
141 |
|
|
142 |
/**
|
48
|
143 |
* Show the ussd response note.
|
|
144 |
*
|
|
145 |
* @param aText The USSD response string to be shown.
|
|
146 |
*/
|
|
147 |
void ShowUssdResponseNoteL( const TDesC& aText );
|
|
148 |
|
|
149 |
/**
|
33
|
150 |
* Handles the result of Ussd sending
|
|
151 |
*
|
|
152 |
* @param aError Result of Ussd sending
|
|
153 |
*/
|
|
154 |
void HandleSendUssdResult( TInt aError );
|
|
155 |
|
|
156 |
/**
|
|
157 |
* Converts reveived Dcs to correct format
|
|
158 |
*
|
|
159 |
* @param aReceivedDcs Received Dcs to convert
|
|
160 |
*/
|
|
161 |
void ConvertReceivedDcs( TUint8& aReceivedDcs ) const;
|
|
162 |
|
|
163 |
/**
|
|
164 |
* Sends terminal response. Makes sure that terminal response
|
|
165 |
* is not send more that once / command.
|
|
166 |
*
|
|
167 |
*/
|
|
168 |
void SendTerminalResponse();
|
|
169 |
|
|
170 |
/**
|
|
171 |
* Checks is the command transparent or not
|
|
172 |
*
|
|
173 |
*/
|
|
174 |
TBool TransparentUssdSending();
|
48
|
175 |
|
|
176 |
/**
|
|
177 |
* Check whether the ussd sending result is displayed
|
|
178 |
* @return 1 indicating the result is displayed
|
|
179 |
*/
|
|
180 |
TInt SatDisplayUssdResultL();
|
33
|
181 |
|
|
182 |
private: // data
|
|
183 |
|
|
184 |
/**
|
|
185 |
* SendUssd command data.
|
|
186 |
*/
|
|
187 |
RSat::TSendUssdV1 iSendUssdData;
|
|
188 |
|
|
189 |
/**
|
|
190 |
* SendUssd command package.
|
|
191 |
*/
|
|
192 |
RSat::TSendUssdV1Pckg iSendUssdPckg;
|
|
193 |
|
|
194 |
/**
|
|
195 |
* Response from client
|
|
196 |
*/
|
|
197 |
RSat::TSendUssdRspV1 iSendUssdRsp;
|
|
198 |
|
|
199 |
/**
|
|
200 |
* Response package.
|
|
201 |
*/
|
|
202 |
RSat::TSendUssdRspV1Pckg iSendUssdRspPckg;
|
|
203 |
|
|
204 |
/**
|
|
205 |
* UI query and notification data:
|
|
206 |
*/
|
|
207 |
TBool iNeedUiSession;
|
|
208 |
|
|
209 |
/**
|
|
210 |
* Indicates the query status
|
|
211 |
*/
|
|
212 |
TBool iQueryOn;
|
|
213 |
|
|
214 |
/**
|
|
215 |
* Indicates is AlphaId present
|
|
216 |
*/
|
|
217 |
TBool iAlphaIdPresent;
|
|
218 |
|
|
219 |
/**
|
|
220 |
* Query command data.
|
|
221 |
*/
|
|
222 |
TSatQueryV1 iQueryData;
|
|
223 |
|
|
224 |
/**
|
|
225 |
* Query package.
|
|
226 |
*/
|
|
227 |
TSatQueryV1Pckg iQueryPckg;
|
|
228 |
|
|
229 |
/**
|
|
230 |
* Query response.
|
|
231 |
*/
|
|
232 |
TSatQueryRspV1 iQueryRsp;
|
|
233 |
|
|
234 |
/**
|
|
235 |
* Query rsp package.
|
|
236 |
*/
|
|
237 |
TSatQueryRspV1Pckg iQueryRspPckg;
|
|
238 |
|
|
239 |
/**
|
|
240 |
* Notification send data
|
|
241 |
*/
|
|
242 |
TSatNotificationV1 iNotificationData;
|
|
243 |
|
|
244 |
/**
|
|
245 |
* Notification package
|
|
246 |
*/
|
|
247 |
TSatNotificationV1Pckg iNotificationDataPckg;
|
|
248 |
|
|
249 |
/**
|
|
250 |
* Notification Response data
|
|
251 |
*/
|
|
252 |
TSatNotificationRspV1 iNotificationRsp;
|
|
253 |
|
|
254 |
/**
|
|
255 |
* Notification Response package
|
|
256 |
*/
|
|
257 |
TSatNotificationRspV1Pckg iNotificationRspPckg;
|
|
258 |
|
|
259 |
/**
|
|
260 |
* Indicates is notification sent
|
|
261 |
*/
|
|
262 |
TBool iNotificationSent;
|
|
263 |
|
|
264 |
/**
|
|
265 |
* Indicates is terminal response sent
|
|
266 |
*/
|
|
267 |
TBool iTerminalRespSent;
|
|
268 |
|
|
269 |
/**
|
|
270 |
* Ussd sender
|
|
271 |
*/
|
|
272 |
CPhCltUssdSatClient* iUssdClient;
|
|
273 |
|
|
274 |
/**
|
|
275 |
* Blocks the USSD send until user has respond
|
|
276 |
*/
|
|
277 |
CActiveSchedulerWait iWait;
|
|
278 |
|
|
279 |
/**
|
|
280 |
* Indicates wether user accepted or rejected
|
|
281 |
*/
|
|
282 |
TBool iUserAccepted;
|
|
283 |
|
|
284 |
/**
|
|
285 |
* Flag to signal that command has icon data
|
|
286 |
* To be removed when icons are allowed in this command
|
|
287 |
*/
|
|
288 |
TBool iIconCommand;
|
|
289 |
|
48
|
290 |
/**
|
|
291 |
* Indicates whether the result of sending USSD is displayed
|
|
292 |
*/
|
|
293 |
TBool iIsSatDisplayUssdResult;
|
33
|
294 |
};
|
|
295 |
|
|
296 |
#endif // CSENDUSSDHANDLER_H
|
|
297 |
|