phoneengine/phonemodel/src/cpeparsersshandler.cpp
changeset 37 ba76fc04e6c2
child 46 bc5a64e5bc3c
equal deleted inserted replaced
36:2eacb6118286 37:ba76fc04e6c2
       
     1 /*
       
     2 * Copyright (c) 2002-2007 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:  This module contains the implementation of 
       
    15 *                CPEParserSSHandler class
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 // INCLUDE FILES
       
    22 #include "cpemessagehandler.h"
       
    23 #include "cpeparsersshandler.h"
       
    24 #include "mpephonemodelinternal.h"
       
    25 #include "pepanic.pan"
       
    26 #include <bldvariant.hrh>
       
    27 #include <etelmm.h>
       
    28 #include <featmgr.h>
       
    29 #include <mpedatastore.h>
       
    30 #include <nwdefs.h>
       
    31 #include <psetcallbarring.h>
       
    32 #include <psetcalldiverting.h>
       
    33 #include <psetcallwaiting.h>
       
    34 #include <psetcli.h>
       
    35 #include <psetcontainer.h>
       
    36 #include <psetcontainer.h>
       
    37 #include <psuibarringobs.h>
       
    38 #include <psuibarringobs.h>
       
    39 #include <psuicliobserver.h>
       
    40 #include <psuicontainer.h>
       
    41 #include <psuidivertobs.h>
       
    42 #include <psuiwaitingobs.h>
       
    43 #include <psuiwaitingobs.h>
       
    44 #include <talogger.h>
       
    45 
       
    46 
       
    47 // CONSTANTS
       
    48 const TInt KPEDefinedBasicServiceGroup = 99;
       
    49 
       
    50 
       
    51 // ============================ MEMBER FUNCTIONS ===============================
       
    52 
       
    53 // -----------------------------------------------------------------------------
       
    54 // CPEParserSSHandler::CPEParserSSHandler
       
    55 // C++ default constructor can NOT contain any code, that
       
    56 // might leave.
       
    57 // -----------------------------------------------------------------------------
       
    58 //
       
    59 CPEParserSSHandler::CPEParserSSHandler( 
       
    60         CPEMessageHandler& aOwner,       // The owner of this object.  
       
    61         MPEPhoneModelInternal& aModel       // The reference parameter of the 
       
    62         ) : iOwner( aOwner ),               // phone model object which is used
       
    63             iModel( aModel )                // to send message to the phone app.
       
    64 
       
    65     {
       
    66     iSupplementaryServicesCommandInfo.action = EPESSActionUnspecified;
       
    67     iSupplementaryServicesCommandInfo.type = EPESSTypeUnspecified;
       
    68     iSupplementaryServicesCommandInfo.group = RMobilePhone::EServiceUnspecified;
       
    69     TEFLOGSTRING( KTAOBJECT, "CPEParserSSHandler::CPEParserSSHandler" );
       
    70     }
       
    71 
       
    72 // -----------------------------------------------------------------------------
       
    73 // CPEParserSSHandler::NewL
       
    74 // Two-phased constructor.
       
    75 // -----------------------------------------------------------------------------
       
    76 //
       
    77 CPEParserSSHandler* CPEParserSSHandler::NewL(
       
    78         CPEMessageHandler& aOwner,   // The owner of this object.  
       
    79         MPEPhoneModelInternal& aModel ) // The reference parameter of the phone 
       
    80                                         // model object which is used to send
       
    81                                         // message to the phone application
       
    82     {
       
    83     CPEParserSSHandler* self = new ( ELeave ) CPEParserSSHandler( aOwner, aModel );
       
    84 
       
    85     TEFLOGSTRING( KTAOBJECT, "CPEParserSSHandler::NewL" );
       
    86 
       
    87     return self;
       
    88     } //NewL
       
    89 
       
    90 // Destructor
       
    91 CPEParserSSHandler::~CPEParserSSHandler()
       
    92     {    
       
    93     delete iCli;
       
    94     delete iCliObserver;
       
    95     delete iBarring;
       
    96     delete iCbObserver;
       
    97     delete iDivert;
       
    98     delete iCfObserver;
       
    99     delete iWaiting;
       
   100     delete iCwObserver;
       
   101     delete iSettings;
       
   102     delete iObsContainer;
       
   103 
       
   104     TEFLOGSTRING( KTAOBJECT, "CPEParserSSHandler::~CPEParserSSHandler" );
       
   105     }
       
   106 
       
   107 // -----------------------------------------------------------------------------
       
   108 // CPEParserSSHandler::GetBasicService.
       
   109 // Returns RMobilePhone::TMobileService type of basic service value.
       
   110 // -----------------------------------------------------------------------------
       
   111 //
       
   112 RMobilePhone::TMobileService CPEParserSSHandler::BasicService( 
       
   113         const TDesC& aBasicCode ) // It is basic service code.
       
   114     {
       
   115     RMobilePhone::TMobileService serviceGroup( RMobilePhone::EServiceUnspecified );
       
   116 
       
   117     if ( aBasicCode ==  KPENoServiceCode )
       
   118         {
       
   119         serviceGroup = RMobilePhone::EAllServices;
       
   120         }
       
   121     else if ( aBasicCode == KPEAllTeleservices )
       
   122         {                    
       
   123         serviceGroup = RMobilePhone::EAllTele;
       
   124         }
       
   125     else if ( aBasicCode == KPETelephony )
       
   126         {                    
       
   127         serviceGroup = RMobilePhone::ETelephony;
       
   128         }
       
   129     else if ( aBasicCode == KPEAllDataServices )
       
   130         {                    
       
   131         serviceGroup = RMobilePhone::EAllDataTele;
       
   132         }
       
   133     else if ( aBasicCode == KPEFacsimileServices )
       
   134         {                    
       
   135         serviceGroup = RMobilePhone::EFaxService;
       
   136         }
       
   137     else if ( aBasicCode == KPEShortMessageServices )
       
   138         {                    
       
   139         serviceGroup = RMobilePhone::EShortMessageService;
       
   140         }
       
   141     else if ( aBasicCode == KPEVoiceGroupCallService )
       
   142         {                    
       
   143         serviceGroup = RMobilePhone::EVoiceGroupCall;
       
   144         }
       
   145     else if ( aBasicCode == KPEVoiceBroadcastService )
       
   146         {                    
       
   147         serviceGroup = RMobilePhone::EVoiceBroadcast;
       
   148         }
       
   149     else if ( aBasicCode == KPEAllTeleservicesExceptSMS )
       
   150         {                    
       
   151         serviceGroup = RMobilePhone::EAllTeleExcSms;
       
   152         }
       
   153     else if ( aBasicCode == KPEAllBearerServices )
       
   154         {                    
       
   155         serviceGroup = RMobilePhone::EAllBearer;
       
   156         }
       
   157     else if ( aBasicCode == KPEAllAsyncServices )
       
   158         {                    
       
   159         serviceGroup = RMobilePhone::EAllAsync;
       
   160         }
       
   161     else if ( aBasicCode == KPEAllSyncServices )
       
   162         {                    
       
   163         serviceGroup = RMobilePhone::EAllSync;
       
   164         }
       
   165     else if ( aBasicCode == KPEAllDataCircuitSync )
       
   166         {                    
       
   167         serviceGroup = RMobilePhone::ESyncData;
       
   168         }
       
   169     else if ( aBasicCode == KPEAllDataCircuitAsync )
       
   170         {                    
       
   171         serviceGroup = RMobilePhone::EAsyncData;
       
   172         }
       
   173     // Not supported in MM ETel API, CR maded to Symbian.
       
   174     /*  
       
   175     else if ( aBasicCode == KPEAllDedicatedPacketAccess )
       
   176         {                    
       
   177         serviceGroup = EPE???;
       
   178         }
       
   179     */
       
   180     else if ( aBasicCode == KPEAllDedicatedPadAccess )
       
   181         {                    
       
   182         serviceGroup = RMobilePhone::EPadAccess;
       
   183         }
       
   184     else if ( aBasicCode == KPEAllGprsBearerServices )
       
   185         {                    
       
   186         serviceGroup = RMobilePhone::EAllGprsBearer;
       
   187         }
       
   188     else if ( aBasicCode == KPEAllPlmnSpecificTeleservices )
       
   189         {                    
       
   190         serviceGroup = RMobilePhone::EAllPlmnTele;
       
   191         }
       
   192     else if ( aBasicCode == KPEPlmnSpecificTeleservice1 )
       
   193         {                    
       
   194         serviceGroup = RMobilePhone::EPlmnTele1;
       
   195         }
       
   196     else if ( aBasicCode == KPEPlmnSpecificTeleservice2 )
       
   197         {                    
       
   198         serviceGroup = RMobilePhone::EPlmnTele2;
       
   199         }
       
   200     else if ( aBasicCode == KPEPlmnSpecificTeleservice3 )
       
   201         {                    
       
   202         serviceGroup = RMobilePhone::EPlmnTele3;
       
   203         }
       
   204     else if ( aBasicCode == KPEPlmnSpecificTeleservice4 )
       
   205         {                    
       
   206         serviceGroup = RMobilePhone::EPlmnTele4;
       
   207         }
       
   208     else if ( aBasicCode == KPEPlmnSpecificTeleservice5 )
       
   209         {                    
       
   210         serviceGroup = RMobilePhone::EPlmnTele5;
       
   211         }
       
   212     else if ( aBasicCode == KPEPlmnSpecificTeleservice6 )
       
   213         {                    
       
   214         serviceGroup = RMobilePhone::EPlmnTele6;
       
   215         }
       
   216     else if ( aBasicCode == KPEPlmnSpecificTeleservice7 )
       
   217         {                    
       
   218         serviceGroup = RMobilePhone::EPlmnTele7;
       
   219         }
       
   220     else if ( aBasicCode == KPEPlmnSpecificTeleservice8 )
       
   221         {                    
       
   222         serviceGroup = RMobilePhone::EPlmnTele8;
       
   223         }
       
   224     else if ( aBasicCode == KPEPlmnSpecificTeleservice9 )
       
   225         {                    
       
   226         serviceGroup = RMobilePhone::EPlmnTele9;
       
   227         }
       
   228     else if ( aBasicCode == KPEPlmnSpecificTeleservice10 )
       
   229         {                    
       
   230         serviceGroup = RMobilePhone::EPlmnTeleA;
       
   231         }
       
   232     else if ( aBasicCode == KPEPlmnSpecificTeleservice11 )
       
   233         {                    
       
   234         serviceGroup = RMobilePhone::EPlmnTeleB;
       
   235         }
       
   236     else if ( aBasicCode == KPEPlmnSpecificTeleservice12 )
       
   237         {                    
       
   238         serviceGroup = RMobilePhone::EPlmnTeleC;
       
   239         }
       
   240     else if ( aBasicCode == KPEPlmnSpecificTeleservice13 )
       
   241         {                    
       
   242         serviceGroup = RMobilePhone::EPlmnTeleD;
       
   243         }
       
   244     else if ( aBasicCode == KPEPlmnSpecificTeleservice14 )
       
   245         {                    
       
   246         serviceGroup = RMobilePhone::EPlmnTeleE;
       
   247         }
       
   248     else if ( aBasicCode == KPEPlmnSpecificTeleservice15 )
       
   249         {                    
       
   250         serviceGroup = RMobilePhone::EPlmnTeleF;
       
   251         }
       
   252     else if ( aBasicCode == KPEAllPlmnSpecificBearerServices )
       
   253         {                    
       
   254         serviceGroup = RMobilePhone::EAllPlmnBearer;
       
   255         }
       
   256     else if ( aBasicCode == KPEPlmnSpecificBearerService1 )
       
   257         {                    
       
   258         serviceGroup = RMobilePhone::EPlmnBearerServ1;
       
   259         }
       
   260     else if ( aBasicCode == KPEPlmnSpecificBearerService2 )
       
   261         {                    
       
   262         serviceGroup = RMobilePhone::EPlmnBearerServ2;
       
   263         }
       
   264     else if ( aBasicCode == KPEPlmnSpecificBearerService3 )
       
   265         {                    
       
   266         serviceGroup = RMobilePhone::EPlmnBearerServ3;
       
   267         }
       
   268     else if ( aBasicCode == KPEPlmnSpecificBearerService4 )
       
   269         {                    
       
   270         serviceGroup = RMobilePhone::EPlmnBearerServ4;
       
   271         }
       
   272     else if ( aBasicCode == KPEPlmnSpecificBearerService5 )
       
   273         {                    
       
   274         serviceGroup = RMobilePhone::EPlmnBearerServ5;
       
   275         }
       
   276     else if ( aBasicCode == KPEPlmnSpecificBearerService6 )
       
   277         {                    
       
   278         serviceGroup = RMobilePhone::EPlmnBearerServ6;
       
   279         }
       
   280     else if ( aBasicCode == KPEPlmnSpecificBearerService7 )
       
   281         {                    
       
   282         serviceGroup = RMobilePhone::EPlmnBearerServ7;
       
   283         }
       
   284     else if ( aBasicCode == KPEPlmnSpecificBearerService8 )
       
   285         {                    
       
   286         serviceGroup = RMobilePhone::EPlmnBearerServ8;
       
   287         }
       
   288     else if ( aBasicCode == KPEPlmnSpecificBearerService9 )
       
   289         {                    
       
   290         serviceGroup = RMobilePhone::EPlmnBearerServ9;
       
   291         }
       
   292     else if ( aBasicCode == KPEPlmnSpecificBearerService10 )
       
   293         {                    
       
   294         serviceGroup = RMobilePhone::EPlmnBearerServA;
       
   295         }
       
   296     else if ( aBasicCode == KPEPlmnSpecificBearerService11 )
       
   297         {                    
       
   298         serviceGroup = RMobilePhone::EPlmnBearerServB;
       
   299         }
       
   300     else if ( aBasicCode == KPEPlmnSpecificBearerService12 )
       
   301         {                    
       
   302         serviceGroup = RMobilePhone::EPlmnBearerServC;
       
   303         }
       
   304     else if ( aBasicCode == KPEPlmnSpecificBearerService13 )
       
   305         {                    
       
   306         serviceGroup = RMobilePhone::EPlmnBearerServD;
       
   307         }
       
   308     else if ( aBasicCode == KPEPlmnSpecificBearerService14 )
       
   309         {                    
       
   310         serviceGroup = RMobilePhone::EPlmnBearerServE;
       
   311         }
       
   312     else if ( aBasicCode == KPEPlmnSpecificBearerService15 )
       
   313         {                    
       
   314         serviceGroup = RMobilePhone::EPlmnBearerServF;
       
   315         }
       
   316     else if ( aBasicCode == KPEAuxVoiceService )
       
   317         {                    
       
   318         serviceGroup = RMobilePhone::EAuxVoiceService;
       
   319         }
       
   320     else
       
   321         {
       
   322         TEFLOGSTRING( KTAINT, "PE CPEParserSSHandler::BasicService: Unspecified Service code ");
       
   323         }
       
   324     iOwner.SetBasicServiceGroup( serviceGroup );
       
   325     return serviceGroup;
       
   326     }
       
   327  
       
   328 // -----------------------------------------------------------------------------
       
   329 // CPEParserSSHandler::Cancel
       
   330 // Method cancel command from Settings utility subsystem or security module.
       
   331 // Security module don't have return value from cancel command.
       
   332 // -----------------------------------------------------------------------------
       
   333 //    
       
   334 TInt CPEParserSSHandler::Cancel()
       
   335     { 
       
   336     // request cancellation is taken care of mainly in
       
   337     // the actual ss-objects. They are also able to handle
       
   338     // situation, where there is no ongoing request.
       
   339     TInt returnValue( ECCPErrorNone );
       
   340     if ( iWaiting )
       
   341         {
       
   342         TEFLOGSTRING( KTAMESINT, "PE CPEParserSSHandler::Cancel() > iWaiting->CancelProcess()" );
       
   343         iWaiting->CancelProcess();
       
   344         }
       
   345     else if ( iBarring )
       
   346         {
       
   347         TEFLOGSTRING( KTAMESINT, "PE CPEParserSSHandler::Cancel() > iBarring->CancelCurrentRequest()" );
       
   348         iBarring->CancelCurrentRequest();
       
   349         }
       
   350     else if ( iDivert )
       
   351         {
       
   352         TEFLOGSTRING( KTAMESINT, "PE CPEParserSSHandler::Cancel() > iDivert->CancelCurrentRequest()" );
       
   353         iDivert->CancelCurrentRequest();
       
   354         }
       
   355     else if ( iCli )
       
   356         {
       
   357         TEFLOGSTRING( KTAMESINT, "PE CPEParserSSHandler::Cancel() > iCli->CancelAll()" );
       
   358         iCli->CancelAll();
       
   359         }
       
   360     else
       
   361         {
       
   362         TEFLOGSTRING( KTAERROR, "PE CPEParserSSHandler::Cancel() ! Not Found" );
       
   363         returnValue = ECCPErrorNotFound;
       
   364         }
       
   365 
       
   366     return returnValue;
       
   367     }
       
   368 
       
   369 // -----------------------------------------------------------------------------
       
   370 // CPEParserSSHandler::ProcessBarringL
       
   371 // Process barring procedures
       
   372 // -----------------------------------------------------------------------------
       
   373 //
       
   374 void CPEParserSSHandler::ProcessBarringL( 
       
   375         TAction aAction,                // It is action
       
   376         TBarringProcedure aBarring,     // It contains barring procedure.
       
   377         const TDesC& aPassword,         // It should be barring password, if required.
       
   378         const TDesC& aBasicCode )       // It is basic service code.
       
   379     {
       
   380     TEFLOGSTRING( KTAINT,
       
   381         "PE CPEParserSSHandler::ProcessBarringL: Start" );
       
   382     // Notify Phone Application that an SS string was identified
       
   383     // and is about to be processed. This procedure is needed to quarantee
       
   384     // that an incoming call will not be blocked by the confirmation dialog
       
   385     iModel.SendMessage( MEngineMonitor::EPEMessageIssuingSSRequest );
       
   386 
       
   387     // convert into bsc
       
   388     TBasicServiceGroups bsc = ChangeToBsc( aBasicCode );
       
   389     // Basic service group for S90 UI...
       
   390     RMobilePhone::TMobileService serviceGroup = BasicService( aBasicCode );
       
   391     iSupplementaryServicesCommandInfo.group = serviceGroup;
       
   392 
       
   393     // connect to ss engine
       
   394     CreateCBObsL();
       
   395     TCallBarringSetting setBarring;
       
   396     // set basic service group to be used in line init.
       
   397     setBarring.iServiceGroup = EServiceGroupVoice;
       
   398     // copy the password
       
   399     setBarring.iPassword = aPassword;
       
   400     // chooses the right barring program
       
   401     switch( aBarring )
       
   402         {
       
   403         case EBarringAllOutgoingCalls:
       
   404             setBarring.iType = EBarringTypeAllOutgoing;
       
   405             iSupplementaryServicesCommandInfo.type = EPECallBarringAllOutgoing;
       
   406             break;
       
   407         case EBarringAllOutgoingInternationalCalls:
       
   408             setBarring.iType = EBarringTypeOutgoingInternational;
       
   409             iSupplementaryServicesCommandInfo.type = EPECallBarringAllOutgoingInternational;
       
   410             break;
       
   411         case EBarringAllOutgoingInternationalCallsExceptHome:
       
   412             setBarring.iType = 
       
   413                 EBarringTypeOutgoingInternationalExceptToHomeCountry;
       
   414             iSupplementaryServicesCommandInfo.type = EPECallBarringAllOutgoingInternationalExcHome;
       
   415             break;
       
   416         case EBarringAllIncomingCalls:
       
   417             setBarring.iType = EBarringTypeAllIncoming;
       
   418             iSupplementaryServicesCommandInfo.type = EPECallBarringAllIncoming;
       
   419             break;
       
   420         case EBarringAllIncomingCallsWhenRoaming:
       
   421             setBarring.iType = EBarringTypeIncomingWhenRoaming;
       
   422             iSupplementaryServicesCommandInfo.type = EPECallBarringAllIncomingWhenRoaming;
       
   423             break;
       
   424         case EBarringAllServices:
       
   425             setBarring.iType = EBarringTypeAllServices;
       
   426             iSupplementaryServicesCommandInfo.type = EPECallBarringAllServices;
       
   427             break;
       
   428         case EBarringAllOutgoingServices:
       
   429             setBarring.iType = EBarringTypeAllOutgoingServices;
       
   430             iSupplementaryServicesCommandInfo.type = EPECallBarringAllOutgoingServices;
       
   431             break;
       
   432         case EBarringAllIncomingServices:
       
   433             setBarring.iType = EBarringTypeAllIncomingServices;
       
   434             iSupplementaryServicesCommandInfo.type = EPECallBarringAllIncomingServices;
       
   435             break;
       
   436         default:
       
   437             break;
       
   438         }
       
   439     // right function of the iBarring is called according to aAction
       
   440     switch( aAction )
       
   441         {
       
   442         case EActivate:
       
   443             setBarring.iSetting = EActivateBarring;
       
   444             iSupplementaryServicesCommandInfo.action = EPESSActivation;
       
   445             iBarring->SetBarringL( setBarring, bsc );
       
   446             iModel.DataStore()->SetSSCommandInfo( iSupplementaryServicesCommandInfo );
       
   447             iModel.SendMessage( MEngineMonitor::EPEMessageIssuedSSRequest );
       
   448             break;
       
   449         case EDeactivate: 
       
   450             setBarring.iSetting = ECancelBarring;
       
   451             iSupplementaryServicesCommandInfo.action = EPESSDeactivation;
       
   452             iBarring->SetBarringL( setBarring, bsc );
       
   453             iModel.DataStore()->SetSSCommandInfo( iSupplementaryServicesCommandInfo );
       
   454             iModel.SendMessage( MEngineMonitor::EPEMessageIssuedSSRequest );
       
   455             break;
       
   456         case EInterrogate:
       
   457             iSupplementaryServicesCommandInfo.action = EPESSInterrogation;
       
   458             iBarring->GetBarringStatusL( EServiceGroupVoice, setBarring.iType );
       
   459             iModel.DataStore()->SetSSCommandInfo( iSupplementaryServicesCommandInfo );
       
   460             iModel.SendMessage( MEngineMonitor::EPEMessageIssuedSSRequest );
       
   461             break;
       
   462         case ERegister:
       
   463         case EErase:
       
   464         default:
       
   465             iSupplementaryServicesCommandInfo.action = EPESSActionUnspecified;
       
   466             iModel.SendMessage( MEngineMonitor::EPEMessageSSRequestFailed );
       
   467             break;
       
   468         }
       
   469     TEFLOGSTRING( KTAINT,
       
   470         "PE CPEParserSSHandler::ProcessBarringL: End" );
       
   471     }
       
   472 
       
   473 // -----------------------------------------------------------------------------
       
   474 // CPEParserSSHandler::ProcessClipStatusL.
       
   475 // Process calling line identification presentation status.
       
   476 // -----------------------------------------------------------------------------
       
   477 //
       
   478 void CPEParserSSHandler::ProcessClipStatusL()
       
   479     {
       
   480     TEFLOGSTRING( KTAINT,
       
   481         "PE CPEParserSSHandler::ProcessBarringL: Start" );
       
   482     // Notify Phone Application that an SS string was identified
       
   483     // and is about to be processed. This procedure is needed to quarantee
       
   484     // that an incoming call will not be blocked by the confirmation dialog
       
   485     iModel.SendMessage( MEngineMonitor::EPEMessageIssuingSSRequest );
       
   486 
       
   487     CreateCliObsL();
       
   488     iCli->GetClipModeL();
       
   489 
       
   490     iSupplementaryServicesCommandInfo.type = EPEClip;
       
   491     iSupplementaryServicesCommandInfo.action = EPESSInterrogation;
       
   492     iSupplementaryServicesCommandInfo.group = RMobilePhone::EServiceUnspecified;
       
   493     iModel.DataStore()->SetSSCommandInfo( iSupplementaryServicesCommandInfo );
       
   494     iModel.SendMessage( MEngineMonitor::EPEMessageIssuedSSRequest );
       
   495     
       
   496     TEFLOGSTRING( KTAINT,
       
   497         "PE CPEParserSSHandler::ProcessBarringL: End" );
       
   498     }
       
   499 
       
   500 // -----------------------------------------------------------------------------
       
   501 // CPEParserSSHandler::ProcessClirStatusL
       
   502 // Process connected line presentation status.
       
   503 // -----------------------------------------------------------------------------
       
   504 //
       
   505 void CPEParserSSHandler::ProcessClirStatusL()
       
   506     {
       
   507     TEFLOGSTRING( KTAINT,
       
   508         "PE CPEParserSSHandler::ProcessClirStatusL: Start" );
       
   509     // Notify Phone Application that an SS string was identified
       
   510     // and is about to be processed. This procedure is needed to quarantee
       
   511     // that an incoming call will not be blocked by the confirmation dialog
       
   512     iModel.SendMessage( MEngineMonitor::EPEMessageIssuingSSRequest );
       
   513 
       
   514     CreateCliObsL();
       
   515     iCli->GetClirModeL();
       
   516 
       
   517     iSupplementaryServicesCommandInfo.type = EPEClir;
       
   518     iSupplementaryServicesCommandInfo.action = EPESSInterrogation;
       
   519     iSupplementaryServicesCommandInfo.group = RMobilePhone::EServiceUnspecified;
       
   520     iModel.DataStore()->SetSSCommandInfo( iSupplementaryServicesCommandInfo );
       
   521     iModel.SendMessage( MEngineMonitor::EPEMessageIssuedSSRequest );
       
   522     TEFLOGSTRING( KTAINT,
       
   523         "PE CPEParserSSHandler::ProcessClirStatusL: End" );
       
   524     }
       
   525 
       
   526 // -----------------------------------------------------------------------------
       
   527 // CPEParserSSHandler::ProcessCnapStatusL
       
   528 // Process Calling Name Presentation (CNAP) status check.
       
   529 // -----------------------------------------------------------------------------
       
   530 //
       
   531 void CPEParserSSHandler::ProcessCnapStatusL()
       
   532     {
       
   533     TEFLOGSTRING( KTAINT,
       
   534         "PE CPEParserSSHandler::ProcessCnapStatusL: Start" );
       
   535     if ( FeatureManager::FeatureSupported( KFeatureIdPhoneCnap ) )
       
   536         {
       
   537         // Notify Phone Application that an SS string was identified
       
   538         // and is about to be processed. This procedure is needed to quarantee
       
   539         // that an incoming call will not be blocked by the confirmation dialog
       
   540         iModel.SendMessage( MEngineMonitor::EPEMessageIssuingSSRequest );
       
   541 
       
   542         CreateCliObsL();
       
   543         iCli->GetCnapL(); 
       
   544 
       
   545         iSupplementaryServicesCommandInfo.type = EPECnap;
       
   546         iSupplementaryServicesCommandInfo.action = EPESSInterrogation;
       
   547         iSupplementaryServicesCommandInfo.group = RMobilePhone::EServiceUnspecified;
       
   548         iModel.DataStore()->SetSSCommandInfo( iSupplementaryServicesCommandInfo );
       
   549         iModel.SendMessage( MEngineMonitor::EPEMessageIssuedSSRequest );
       
   550         }
       
   551     else
       
   552         {
       
   553         iOwner.SetGsmParserErrorCode( ECCPErrorNotSupported );
       
   554         }
       
   555     TEFLOGSTRING( KTAINT,
       
   556         "PE CPEParserSSHandler::ProcessCnapStatusL: End" );
       
   557     }
       
   558 
       
   559 // -----------------------------------------------------------------------------
       
   560 // CPEParserSSHandler::ProcessColpStatusL
       
   561 // Process connected line presentation status.
       
   562 // -----------------------------------------------------------------------------
       
   563 //
       
   564 void CPEParserSSHandler::ProcessColpStatusL()
       
   565     {
       
   566     TEFLOGSTRING( KTAINT,
       
   567         "PE CPEParserSSHandler::ProcessColpStatusL: Start" );
       
   568     // Notify Phone Application that an SS string was identified
       
   569     // and is about to be processed. This procedure is needed to quarantee
       
   570     // that an incoming call will not be blocked by the confirmation dialog
       
   571     iModel.SendMessage( MEngineMonitor::EPEMessageIssuingSSRequest );
       
   572 
       
   573     CreateCliObsL();
       
   574     iCli->GetColpModeL();
       
   575 
       
   576     iSupplementaryServicesCommandInfo.type = EPEColp;
       
   577     iSupplementaryServicesCommandInfo.action = EPESSInterrogation;
       
   578     iSupplementaryServicesCommandInfo.group = RMobilePhone::EServiceUnspecified;
       
   579     iModel.DataStore()->SetSSCommandInfo( iSupplementaryServicesCommandInfo );
       
   580     iModel.SendMessage( MEngineMonitor::EPEMessageIssuedSSRequest );
       
   581     
       
   582     TEFLOGSTRING( KTAINT,
       
   583         "PE CPEParserSSHandler::ProcessColpStatusL: End" );
       
   584     }
       
   585 
       
   586 // -----------------------------------------------------------------------------
       
   587 // CPEParserSSHandler::ProcessColrStatusL
       
   588 // Process connected line restriction status.
       
   589 // -----------------------------------------------------------------------------
       
   590 //
       
   591 void CPEParserSSHandler::ProcessColrStatusL()
       
   592     {
       
   593     TEFLOGSTRING( KTAINT,
       
   594         "PE CPEParserSSHandler::ProcessColrStatusL: Start" );
       
   595     // Notify Phone Application that an SS string was identified
       
   596     // and is about to be processed. This procedure is needed to quarantee
       
   597     // that an incoming call will not be blocked by the confirmation dialog
       
   598     iModel.SendMessage( MEngineMonitor::EPEMessageIssuingSSRequest );
       
   599 
       
   600     CreateCliObsL();
       
   601     iCli->GetColrModeL();
       
   602 
       
   603     iSupplementaryServicesCommandInfo.type = EPEColr;
       
   604     iSupplementaryServicesCommandInfo.action = EPESSInterrogation;
       
   605     iSupplementaryServicesCommandInfo.group = RMobilePhone::EServiceUnspecified;
       
   606     iModel.DataStore()->SetSSCommandInfo( iSupplementaryServicesCommandInfo );
       
   607     iModel.SendMessage( MEngineMonitor::EPEMessageIssuedSSRequest );
       
   608     TEFLOGSTRING( KTAINT,
       
   609         "PE CPEParserSSHandler::ProcessColrStatusL: End" );
       
   610     }
       
   611 
       
   612 // -----------------------------------------------------------------------------
       
   613 // CPEParserSSHandler::ProcessEmlppL
       
   614 // Process enhanced Multi-Level Precedence and Pre-emption (eMLPP).
       
   615 // -----------------------------------------------------------------------------
       
   616 //
       
   617 void CPEParserSSHandler::ProcessEmlppL( 
       
   618         TAction /*aAction*/,          // It as action.
       
   619         const TDesC& /*aNumber*/, // It is directory number.
       
   620         const TInt ) /*aServiceCode*/   // It is service code.
       
   621     {
       
   622     TEFLOGSTRING( KTAINT,
       
   623         "PE CPEParserSSHandler::ProcessEmlppL: " );
       
   624     //This feature is not supported.
       
   625     iOwner.SetGsmParserErrorCode( ECCPErrorNotSupported );
       
   626     }
       
   627 
       
   628 // -----------------------------------------------------------------------------
       
   629 // CPEParserSSHandler::ProcessForwardingL
       
   630 // If a parameter is not allowed for a procedure,then it is empty. If a 
       
   631 // parameter is not explicitly given, then it is empty. If a parameter is 
       
   632 // present, then it can be assumed to contain appropriate values.
       
   633 // -----------------------------------------------------------------------------
       
   634 //
       
   635 void CPEParserSSHandler::ProcessForwardingL( 
       
   636         TAction aAction,                    // It is action
       
   637         TForwardingProcedure aForwarding,   // It contains forwarding procedure.
       
   638         const TDesC& aNumber,               // It is directory number.
       
   639         const TDesC& aBasicCode,            // It is basic service code.
       
   640         const TDesC& aTimer )               // It is timer.
       
   641     {
       
   642     TEFLOGSTRING( KTAMESINT, "PE CPEParserSSHandler::ProcessForwardingL: Start" );
       
   643      
       
   644     // Notify Phone Application that an SS string was identified
       
   645     // and is about to be processed. This procedure is needed to quarantee
       
   646     // that an incoming call will not be blocked by the confirmation dialog
       
   647     iModel.SendMessage( MEngineMonitor::EPEMessageIssuingSSRequest );
       
   648 
       
   649     // connect to ss engine
       
   650     CreateCFObsL();
       
   651 
       
   652     RMobilePhone::TMobileService serviceGroup = BasicService( aBasicCode );
       
   653     iSupplementaryServicesCommandInfo.group = serviceGroup;
       
   654 
       
   655     TCallDivertSetting setDivert;
       
   656     // forwarded-to number copied
       
   657     if ( aNumber.Length() > KPsetPhoneNumberLength )
       
   658         {   
       
   659         User::Leave( KErrArgument );
       
   660         }       
       
   661     setDivert.iNumber.Copy( aNumber );
       
   662     // default basic service group used for line initialization is set
       
   663     setDivert.iServiceGroup = EServiceGroupData;
       
   664 
       
   665     // convert into bsc
       
   666     TBasicServiceGroups bsc = ChangeToBsc( aBasicCode );
       
   667     // to get the divert indicator correctly 
       
   668     // (needed when voice is concerned)
       
   669     if ( bsc == EAllTeleAndBearer ||
       
   670         bsc == EAllTele ||
       
   671         bsc == ETelephony ||
       
   672         bsc == EAllTeleExcSms ||
       
   673         bsc == EAltTele )
       
   674         {
       
   675         setDivert.iServiceGroup = EServiceGroupVoice;
       
   676         }
       
   677     
       
   678     // status initialized
       
   679     setDivert.iStatus = EDivertingStatusUnknown;
       
   680     setDivert.iNoReplyTimer = 0;
       
   681 
       
   682     // chooses the correct forwarding program
       
   683 
       
   684     switch ( aForwarding )
       
   685         {
       
   686         case EForwardingNotReachable:
       
   687             setDivert.iCondition = EDivertConditionNotReachable;
       
   688             iSupplementaryServicesCommandInfo.type = EPECallForwardingNotReachable;
       
   689             break;
       
   690         case EForwardingNoReply:
       
   691             {
       
   692             // set the timer in case of timer concerned function call
       
   693             if ( aTimer.Length() != 0 )
       
   694                 {
       
   695                 TLex input( aTimer );
       
   696                 User::LeaveIfError( input.Val( setDivert.iNoReplyTimer ) );
       
   697                 }
       
   698             else 
       
   699                 {
       
   700                 setDivert.iNoReplyTimer = iDivert->GetTimerValueL();
       
   701                 }
       
   702             setDivert.iCondition = EDivertConditionNoReply;
       
   703             iSupplementaryServicesCommandInfo.type = EPECallForwardingNoReply;
       
   704             break;
       
   705             }
       
   706         case EForwardingBusy:
       
   707             setDivert.iCondition = EDivertConditionBusy;
       
   708             iSupplementaryServicesCommandInfo.type = EPECallForwardingBusy;
       
   709             break;
       
   710         case EForwardingUnconditional:
       
   711             setDivert.iCondition = EDivertConditionUnconditional;
       
   712             iSupplementaryServicesCommandInfo.type = EPECallForwardingUnconditional;
       
   713             break;
       
   714         case EForwardingAll:
       
   715             setDivert.iCondition = EDivertConditionAllCalls;
       
   716             iSupplementaryServicesCommandInfo.type = EPECallForwardingAll;
       
   717             break;
       
   718         case EForwardingAllConditional:
       
   719             setDivert.iCondition = EDivertConditionAllConditionalCases;
       
   720             iSupplementaryServicesCommandInfo.type = EPECallForwardingAllConditional;
       
   721             break;
       
   722         default:
       
   723             break;
       
   724         }
       
   725     // right function chosen from iDivert according to aAction
       
   726     switch( aAction )
       
   727         {
       
   728         case EActivate:
       
   729             TEFLOGSTRING( KTAMESINT, "PE CPEParserSSHandler::ProcessForwardingL EActivate" );
       
   730             setDivert.iSetting = EActivateDiverting;
       
   731             iDivert->SetDivertingL( setDivert, bsc );
       
   732             iSupplementaryServicesCommandInfo.action = EPESSActivation;
       
   733             iModel.DataStore()->SetSSCommandInfo( iSupplementaryServicesCommandInfo );
       
   734             iModel.SendMessage( MEngineMonitor::EPEMessageIssuedSSRequest );
       
   735             break;
       
   736         case EDeactivate: 
       
   737             TEFLOGSTRING( KTAMESINT, "PE CPEParserSSHandler::ProcessForwardingL EDeactivate" );
       
   738             setDivert.iSetting = ECancelDiverting;
       
   739             iDivert->SetDivertingL( setDivert, bsc );
       
   740             iSupplementaryServicesCommandInfo.action = EPESSDeactivation;
       
   741             iModel.DataStore()->SetSSCommandInfo( iSupplementaryServicesCommandInfo );
       
   742             iModel.SendMessage( MEngineMonitor::EPEMessageIssuedSSRequest );
       
   743             break;
       
   744         case EInterrogate:
       
   745             TEFLOGSTRING( KTAMESINT, "PE CPEParserSSHandler::ProcessForwardingL EInterrogate" );
       
   746             iDivert->GetDivertingStatusL( EServiceGroupVoice, 
       
   747                 setDivert.iCondition, bsc );
       
   748             iSupplementaryServicesCommandInfo.action = EPESSInterrogation;
       
   749             iModel.DataStore()->SetSSCommandInfo( iSupplementaryServicesCommandInfo );
       
   750             iModel.SendMessage( MEngineMonitor::EPEMessageIssuedSSRequest );
       
   751             break;
       
   752         case ERegister:
       
   753             setDivert.iSetting = ERegisterDiverting;
       
   754             iDivert->SetDivertingL( setDivert, bsc );
       
   755             iSupplementaryServicesCommandInfo.action = EPESSRegistration;
       
   756             iModel.DataStore()->SetSSCommandInfo( iSupplementaryServicesCommandInfo );
       
   757             iModel.SendMessage( MEngineMonitor::EPEMessageIssuedSSRequest );
       
   758             break;
       
   759         case EErase:
       
   760             setDivert.iSetting = EEraseDiverting;
       
   761             iDivert->SetDivertingL( setDivert, bsc );
       
   762             iSupplementaryServicesCommandInfo.action = EPESSErasure;
       
   763             iModel.DataStore()->SetSSCommandInfo( iSupplementaryServicesCommandInfo );
       
   764             iModel.SendMessage( MEngineMonitor::EPEMessageIssuedSSRequest );
       
   765             break;
       
   766         default:
       
   767             TEFLOGSTRING( KTAMESINT, "PE CPEParserSSHandler::ProcessForwardingL default FAIL" );
       
   768             iSupplementaryServicesCommandInfo.action = EPESSActionUnspecified;
       
   769             iModel.DataStore()->SetSSCommandInfo( iSupplementaryServicesCommandInfo );
       
   770             iModel.SendMessage( MEngineMonitor::EPEMessageSSRequestFailed );
       
   771             break;
       
   772         }
       
   773     TEFLOGSTRING( KTAMESINT, "PE CPEParserSSHandler::ProcessForwardingL: End" ); 
       
   774     }
       
   775 
       
   776 // -----------------------------------------------------------------------------
       
   777 // CPEParserSSHandler::ProcessMspL
       
   778 // Process Multiple Subscriber Profile (MSP).
       
   779 // -----------------------------------------------------------------------------
       
   780 //
       
   781 void CPEParserSSHandler::ProcessMspL( 
       
   782         TAction /*aAction*/,        // It is action.
       
   783         const TDesC& /*aNumber*/,   // It is directory number.
       
   784         const TInt ) /*aServiceCode*/ // It is service code.
       
   785     {
       
   786     TEFLOGSTRING( KTAMESINT, "PE CPEParserSSHandler::ProcessMspL" );
       
   787     //This feature is not supported.
       
   788     iOwner.SetGsmParserErrorCode( ECCPErrorNotSupported );
       
   789     }
       
   790 
       
   791 // -----------------------------------------------------------------------------
       
   792 // CPEParserSSHandler::ProcessPasswordChange
       
   793 // Process password change.
       
   794 // -----------------------------------------------------------------------------
       
   795 //
       
   796 void CPEParserSSHandler::ProcessPasswordChangeL
       
   797         ( 
       
   798         TPasswordProcedure aPassword,   // It is password procedure.
       
   799         const TDesC& aOldPassword,      // It should be old password.
       
   800         const TDesC& aNewPassword,
       
   801         const TDesC& aVerifyNewPassword )
       
   802     {
       
   803     TEFLOGSTRING( KTAMESINT, "PE CPEParserSSHandler::ProcessPasswordChangeL: Start" ); 
       
   804     // Notify Phone Application that an SS string was identified
       
   805     // and is about to be processed. This procedure is needed to quarantee
       
   806     // that an incoming call will not be blocked by the confirmation dialog
       
   807     iModel.SendMessage( MEngineMonitor::EPEMessageIssuingSSRequest );
       
   808 
       
   809     CreateCBObsL(); 
       
   810 
       
   811     if ( aPassword == EPasswordBarring )
       
   812         {
       
   813         RMobilePhone::TMobilePhonePasswordChangeV2 password;
       
   814         CopyL( password.iOldPassword, aOldPassword );
       
   815         CopyL( password.iNewPassword, aNewPassword );
       
   816         CopyL( password.iVerifiedPassword, aVerifyNewPassword );
       
   817         iBarring->ChangePasswordL( password, ETrue );
       
   818         iSupplementaryServicesCommandInfo.type = EPECallBarringPassword;
       
   819         }
       
   820     else 
       
   821         {
       
   822         RMobilePhone::TMobilePhonePasswordChangeV2 password;
       
   823         CopyL( password.iOldPassword, aOldPassword );
       
   824         CopyL( password.iNewPassword, aNewPassword );
       
   825         CopyL( password.iVerifiedPassword, aVerifyNewPassword );
       
   826         iBarring->ChangePasswordL( password, EFalse );
       
   827         iSupplementaryServicesCommandInfo.type = EPESSTypeUnspecified;
       
   828         }
       
   829 
       
   830     iSupplementaryServicesCommandInfo.action = EPEPasswordOperation;
       
   831     iSupplementaryServicesCommandInfo.group = RMobilePhone::EServiceUnspecified;
       
   832     iModel.DataStore()->SetSSCommandInfo( iSupplementaryServicesCommandInfo );
       
   833     iModel.SendMessage( MEngineMonitor::EPEMessageIssuedSSRequest );
       
   834     
       
   835     TEFLOGSTRING( KTAMESINT, "PE CPEParserSSHandler::ProcessPasswordChangeL: End" ); 
       
   836     }
       
   837 
       
   838 // -----------------------------------------------------------------------------
       
   839 // CPEParserSSHandler::ProcessSpnpL
       
   840 // Process Support for Private Numbering Plan (SPNP).
       
   841 // -----------------------------------------------------------------------------
       
   842 //
       
   843 void CPEParserSSHandler::ProcessSpnpL( 
       
   844         TAction      /*aAction*/,        // It is action.
       
   845         const TInt ) /*aServiceCode*/ // It is service code.
       
   846     {
       
   847     TEFLOGSTRING( KTAMESINT, "PE CPEParserSSHandler::ProcessSpnpL" ); 
       
   848     //This feature is not supported.
       
   849     iOwner.SetGsmParserErrorCode( ECCPErrorNotSupported );
       
   850     }
       
   851 
       
   852 // -----------------------------------------------------------------------------
       
   853 // CPEParserSSHandler::ProcessWaitingL
       
   854 // Process waiting.
       
   855 // -----------------------------------------------------------------------------
       
   856 //
       
   857 void CPEParserSSHandler::ProcessWaitingL( 
       
   858         TAction aAction,          // It is action.
       
   859         const TDesC& aBasicCode ) // It is basic service code.
       
   860     {
       
   861     TEFLOGSTRING( KTAMESINT, "PE CPEParserSSHandler::ProcessWaitingL: Start" );
       
   862     // Notify Phone Application that an SS string was identified
       
   863     // and is about to be processed. This procedure is needed to quarantee
       
   864     // that an incoming call will not be blocked by the confirmation dialog
       
   865     iModel.SendMessage( MEngineMonitor::EPEMessageIssuingSSRequest );
       
   866 
       
   867     // changes aBasicCode to basic service group
       
   868     TBasicServiceGroups bsc = ChangeToBsc( aBasicCode );
       
   869     // Basic service group for S90 UI...
       
   870     RMobilePhone::TMobileService serviceGroup = BasicService( aBasicCode );
       
   871     iSupplementaryServicesCommandInfo.group = serviceGroup;
       
   872     iSupplementaryServicesCommandInfo.type = EPECallWaiting;
       
   873     // connects to ss engine
       
   874     CreateCWObsL();
       
   875     switch( aAction )
       
   876         {
       
   877         case EActivate:
       
   878             TEFLOGSTRING( KTAMESINT, "PE CPEParserSSHandler::ProcessWaitingL EActivate" );
       
   879             iWaiting->SetCallWaitingL( 
       
   880                 MPsetCallWaiting::EActivateCallWaiting, 
       
   881                 bsc );
       
   882             iSupplementaryServicesCommandInfo.action = EPESSActivation;
       
   883             iModel.DataStore()->SetSSCommandInfo( iSupplementaryServicesCommandInfo );
       
   884             iModel.SendMessage( MEngineMonitor::EPEMessageIssuedSSRequest );
       
   885             break;
       
   886         case EDeactivate: 
       
   887             TEFLOGSTRING( KTAMESINT, "PE CPEParserSSHandler::ProcessWaitingL EDeactivate" );
       
   888             iWaiting->SetCallWaitingL( 
       
   889                 MPsetCallWaiting::EDeactivateCallWaiting, 
       
   890                 bsc );
       
   891             iSupplementaryServicesCommandInfo.action = EPESSDeactivation;
       
   892             iModel.DataStore()->SetSSCommandInfo( iSupplementaryServicesCommandInfo );
       
   893             iModel.SendMessage( MEngineMonitor::EPEMessageIssuedSSRequest );
       
   894             break;
       
   895         case EInterrogate:
       
   896             TEFLOGSTRING( KTAMESINT, "PE CPEParserSSHandler::ProcessWaitingL EInterrogate" );
       
   897             iWaiting->GetCallWaitingStatusL();
       
   898             iSupplementaryServicesCommandInfo.action = EPESSInterrogation;
       
   899             iModel.DataStore()->SetSSCommandInfo( iSupplementaryServicesCommandInfo );
       
   900             iModel.SendMessage( MEngineMonitor::EPEMessageIssuedSSRequest );
       
   901             break;
       
   902         case ERegister:
       
   903         case EErase:
       
   904         default:
       
   905             TEFLOGSTRING( KTAMESINT, "PE CPEParserSSHandler::ProcessWaitingL default" );
       
   906             iSupplementaryServicesCommandInfo.action = EPESSActionUnspecified;
       
   907             iModel.DataStore()->SetSSCommandInfo( iSupplementaryServicesCommandInfo );
       
   908             iModel.SendMessage( MEngineMonitor::EPEMessageSSRequestFailed );
       
   909             break;
       
   910         } 
       
   911     TEFLOGSTRING( KTAMESINT, "PE CPEParserSSHandler::ProcessWaitingL: End" );
       
   912     }
       
   913 
       
   914 // -----------------------------------------------------------------------------
       
   915 // CPEParserSSHandler::ChangeToBsc
       
   916 // -----------------------------------------------------------------------------
       
   917 //
       
   918 TBasicServiceGroups CPEParserSSHandler::ChangeToBsc( 
       
   919     const TDesC& aBasicCode )
       
   920     {
       
   921     //null values must be handled as well, length == 0
       
   922     if ( aBasicCode.Length() == 0 )
       
   923         {
       
   924         return EAllTeleAndBearer;
       
   925         }
       
   926     TInt value( 0 ); 
       
   927     TLex input( aBasicCode );
       
   928     TInt error = input.Val( value );
       
   929     __ASSERT_ALWAYS( error > -1, 
       
   930         User::Panic( KPEPhoneEnginePanic, EPEPanicStupidUser ) );
       
   931     TBasicServiceGroups returnValue = EAllTeleAndBearer;
       
   932     if ( (EAllTele <= value && value <= EFax) ||
       
   933         (ESms <= value && value <= EAllSync) ||
       
   934         (ESyncData <= value && value <= EPadAccess) ||
       
   935         (EAllPlmnTele <= value && value <= EPlmnTeleF) ||
       
   936         (EAllPlmnBearer <= value && value <= EPlmnBearerServF) ||
       
   937         value == EAltTele ||
       
   938         value == KPEDefinedBasicServiceGroup )
       
   939         {
       
   940         returnValue = ( TBasicServiceGroups ) value;
       
   941         }
       
   942     else 
       
   943         {
       
   944         User::Panic( KPEPhoneEnginePanic, EPEPanicStupidUser );
       
   945         }
       
   946     return returnValue;      
       
   947     }
       
   948 
       
   949 // -----------------------------------------------------------------------------
       
   950 // CPEParserSSHandler::ConnectToSsEngineL
       
   951 // -----------------------------------------------------------------------------
       
   952 //
       
   953 void CPEParserSSHandler::ConnectToSsEngineL()
       
   954     {
       
   955     if ( iSettings )
       
   956         {
       
   957         return;
       
   958         }
       
   959     CleanupStack::PushL( TCleanupItem( DoClean, this ) );
       
   960  
       
   961     //creates the containers
       
   962     iSettings = CPsetContainer::NewL();
       
   963     iObsContainer = CPsuiContainer::NewL();
       
   964 
       
   965     CleanupStack::Pop( this );
       
   966     }
       
   967     
       
   968 // -----------------------------------------------------------------------------
       
   969 // CPEParserSSHandler::CreateCWObsL
       
   970 // -----------------------------------------------------------------------------
       
   971 //
       
   972 void CPEParserSSHandler::CreateCWObsL()
       
   973     {
       
   974     ConnectToSsEngineL();
       
   975     //call waiting observer and engine
       
   976     if ( !iCwObserver )
       
   977         {
       
   978         iCwObserver = iObsContainer->CreateCWObsL();
       
   979         iWaiting = iSettings->CreateCWObjectL( *iCwObserver );
       
   980         iWaiting->SetRequestObserver( this );
       
   981         }
       
   982     }
       
   983 
       
   984 // -----------------------------------------------------------------------------
       
   985 // CPEParserSSHandler::CreateCBObsL
       
   986 // -----------------------------------------------------------------------------
       
   987 //
       
   988 void CPEParserSSHandler::CreateCBObsL()
       
   989     {
       
   990     ConnectToSsEngineL();
       
   991     //call barring observer and engine
       
   992     if ( !iCbObserver )
       
   993         {  
       
   994         iCbObserver = iObsContainer->CreateCBObsL();
       
   995         iBarring = iSettings->CreateCBObjectL( *iCbObserver );
       
   996         iBarring->SetRequestObserver( this );
       
   997         }
       
   998     }
       
   999 
       
  1000 // -----------------------------------------------------------------------------
       
  1001 // CPEParserSSHandler::CreateCFObsL
       
  1002 // -----------------------------------------------------------------------------
       
  1003 //
       
  1004 void CPEParserSSHandler::CreateCFObsL()
       
  1005     {
       
  1006     ConnectToSsEngineL();
       
  1007     //call divert observer and engine
       
  1008     if ( !iCfObserver )
       
  1009         {   
       
  1010         iCfObserver = iObsContainer->CreateCFObsL();
       
  1011         iDivert = iSettings->CreateCFObjectL( *iCfObserver );
       
  1012         iDivert->SetRequestObserver( this );
       
  1013         }
       
  1014     }
       
  1015     
       
  1016 // -----------------------------------------------------------------------------
       
  1017 // CPEParserSSHandler::CreateCliObsL
       
  1018 // -----------------------------------------------------------------------------
       
  1019 //
       
  1020 void CPEParserSSHandler::CreateCliObsL()
       
  1021     {
       
  1022     ConnectToSsEngineL();
       
  1023     // cli observer and engine 
       
  1024     if ( !iCliObserver )
       
  1025         {  
       
  1026         iCliObserver = iObsContainer->CreateCliObsL();
       
  1027         iCli = iSettings->CreateCliObjectL( *iCliObserver );
       
  1028         iCli->SetRequestObserver( this );
       
  1029         }
       
  1030     }   
       
  1031      
       
  1032 // -----------------------------------------------------------------------------
       
  1033 // CPEParserSSHandler::ProcessForwardingL
       
  1034 // -----------------------------------------------------------------------------
       
  1035 void CPEParserSSHandler::RequestComplete()
       
  1036     {
       
  1037     ResetVariables();
       
  1038     }
       
  1039 
       
  1040 // -----------------------------------------------------------------------------
       
  1041 // CPEParserSSHandler::RequestStatusChanged
       
  1042 // -----------------------------------------------------------------------------
       
  1043 void CPEParserSSHandler::RequestStatusChanged( 
       
  1044     TInt /*aNewStatus*/ )
       
  1045     {
       
  1046     // Phone app is not interested in Ss state changes.
       
  1047     }
       
  1048 
       
  1049 // -----------------------------------------------------------------------------
       
  1050 // CPEParserSSHandler::DoClean
       
  1051 // -----------------------------------------------------------------------------
       
  1052 //
       
  1053 void CPEParserSSHandler::DoClean( 
       
  1054     TAny* aAny )
       
  1055     {
       
  1056     CPEParserSSHandler* ssHandler = 
       
  1057         static_cast< CPEParserSSHandler* >( aAny );
       
  1058     
       
  1059     ssHandler->ResetVariables();
       
  1060     }       
       
  1061 
       
  1062 
       
  1063 // -----------------------------------------------------------------------------
       
  1064 // CPEParserSSHandler::ResetVariables
       
  1065 // -----------------------------------------------------------------------------
       
  1066 //
       
  1067 void CPEParserSSHandler::ResetVariables()
       
  1068     {
       
  1069     delete iCfObserver;
       
  1070     iCfObserver = NULL;
       
  1071     delete iCbObserver;
       
  1072     iCbObserver = NULL;
       
  1073     delete iCwObserver;
       
  1074     iCwObserver = NULL;
       
  1075     delete iCliObserver;
       
  1076     iCliObserver = NULL;
       
  1077     delete iDivert;
       
  1078     iDivert = NULL;
       
  1079     delete iBarring;
       
  1080     iBarring = NULL;
       
  1081     delete iWaiting;
       
  1082     iWaiting = NULL;
       
  1083     delete iCli;
       
  1084     iCli = NULL;
       
  1085     delete iSettings;
       
  1086     iSettings = NULL;
       
  1087     delete iObsContainer;
       
  1088     iObsContainer = NULL;
       
  1089     }
       
  1090 
       
  1091 // -----------------------------------------------------------------------------
       
  1092 // CPEParserSSHandler::CopyL
       
  1093 // -----------------------------------------------------------------------------
       
  1094 //
       
  1095 void CPEParserSSHandler::CopyL( 
       
  1096         TDes& aDest, 
       
  1097         const TDesC& aSource )
       
  1098     {
       
  1099     if ( aDest.MaxLength() < aSource.Length() )
       
  1100         {
       
  1101         User::Leave( KErrOverflow );
       
  1102         }
       
  1103 
       
  1104     aDest = aSource;
       
  1105     }
       
  1106 
       
  1107 //  End of File