24
|
1 |
/*
|
|
2 |
* Copyright (c) 2006-2009 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:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
#ifndef CMMUSSDTSY_H
|
|
21 |
#define CMMUSSDTSY_H
|
|
22 |
|
|
23 |
// INCLUDES
|
|
24 |
#include <et_phone.h> // CSubSessionExtBase
|
|
25 |
#include "cmmphonetsy.h"
|
|
26 |
|
|
27 |
// FORWARD DECLARATIONS
|
|
28 |
class CMmPhoneTsy;
|
|
29 |
class CMessStore;
|
|
30 |
class RMobileUssdMessaging::TMobileUssdAttributesV1;
|
|
31 |
|
|
32 |
// CLASS DECLARATION
|
|
33 |
|
|
34 |
/**
|
|
35 |
* USSD TSY
|
|
36 |
*/
|
|
37 |
NONSHARABLE_CLASS( CMmUssdTsy ) : public CSubSessionExtBase
|
|
38 |
{
|
|
39 |
public:
|
|
40 |
|
|
41 |
enum TUssdRequestTypes
|
|
42 |
{
|
|
43 |
EMultimodeUssdReqHandleUnknown,
|
|
44 |
EMultimodeUssdSendMessage,
|
|
45 |
EMultimodeUssdReceiveMessage,
|
|
46 |
EMultimodeUssdSendRelease,
|
|
47 |
EMultimodeUssdNotifyNetworkRelease,
|
|
48 |
EMultimodeUssdSendMessageNoFdnCheck,
|
77
|
49 |
EMultimodeUssdSendMessageDefaultHandler,
|
24
|
50 |
// ATTENTION: Declare constant for those requests that need
|
|
51 |
// own request handle record in iTsyReqHandleStore above the
|
|
52 |
// following!
|
|
53 |
EMultimodeUssdMaxNumOfRequests
|
|
54 |
};
|
|
55 |
|
|
56 |
public:
|
|
57 |
|
|
58 |
/**
|
|
59 |
* Two-phased constructor.
|
|
60 |
*/
|
|
61 |
static CMmUssdTsy* NewL( CMmPhoneTsy* aMmPhone );
|
|
62 |
|
|
63 |
/**
|
|
64 |
* Destructor.
|
|
65 |
*/
|
|
66 |
virtual ~CMmUssdTsy();
|
|
67 |
|
|
68 |
/**
|
|
69 |
* Initialisation method
|
|
70 |
*
|
|
71 |
*
|
|
72 |
*/
|
|
73 |
virtual void Init();
|
|
74 |
|
|
75 |
/**
|
|
76 |
* Returns number of slots to be used for given IPC
|
|
77 |
*
|
|
78 |
*
|
|
79 |
* @param aIpc Request IPC number
|
|
80 |
* @return Number of slots to be used
|
|
81 |
*/
|
|
82 |
virtual TInt NumberOfSlotsL( const TInt aIpc );
|
|
83 |
|
|
84 |
/**
|
|
85 |
* Register given notification
|
|
86 |
*
|
|
87 |
*
|
|
88 |
* @param aIpc Request IPC number
|
|
89 |
* @return Result of the request
|
|
90 |
*/
|
|
91 |
virtual TInt RegisterNotification( const TInt aIpc );
|
|
92 |
|
|
93 |
/**
|
|
94 |
* Deregister given notification
|
|
95 |
*
|
|
96 |
*
|
|
97 |
* @param aIpc Request IPC number
|
|
98 |
* @return Result of the request
|
|
99 |
*/
|
|
100 |
virtual TInt DeregisterNotification( const TInt aIpc );
|
|
101 |
|
|
102 |
/**
|
|
103 |
* Dispatches multimode API function calls
|
|
104 |
*
|
|
105 |
*
|
|
106 |
* @param aTsyReqHandle Request handle from ETel server
|
|
107 |
* @param aIpc IPC number of the request
|
|
108 |
* @param aPackage Reference to the input parameters.
|
|
109 |
* @return KErrNone / KErrNotSupported
|
|
110 |
*/
|
|
111 |
virtual TInt ExtFunc( const TTsyReqHandle aTsyReqHandle,
|
|
112 |
const TInt aIpc,
|
|
113 |
const TDataPackage& aPackage );
|
|
114 |
|
|
115 |
/**
|
|
116 |
* Called by the server when it has a "extended".i.e.
|
|
117 |
* non-core ETel request for the TSY. To process a request handle,
|
|
118 |
* request type and request data are passed to the TSY.
|
|
119 |
*
|
|
120 |
*
|
|
121 |
* @param aTsyReqHandle Request handle from ETel server
|
|
122 |
* @param aIpc IPC number of the request
|
|
123 |
* @param aPackage Reference to the input parameters.
|
|
124 |
* @return KErrNone / KErrNotSupported
|
|
125 |
*/
|
|
126 |
virtual TInt DoExtFuncL( const TTsyReqHandle aTsyReqHandle,
|
|
127 |
const TInt aIpc,
|
|
128 |
const TDataPackage& aPackage );
|
|
129 |
|
|
130 |
/**
|
|
131 |
* Returns request mode for given IPC number
|
|
132 |
*
|
|
133 |
*
|
|
134 |
* @param aIpc Request IPC number
|
|
135 |
* @return Request mode
|
|
136 |
*/
|
|
137 |
virtual CTelObject::TReqMode ReqModeL( const TInt aIpc );
|
|
138 |
|
|
139 |
/**
|
|
140 |
* Cancels request that's IPC number and request handle are given in
|
|
141 |
*
|
|
142 |
*
|
|
143 |
* @param aIpc Request IPC number
|
|
144 |
* @param aTsyReqHandle Request handle from ETel server
|
|
145 |
* @return Error value
|
|
146 |
*/
|
|
147 |
virtual TInt CancelService( const TInt aIpc,
|
|
148 |
const TTsyReqHandle aTsyReqHandle );
|
|
149 |
|
|
150 |
/**
|
|
151 |
* Opens new object and names it
|
|
152 |
*
|
|
153 |
*
|
|
154 |
* @param aName Return contains name of opened object
|
|
155 |
* @return Pointer to created object casted to CTelObject*
|
|
156 |
*/
|
|
157 |
virtual CTelObject* OpenNewObjectL( TDes& aName );
|
|
158 |
|
|
159 |
/**
|
|
160 |
* Opens a object using given name
|
|
161 |
*
|
|
162 |
*
|
|
163 |
* @param aName On return contains name of opened object
|
|
164 |
* @return NULL
|
|
165 |
*/
|
|
166 |
virtual CTelObject* OpenNewObjectByNameL( const TDesC& aName );
|
|
167 |
|
|
168 |
/**
|
|
169 |
* Complete SendMessage
|
|
170 |
*
|
|
171 |
*
|
|
172 |
* @param aError Completes send message request
|
|
173 |
*/
|
|
174 |
virtual void CompleteSendMessage( TInt aError );
|
77
|
175 |
|
|
176 |
/**
|
|
177 |
* Complete SendMessage to Default Handler
|
|
178 |
*
|
|
179 |
*
|
|
180 |
* @param aError Completes send message request
|
|
181 |
*/
|
|
182 |
virtual void CompleteSendMessageDefaultHandler( TInt aError );
|
24
|
183 |
|
|
184 |
/**
|
|
185 |
* Complete SendMessageNoFdnCheck
|
|
186 |
*
|
|
187 |
*
|
|
188 |
* @param aError Completes send message request
|
|
189 |
*/
|
|
190 |
virtual void CompleteSendMessageNoFdnCheck( TInt aError );
|
|
191 |
|
|
192 |
/**
|
|
193 |
* Complete SendRelease
|
|
194 |
*
|
|
195 |
*
|
|
196 |
* @param aError Error code
|
|
197 |
* @param aDataPackage Contains packed
|
|
198 |
* RMobilePhone::TMobilePhoneSendSSRequestV3
|
|
199 |
*/
|
|
200 |
virtual void CompleteSendRelease( TInt aError,
|
|
201 |
CMmDataPackage* aDataPackage );
|
|
202 |
|
|
203 |
/**
|
|
204 |
* Complete ReceiveMessage request
|
|
205 |
*
|
|
206 |
*
|
|
207 |
* @param aError Error code
|
|
208 |
* @param aDataPackage Contains TDesC8& (USSD string data) and
|
|
209 |
* packed RMobilePhone::TMobileUssdAttributesV1
|
|
210 |
*/
|
|
211 |
virtual void CompleteReceiveMessage( TInt aError,
|
|
212 |
CMmDataPackage* aDataPackage );
|
|
213 |
|
|
214 |
/**
|
|
215 |
* Notification network release
|
|
216 |
*
|
|
217 |
*
|
|
218 |
* @param aTsyReqHandle Request handle
|
|
219 |
* @param aMsgData Contains packed RMobileUssdMessaging::TMobilePhoneSendSSRequestV3
|
|
220 |
* @param aMsgAttributes Contains poacked RMobilePhone::TMobileUssdAttributesV1
|
|
221 |
* @return Error value
|
|
222 |
*/
|
|
223 |
virtual TInt NotifyNetworkRelease( const TTsyReqHandle aTsyReqHandle,
|
|
224 |
TDes8* aMsgData,
|
|
225 |
TDes8* aMsgAttributes);
|
|
226 |
|
|
227 |
/**
|
|
228 |
* Complete network release request
|
|
229 |
*
|
|
230 |
*
|
|
231 |
* @param aError Error code
|
|
232 |
* @param aDataPackage Contains TDesC8& (USSD string data) and
|
|
233 |
* packed RMobilePhone::TMobileUssdAttributesV1
|
|
234 |
*/
|
|
235 |
virtual void CompleteNotifyNetworkRelease( TInt aErrorCode,
|
|
236 |
CMmDataPackage* aDataPackage );
|
|
237 |
|
|
238 |
/**
|
|
239 |
* Notify network release cancel
|
|
240 |
*
|
|
241 |
*
|
|
242 |
* @return KErrNone
|
|
243 |
*/
|
|
244 |
virtual TInt NotifyNetworkReleaseCancel();
|
|
245 |
|
|
246 |
#ifdef REQHANDLE_TIMER
|
|
247 |
/**
|
|
248 |
* Calls the needed complete method due timer expiration
|
|
249 |
*
|
|
250 |
*
|
|
251 |
* @param aReqHandleType Req handle type.
|
|
252 |
* @param aError Error value
|
|
253 |
*/
|
|
254 |
virtual void Complete( TInt aReqHandleType,
|
|
255 |
TInt aError );
|
|
256 |
#endif // REQHANDLE_TIMER
|
|
257 |
|
|
258 |
/**
|
|
259 |
* Returns pointer to the Phone object
|
|
260 |
*
|
|
261 |
*
|
|
262 |
* @return Pointer to the Phone object
|
|
263 |
*/
|
|
264 |
virtual CMmPhoneTsy* Phone();
|
|
265 |
|
|
266 |
private:
|
|
267 |
|
|
268 |
/**
|
|
269 |
* C++ default constructor.
|
|
270 |
*/
|
|
271 |
CMmUssdTsy();
|
|
272 |
|
|
273 |
/**
|
|
274 |
* By default Symbian 2nd phase constructor is private.
|
|
275 |
* @param CMmPhoneTsy* aMmPhoneTsy, pointer to phone tsy object.
|
|
276 |
*/
|
|
277 |
void ConstructL( CMmPhoneTsy* aMmPhoneTsy );
|
|
278 |
|
|
279 |
/**
|
|
280 |
* Returns the ussd messaging capabilities to the client
|
|
281 |
*
|
|
282 |
*
|
|
283 |
* @param aTsyReqHandle Request handle
|
|
284 |
* @param aCaps Packaged RMobilePhone::TMobileUssdCapsV1
|
|
285 |
* @return Return value to the ETel Server
|
|
286 |
*/
|
|
287 |
TInt GetCaps( const TTsyReqHandle aTsyReqHandle,
|
|
288 |
TDes8* aCaps );
|
|
289 |
|
|
290 |
/**
|
|
291 |
* Receive ussd message
|
|
292 |
*
|
|
293 |
*
|
|
294 |
* @param aTsyReqHandle Request handle
|
|
295 |
* @param aMsgData Message data
|
|
296 |
* @param aMsgAttributes Message attributes
|
|
297 |
* @return Error value
|
|
298 |
*/
|
|
299 |
TInt ReceiveMessage( const TTsyReqHandle aTsyReqHandle,
|
|
300 |
TDes8* aMsgData,
|
|
301 |
TDes8* aMsgAttributes );
|
|
302 |
|
|
303 |
/**
|
|
304 |
* Receive ussd message cancel
|
|
305 |
*
|
|
306 |
*
|
|
307 |
* @param aTsyReqHandle Request handle
|
|
308 |
*/
|
|
309 |
void ReceiveMessageCancel( const TTsyReqHandle aTsyReqHandle );
|
|
310 |
|
|
311 |
/**
|
|
312 |
* Send ussd message
|
|
313 |
*
|
|
314 |
*
|
|
315 |
* @param aTsyReqHandle Request handle
|
|
316 |
* @param aData Message data
|
|
317 |
* @param aAttributes Contains packaged
|
|
318 |
* RMobileUssdMessaging::TMobileUssdAttributesV1Pckg
|
|
319 |
* @return Error value
|
|
320 |
*/
|
|
321 |
TInt SendMessageL( const TTsyReqHandle aTsyReqHandle,
|
|
322 |
TDes8* aData,
|
|
323 |
TDes8* aAttributes );
|
|
324 |
|
|
325 |
/**
|
|
326 |
* Cancels an outstanding SendMessage request
|
|
327 |
*
|
|
328 |
*
|
|
329 |
* @param aTsyReqHandle Request handle
|
|
330 |
* @return KErrNone
|
|
331 |
*/
|
|
332 |
TInt SendMessageCancel( const TTsyReqHandle aTsyReqHandle );
|
77
|
333 |
|
|
334 |
/**
|
|
335 |
* Cancels an outstanding SendMessage request
|
|
336 |
*
|
|
337 |
*
|
|
338 |
* @param aTsyReqHandle Request handle
|
|
339 |
* @return KErrNone
|
|
340 |
*/
|
|
341 |
TInt SendMessageCancelDefaultHandler( const TTsyReqHandle aTsyReqHandle );
|
24
|
342 |
|
|
343 |
/**
|
|
344 |
* Cancels an outstanding SendMessageNoFdnCheck request
|
|
345 |
*
|
|
346 |
*
|
|
347 |
* @param aTsyReqHandle Request handle
|
|
348 |
* @return KErrNone
|
|
349 |
*/
|
|
350 |
TInt SendMessageNoFdnCheckCancel( const TTsyReqHandle aTsyReqHandle );
|
|
351 |
|
|
352 |
/**
|
|
353 |
* Send ussd session end -message
|
|
354 |
*
|
|
355 |
*
|
|
356 |
* @param aTsyReqHandle Request handle
|
|
357 |
* @param aReturnResult Contains packed
|
|
358 |
* RMobileUssdMessaging::TMobilePhoneSendSSRequestV3
|
|
359 |
* @return Error value
|
|
360 |
*/
|
|
361 |
TInt SendReleaseL( const TTsyReqHandle aTsyReqHandle,
|
|
362 |
TDes8* aReturnResult );
|
|
363 |
|
|
364 |
/**
|
|
365 |
* Cancels an outstanding SendRelease request
|
|
366 |
*
|
|
367 |
*
|
|
368 |
* @return KErrNone
|
|
369 |
*/
|
|
370 |
TInt SendReleaseCancel();
|
|
371 |
|
|
372 |
/**
|
|
373 |
* Reset used member variables
|
|
374 |
*
|
|
375 |
*/
|
|
376 |
void ResetVariables();
|
|
377 |
|
|
378 |
/**
|
|
379 |
* Checks whether or not a ETel request can be performed while offline
|
|
380 |
* mode is enabled
|
|
381 |
*
|
|
382 |
*
|
|
383 |
* @param aIpc Ipc number of the request
|
|
384 |
* @return TBool
|
|
385 |
*/
|
|
386 |
TBool IsRequestPossibleInOffline( TInt aIpc ) const;
|
|
387 |
|
|
388 |
#ifdef REQHANDLE_TIMER
|
|
389 |
/**
|
|
390 |
* Chooses the type of response, automatic or common
|
|
391 |
*
|
|
392 |
*
|
|
393 |
* @param aReqHandleType Req handle type.
|
|
394 |
* @param aTsyReqHandle Eeq handle to be stored.
|
|
395 |
*/
|
|
396 |
void SetTypeOfResponse(
|
|
397 |
const TInt aReqHandleType,
|
|
398 |
const TTsyReqHandle aTsyReqHandle );
|
|
399 |
#endif // REQHANDLE_TIMER
|
|
400 |
|
|
401 |
#ifdef TF_LOGGING_ENABLED
|
|
402 |
/**
|
|
403 |
* Overloads original ReqCompleted for logging purposes
|
|
404 |
*
|
|
405 |
*
|
|
406 |
* @param aTsyReqHandle
|
|
407 |
* @param aError
|
|
408 |
*/
|
|
409 |
virtual void ReqCompleted(
|
|
410 |
const TTsyReqHandle aTsyReqHandle,
|
|
411 |
const TInt aError );
|
|
412 |
#endif // TF_LOGGING_ENABLED
|
|
413 |
|
|
414 |
/**
|
|
415 |
* A table for call request handles
|
|
416 |
*/
|
|
417 |
TTsyReqHandle iUssdReqHandles[EMultimodeUssdMaxNumOfRequests];
|
|
418 |
|
|
419 |
/**
|
|
420 |
* Pointer to request handle store
|
|
421 |
* Own.
|
|
422 |
*/
|
|
423 |
CMmTsyReqHandleStore* iTsyReqHandleStore;
|
|
424 |
|
|
425 |
/**
|
|
426 |
* A pointer iReceiveUssdMessagePtr
|
|
427 |
* Not own.
|
|
428 |
*/
|
|
429 |
TDes8* iReceiveUssdMessagePtr;
|
|
430 |
|
|
431 |
/**
|
|
432 |
* A pointer to packed ussd message attributes
|
|
433 |
* Not own.
|
|
434 |
*/
|
|
435 |
RMobileUssdMessaging::TMobileUssdAttributesV1*
|
|
436 |
iReceiveUssdMessageAttributesPtr;
|
|
437 |
|
|
438 |
/**
|
|
439 |
* A pointer to packed operation code and additional info
|
|
440 |
* Not own.
|
|
441 |
*/
|
|
442 |
RMobilePhone::TMobilePhoneSendSSRequestV3* iReturnResultPtr;
|
|
443 |
|
|
444 |
/**
|
|
445 |
* A pointer to packed operation code and additional info
|
|
446 |
* Not own.
|
|
447 |
*/
|
|
448 |
RMobilePhone::TMobilePhoneSendSSRequestV3* iReturnNotifyPtr;
|
|
449 |
|
|
450 |
/**
|
|
451 |
* A pointer to packed attributes of a USSD message, returned in
|
|
452 |
* NotifyNetworkRelease notifications
|
|
453 |
* Not own.
|
|
454 |
*/
|
|
455 |
RMobileUssdMessaging::TMobileUssdAttributesV1* iReturnNotifyUssdMessageAttributesPtr;
|
|
456 |
|
|
457 |
/**
|
|
458 |
* A pointer to the Phone TSY
|
|
459 |
* Not own.
|
|
460 |
*/
|
|
461 |
CMmPhoneTsy* iMmPhone;
|
|
462 |
|
|
463 |
/**
|
|
464 |
* Flow control is removed from EMobileUssdMessagingSendMessage.
|
|
465 |
* iSsTransactionOngoing flag is used instead.
|
|
466 |
*/
|
|
467 |
TBool iSsTransactionOngoing;
|
|
468 |
|
|
469 |
/**
|
|
470 |
* Indicating status of NoFdnCheck
|
|
471 |
*/
|
|
472 |
enum TUssdNoFdnCheckStatus
|
|
473 |
{
|
|
474 |
EUssdNoFdnCheckUnknown,
|
|
475 |
EUssdNoFdnCheckUsed,
|
|
476 |
EUssdNoFdnCheckNotUsed
|
|
477 |
};
|
|
478 |
|
|
479 |
/**
|
|
480 |
* Indicating if SendMessageNoFdnCheck request is ongoing
|
|
481 |
*/
|
|
482 |
TUssdNoFdnCheckStatus iUssdNoFdnCheckFlag;
|
77
|
483 |
/**
|
|
484 |
* Indicating if SendMessage should send request to DefaultHandler
|
|
485 |
*/
|
|
486 |
TBool iSendToDefaultHandler;
|
24
|
487 |
};
|
|
488 |
|
|
489 |
#endif // CMMUSSDTSY_H
|
|
490 |
|
|
491 |
// End of File
|
|
492 |
|