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 CMMBROADCASTTSY_H
|
|
21 |
#define CMMBROADCASTTSY_H
|
|
22 |
|
|
23 |
|
|
24 |
// INCLUDES
|
|
25 |
#include <et_phone.h>
|
|
26 |
#include <mmretrieve.h>
|
|
27 |
#include "MmTsy_timeoutdefs.h"
|
|
28 |
#include <ctsy/serviceapi/cmmsmsutility.h>
|
|
29 |
|
|
30 |
// FORWARD DECLARATIONS
|
|
31 |
class CMmPhoneTsy;
|
|
32 |
class CMessStore;
|
|
33 |
class CListReadAllAttempt;
|
|
34 |
class CMmTsyReqHandleStore;
|
|
35 |
class CMmMessageManagerBase;
|
|
36 |
class CMmDataPackage;
|
|
37 |
struct TCbsCbmiAndLanglist;
|
|
38 |
|
|
39 |
// CLASS DECLARATION
|
|
40 |
|
|
41 |
/**
|
|
42 |
* BroadcastTSY
|
|
43 |
*/
|
|
44 |
NONSHARABLE_CLASS( CMmBroadcastTsy ) : public CSubSessionExtBase
|
|
45 |
{
|
|
46 |
public:
|
|
47 |
|
|
48 |
enum TBroadcastRequestTypes
|
|
49 |
{
|
|
50 |
EMultimodeBroadcastReqHandleUnknown, //0
|
|
51 |
EMultimodeBroadcastReceiveMessage,
|
|
52 |
EMultimodeBroadcastReceiveMessageCancel,
|
|
53 |
EMultimodeBroadcastSetFilterSetting,
|
|
54 |
EMultimodeBroadcastNotifyFilterSetting,
|
|
55 |
EMultimodeBroadcastSetLanguageFilter,
|
|
56 |
EMultimodeBroadcastNotifyLanguageFilter,
|
|
57 |
EMultimodeBroadcastStoreCbmiList,
|
|
58 |
EMultimodeBroadcastNotifyCbmiList,
|
|
59 |
EMultimodeBroadcastMaxNumOfRequests
|
|
60 |
};
|
|
61 |
|
|
62 |
public:
|
|
63 |
|
|
64 |
/**
|
|
65 |
* Two-phased constructor.
|
|
66 |
*/
|
|
67 |
static CMmBroadcastTsy* NewL( CMmPhoneTsy* aMmPhone );
|
|
68 |
|
|
69 |
/**
|
|
70 |
* Destructor
|
|
71 |
*/
|
|
72 |
virtual ~CMmBroadcastTsy();
|
|
73 |
|
|
74 |
/**
|
|
75 |
* Initialisation method that is called from ETel Server
|
|
76 |
*
|
|
77 |
*
|
|
78 |
*/
|
|
79 |
virtual void Init();
|
|
80 |
|
|
81 |
/**
|
|
82 |
* Handles extended client requests
|
|
83 |
*
|
|
84 |
*
|
|
85 |
* @param aTsyReqHandle Parameter handles the request
|
|
86 |
* @param aIpc Ipc number of request
|
|
87 |
* @param aPackage Packaged data
|
|
88 |
* @return Error value
|
|
89 |
*/
|
|
90 |
virtual TInt ExtFunc( const TTsyReqHandle aTsyReqHandle,
|
|
91 |
const TInt aIpc,
|
|
92 |
const TDataPackage& aPackage );
|
|
93 |
|
|
94 |
/**
|
|
95 |
* Returns request mode for given IPC number
|
|
96 |
*
|
|
97 |
*
|
|
98 |
* @param aIpc Ipc number of request
|
|
99 |
* @return Request mode for given IPC
|
|
100 |
*/
|
|
101 |
virtual CTelObject::TReqMode ReqModeL( const TInt aIpc );
|
|
102 |
|
|
103 |
/**
|
|
104 |
* Returns number of slots to be used for given IPC
|
|
105 |
*
|
|
106 |
*
|
|
107 |
* @param aIpc Ipc number of request
|
|
108 |
* @return Number of Slots
|
|
109 |
*/
|
|
110 |
virtual TInt NumberOfSlotsL( const TInt aIpc );
|
|
111 |
|
|
112 |
/**
|
|
113 |
* Cancels request that's IPC number and request handle are given
|
|
114 |
* in parameters
|
|
115 |
*
|
|
116 |
*
|
|
117 |
* @param aIpc Ipc number of request
|
|
118 |
* @param aTsyReqHandle Parameter handles the request
|
|
119 |
* @return Error value
|
|
120 |
*/
|
|
121 |
virtual TInt CancelService( const TInt aIpc,
|
|
122 |
const TTsyReqHandle aTsyReqHandle );
|
|
123 |
|
|
124 |
/**
|
|
125 |
* New instances are created by given name
|
|
126 |
*
|
|
127 |
*
|
|
128 |
* @param aName A name of the object to be created
|
|
129 |
* @return Pointer to created XXX object casted to CTelObject*
|
|
130 |
*/
|
|
131 |
virtual CTelObject* OpenNewObjectL( TDes& aName );
|
|
132 |
|
|
133 |
/**
|
|
134 |
* New instances are created by given name
|
|
135 |
*
|
|
136 |
*
|
|
137 |
* @param aName A name of the object to be created
|
|
138 |
* @return Pointer to created object casted to CTelObject*
|
|
139 |
*/
|
|
140 |
virtual CTelObject* OpenNewObjectByNameL( const TDesC& aName );
|
|
141 |
|
|
142 |
/**
|
|
143 |
* Register given notification
|
|
144 |
*
|
|
145 |
*
|
|
146 |
* @param aIpc Ipc number of request
|
|
147 |
* @return Error value
|
|
148 |
*/
|
|
149 |
virtual TInt RegisterNotification( const TInt aIpc );
|
|
150 |
|
|
151 |
/**
|
|
152 |
* Deregister given notification
|
|
153 |
*
|
|
154 |
*
|
|
155 |
* @param aIpc Ipc number of request
|
|
156 |
* @return Error value
|
|
157 |
*/
|
|
158 |
virtual TInt DeregisterNotification( const TInt aIpc );
|
|
159 |
|
|
160 |
/**
|
|
161 |
* Handle internally response to Broadcast routing request
|
|
162 |
*
|
|
163 |
*
|
|
164 |
* @param aError A local error variable
|
|
165 |
*/
|
|
166 |
virtual void InternalCompleteCbRoutingRequest( TInt aError );
|
|
167 |
|
|
168 |
/**
|
|
169 |
* Complete ReceiveMessageCancel request
|
|
170 |
*
|
|
171 |
*
|
|
172 |
* @param aError A local error variable
|
|
173 |
*/
|
|
174 |
virtual void CompleteReceiveMessageCancel( TInt aError );
|
|
175 |
|
|
176 |
/**
|
|
177 |
* Complete ReceiveMessage Gsm Cbs request
|
|
178 |
*
|
|
179 |
*
|
|
180 |
* @param aError A local error variable
|
|
181 |
* @param aDataPackage
|
|
182 |
*/
|
|
183 |
virtual void CompleteReceiveMessageGsmCbs( TInt aError,
|
|
184 |
CMmDataPackage* aDataPackage );
|
|
185 |
|
|
186 |
/**
|
|
187 |
* Complete ReceiveMessage Wcdma Cbs request
|
|
188 |
*
|
|
189 |
*
|
|
190 |
* @param aError A local error variable
|
|
191 |
* @param aDataPackage
|
|
192 |
*/
|
|
193 |
virtual void CompleteReceiveMessageWcdmaCbs( TInt aError,
|
|
194 |
CMmDataPackage* aDataPackage );
|
|
195 |
|
|
196 |
/**
|
|
197 |
* Complete ReceiveWcdma Message Page left
|
|
198 |
*
|
|
199 |
*
|
|
200 |
*/
|
|
201 |
virtual void CompleteReceivedWcdmaCbsMessagePageLeft();
|
|
202 |
|
|
203 |
/**
|
|
204 |
* Complete SetFilterSetting request
|
|
205 |
*
|
|
206 |
*
|
|
207 |
* @param aError A local error variable
|
|
208 |
*/
|
|
209 |
virtual void CompleteSetFilterSetting( TInt aError );
|
|
210 |
|
|
211 |
#ifdef REQHANDLE_TIMER
|
|
212 |
/**
|
|
213 |
* Complete request because of timer expiration
|
|
214 |
*
|
|
215 |
*
|
|
216 |
* @param aReqHandleType A request handle type
|
|
217 |
* @param aError A error value
|
|
218 |
*/
|
|
219 |
virtual void Complete( TInt aReqHandleType, TInt aError );
|
|
220 |
#endif // REQHANDLE_TIMER
|
|
221 |
|
|
222 |
private:
|
|
223 |
|
|
224 |
/**
|
|
225 |
* C++ default constructor.
|
|
226 |
*/
|
|
227 |
CMmBroadcastTsy();
|
|
228 |
|
|
229 |
/**
|
|
230 |
* By default Symbian 2nd phase constructor is private.
|
|
231 |
*/
|
|
232 |
void ConstructL();
|
|
233 |
|
|
234 |
/**
|
|
235 |
* Handles extended client requests
|
|
236 |
*
|
|
237 |
*
|
|
238 |
* @param aTsyReqHandle Tsy request handle
|
|
239 |
* @param aIpc IPC number
|
|
240 |
* @param aPackage Packaged data
|
|
241 |
* @return Error value
|
|
242 |
*/
|
|
243 |
TInt DoExtFuncL( const TTsyReqHandle aTsyReqHandle,
|
|
244 |
const TInt aIpc,
|
|
245 |
const TDataPackage& aPackage );
|
|
246 |
|
|
247 |
/**
|
|
248 |
* Get Broadcast Messaging capabilities of the phone
|
|
249 |
*
|
|
250 |
*
|
|
251 |
* @param aTsyReqHandle
|
|
252 |
* @param aCaps
|
|
253 |
* @return Error value
|
|
254 |
*/
|
|
255 |
TInt GetCaps( const TTsyReqHandle aTsyReqHandle,
|
|
256 |
TDes8* aCaps );
|
|
257 |
|
|
258 |
/**
|
|
259 |
* Calls CbRoutingRequest-method that activates routing of CB messages
|
|
260 |
*
|
|
261 |
*
|
|
262 |
* @param aTsyReqHandle Tsy request handle
|
|
263 |
* @param aMsgData
|
|
264 |
* @param aMsgAttributes
|
|
265 |
* @return Error value
|
|
266 |
*/
|
|
267 |
TInt ReceiveMessageL( const TTsyReqHandle aTsyReqHandle,
|
|
268 |
TDes8* aMsgData,
|
|
269 |
TDes8* aMsgAttributes );
|
|
270 |
|
|
271 |
/**
|
|
272 |
* Releases routing of CB messages and cancel receiving of next
|
|
273 |
* incoming Broadcast Message
|
|
274 |
*
|
|
275 |
*
|
|
276 |
* @param aTsyReqHandle Tsy request handle
|
|
277 |
* @return Error value
|
|
278 |
*/
|
|
279 |
TInt ReceiveMessageCancelL( const TTsyReqHandle aTsyReqHandle );
|
|
280 |
|
|
281 |
/**
|
|
282 |
* Get current setting for the receipt of broadcast messages
|
|
283 |
*
|
|
284 |
*
|
|
285 |
* @param aTsyReqHandle Tsy request handle
|
|
286 |
* @param aSetting
|
|
287 |
* @return KErrNone
|
|
288 |
*/
|
|
289 |
TInt GetFilterSetting( const TTsyReqHandle aTsyReqHandle,
|
|
290 |
RMobileBroadcastMessaging::TMobilePhoneBroadcastFilter* aSetting );
|
|
291 |
|
|
292 |
/**
|
|
293 |
* Set a new setting for the receipt of broadcast messages
|
|
294 |
*
|
|
295 |
*
|
|
296 |
* @param aTsyReqHandle Tsy request handle
|
|
297 |
* @param aSetting
|
|
298 |
* @return Error value
|
|
299 |
*/
|
|
300 |
TInt SetFilterSettingL( const TTsyReqHandle aTsyReqHandle,
|
|
301 |
RMobileBroadcastMessaging::TMobilePhoneBroadcastFilter const*
|
|
302 |
aSetting );
|
|
303 |
|
|
304 |
/**
|
|
305 |
* Notify client if there is a change in the setting for the receipt
|
|
306 |
* of broadcast messages
|
|
307 |
*
|
|
308 |
*
|
|
309 |
* @param aSetting
|
|
310 |
* @return KErrNone
|
|
311 |
*/
|
|
312 |
TInt NotifyFilterSettingChange(
|
|
313 |
RMobileBroadcastMessaging::TMobilePhoneBroadcastFilter* aSetting );
|
|
314 |
|
|
315 |
/**
|
|
316 |
* Cancel an outstanding asynchronous NotifyFilterSettingChange
|
|
317 |
* request
|
|
318 |
*
|
|
319 |
*
|
|
320 |
* @param aTsyReqHandle
|
|
321 |
* @return KErrNone
|
|
322 |
*/
|
|
323 |
TInt NotifyFilterSettingChangeCancel(
|
|
324 |
const TTsyReqHandle aTsyReqHandle );
|
|
325 |
|
|
326 |
/**
|
|
327 |
* Complete NotifyFilterSettingChange request
|
|
328 |
*
|
|
329 |
*
|
|
330 |
*/
|
|
331 |
void CompleteNotifyFilterSettingChange();
|
|
332 |
|
|
333 |
/**
|
|
334 |
* Retrieve CBMI list phase 1
|
|
335 |
*
|
|
336 |
*
|
|
337 |
* @param aTsyReqHandle Tsy request handle
|
|
338 |
* @param aReqData
|
|
339 |
* @param aBufSize
|
|
340 |
* @return Error value
|
|
341 |
*/
|
|
342 |
TInt GetBroadcastIdListPhase1L( const TTsyReqHandle aTsyReqHandle,
|
|
343 |
CRetrieveMobilePhoneBroadcastIdList::TGetBroadcastIdRequest const*
|
|
344 |
aReqData,
|
|
345 |
TInt* aBufSize );
|
|
346 |
|
|
347 |
/**
|
|
348 |
* Retrieve CBMI list phase 2
|
|
349 |
*
|
|
350 |
*
|
|
351 |
* @param aTsyReqHandle Tsy request handle
|
|
352 |
* @param aClient
|
|
353 |
* @param aBuffer
|
|
354 |
* @return KErrNone
|
|
355 |
*/
|
|
356 |
TInt GetBroadcastIdListPhase2( const TTsyReqHandle aTsyReqHandle,
|
|
357 |
RMobilePhone::TClientId const* aClient,
|
|
358 |
TDes8* aBuffer );
|
|
359 |
|
|
360 |
/**
|
|
361 |
* Store a new version of the entire list of CBMI entries
|
|
362 |
*
|
|
363 |
*
|
|
364 |
* @param aTsyReqHandle Tsy request handle
|
|
365 |
* @param aBuffer
|
|
366 |
* @return Error value
|
|
367 |
*/
|
|
368 |
TInt StoreBroadcastIdListL( const TTsyReqHandle aTsyReqHandle,
|
|
369 |
TDes8 const* aBuffer );
|
|
370 |
|
|
371 |
/**
|
|
372 |
* Reset all Broadcast variables
|
|
373 |
*
|
|
374 |
*
|
|
375 |
*/
|
|
376 |
void ResetVariables();
|
|
377 |
|
|
378 |
#ifdef REQHANDLE_TIMER
|
|
379 |
/**
|
|
380 |
* Chooses the type of response, automatic or common
|
|
381 |
*
|
|
382 |
*
|
|
383 |
* @param aReqHandleType Req handle type.
|
|
384 |
* @param aTsyReqHandle Req handle to be stored
|
|
385 |
*/
|
|
386 |
void SetTypeOfResponse( const TInt aReqHandleType,
|
|
387 |
const TTsyReqHandle aTsyReqHandle );
|
|
388 |
#endif // REQHANDLE_TIMER
|
|
389 |
|
|
390 |
protected:
|
|
391 |
|
|
392 |
/**
|
|
393 |
* Broadcast Filter Setting temporary storage
|
|
394 |
*/
|
|
395 |
RMobileBroadcastMessaging::TMobilePhoneBroadcastFilter
|
|
396 |
iCbFilterTempSetting;
|
|
397 |
|
|
398 |
/**
|
|
399 |
* Broadcast Filter Setting storage
|
|
400 |
*/
|
|
401 |
RMobileBroadcastMessaging::TMobilePhoneBroadcastFilter
|
|
402 |
iCbFilterSetting;
|
|
403 |
|
|
404 |
private:
|
|
405 |
|
|
406 |
/**
|
|
407 |
* A pointer to the Phone TSY
|
|
408 |
* Not own.
|
|
409 |
*/
|
|
410 |
CMmPhoneTsy* iMmPhone;
|
|
411 |
|
|
412 |
/**
|
|
413 |
* Pointer to the message manager
|
|
414 |
* Not own.
|
|
415 |
*/
|
|
416 |
CMmMessageManagerBase* iMessageManager;
|
|
417 |
|
|
418 |
/**
|
|
419 |
* Broadcast Messages routing from DOS activated
|
|
420 |
*/
|
|
421 |
TBool iCbRoutingActivated;
|
|
422 |
|
|
423 |
/**
|
|
424 |
* Receive Broadcast Message
|
|
425 |
* Not own.
|
|
426 |
*/
|
|
427 |
TDes8* iReceiveCbMessagePtr;
|
|
428 |
|
|
429 |
/**
|
|
430 |
* Receive Broadcast Message Attributes
|
|
431 |
* Not own.
|
|
432 |
*/
|
|
433 |
TDes8* iReceiveCbMessageAttributesPtr;
|
|
434 |
|
|
435 |
/**
|
|
436 |
* Notify Filter Setting Change
|
|
437 |
* Not own.
|
|
438 |
*/
|
|
439 |
RMobileBroadcastMessaging::TMobilePhoneBroadcastFilter*
|
|
440 |
iNotifyFilterSettingChangePtr;
|
|
441 |
|
|
442 |
/**
|
|
443 |
* Request handle type
|
|
444 |
*/
|
|
445 |
TBroadcastRequestTypes iReqHandleType;
|
|
446 |
|
|
447 |
/**
|
|
448 |
* Pointer to TSY request handle store
|
|
449 |
* Own.
|
|
450 |
*/
|
|
451 |
CMmTsyReqHandleStore* iTsyReqHandleStore;
|
|
452 |
|
|
453 |
/**
|
|
454 |
* A table for cell broadcast request handles
|
|
455 |
*/
|
|
456 |
TTsyReqHandle iBroadcastReqHandles[EMultimodeBroadcastMaxNumOfRequests];
|
|
457 |
|
|
458 |
/**
|
|
459 |
* Received WCDMA CBS message
|
|
460 |
* Not own.
|
|
461 |
*/
|
|
462 |
CArrayPtrFlat< TWcdmaCbsMsg >* iCbsMsg;
|
|
463 |
|
|
464 |
/**
|
|
465 |
* Number of Pages of WCDMA CBS Message
|
|
466 |
*/
|
|
467 |
TUint8 iWcdmaPageNumber;
|
|
468 |
|
|
469 |
/**
|
|
470 |
* Currently handled page WCDMA CBS Message
|
|
471 |
*/
|
|
472 |
TUint8 iWcdmaCurrentPage;
|
|
473 |
|
|
474 |
/**
|
|
475 |
* Flag which notifies if some WCDMA CDS Pages are waiting to be
|
|
476 |
* passed to client
|
|
477 |
*/
|
|
478 |
TBool iWcdmaCbsPageLeft;
|
|
479 |
|
|
480 |
/**
|
|
481 |
* Index of the page of the WCDMA CBS Message
|
|
482 |
*/
|
|
483 |
TUint8 iWcdmaCbsMsgPageIndex;
|
|
484 |
|
|
485 |
|
|
486 |
};
|
|
487 |
|
|
488 |
#endif // CMMBROADCASTTSY_H
|
|
489 |
|
|
490 |
// End of File
|