satengine/SatServer/Commands/SetUpIdleModeTextCmd/src/CSetUpIdleModeTextHandler.cpp
branchRCL_3
changeset 20 987c9837762f
parent 19 7d48bed6ce0c
equal deleted inserted replaced
19:7d48bed6ce0c 20:987c9837762f
     1 /*
     1 /*
     2 * Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies). 
     2 * Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies). 
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    16 */
    16 */
    17 
    17 
    18 
    18 
    19 #include    <e32property.h>
    19 #include    <e32property.h>
    20 #include    <centralrepository.h>
    20 #include    <centralrepository.h>
    21 #include    <networkhandlingdomainpskeys.h>
    21 #include    <NetworkHandlingDomainPSKeys.h>
    22 #include    "SATPrivateCRKeys.h"
    22 #include    "SATPrivateCRKeys.h"
    23 #include    "MSatApi.h"
    23 #include    "MSatApi.h"
    24 #include    "MSatUtils.h"
    24 #include    "MSatUtils.h"
    25 #include    "MSatUiSession.h"
    25 #include    "MSatUiSession.h"
    26 #include    "SatSOpcodes.h"
    26 #include    "SatSOpcodes.h"
    64 void CSetUpIdleModeTextHandler::ConstructL()
    64 void CSetUpIdleModeTextHandler::ConstructL()
    65     {
    65     {
    66     LOG( SIMPLE, "SETUPIDLEMODETEXT: \
    66     LOG( SIMPLE, "SETUPIDLEMODETEXT: \
    67         CSetUpIdleModeTextHandler::ConstructL calling" )
    67         CSetUpIdleModeTextHandler::ConstructL calling" )
    68 
    68 
       
    69     iWaitingForResponse = EFalse;
       
    70 
       
    71     // Register to listen Idle mode responses.
       
    72     iUtils->RegisterL( this, MSatUtils::EIdleModeResponseSuccess );
       
    73     iUtils->RegisterL( this, MSatUtils::EIdleModeResponseSuccessNoIcon );
       
    74     iUtils->RegisterL( this, MSatUtils::EIdleModeResponseUnableToProcess );
       
    75     iUtils->RegisterL( this, MSatUtils::EIdleModeResponseBeyondCapabilities );
       
    76 
    69     // Register to listen ESimReset execution.
    77     // Register to listen ESimReset execution.
    70     iUtils->RegisterL( this, MSatUtils::ESimResetCalled );
    78     iUtils->RegisterL( this, MSatUtils::ESimResetCalled );
    71     iUtils->RegisterL( this, MSatUtils::ESimResetCancelled );
    79     iUtils->RegisterL( this, MSatUtils::ESimResetCancelled );
    72     iUtils->RegisterL( this, MSatUtils::ESimInitDone );
    80     iUtils->RegisterL( this, MSatUtils::ESimInitDone );
    73     // Get the homezone indicator flag from the Central Repository.
    81     // Get the homezone indicator flag from the Central Repository.
   125 //
   133 //
   126 void CSetUpIdleModeTextHandler::Event( TInt aEvent )
   134 void CSetUpIdleModeTextHandler::Event( TInt aEvent )
   127     {
   135     {
   128     LOG( SIMPLE,
   136     LOG( SIMPLE,
   129         "SETUPIDLEMODETEXT: CSetUpIdleModeTextHandler::Event calling" )
   137         "SETUPIDLEMODETEXT: CSetUpIdleModeTextHandler::Event calling" )
       
   138     TBool responseOk( EFalse );
       
   139 
   130     // Check the response
   140     // Check the response
   131     switch ( aEvent )
   141     switch ( aEvent )
   132         {
   142         {
       
   143         case MSatUtils::EIdleModeResponseSuccess:
       
   144             {
       
   145             LOG( NORMAL, "SETUPIDLEMODETEXT: CSetUpIdleModeTextHandler \
       
   146                 KSuccess")
       
   147             iSetUpIdleModeTextRsp.iGeneralResult = RSat::KSuccess;
       
   148             responseOk = ETrue;
       
   149             break;
       
   150             }
       
   151 
       
   152         case MSatUtils::EIdleModeResponseSuccessNoIcon:
       
   153             {
       
   154             LOG( NORMAL, "SETUPIDLEMODETEXT: CSetUpIdleModeTextHandler \
       
   155                 KSuccessReqIconNotDisplayed")
       
   156             iSetUpIdleModeTextRsp.iGeneralResult =
       
   157                 RSat::KSuccessRequestedIconNotDisplayed;
       
   158             responseOk = ETrue;
       
   159             break;
       
   160             }
       
   161 
       
   162         case MSatUtils::EIdleModeResponseUnableToProcess:
       
   163             {
       
   164             LOG( NORMAL, "SETUPIDLEMODETEXT: CSetUpIdleModeTextHandler \
       
   165                 KMeUnableToProcessCmd")
       
   166             iSetUpIdleModeTextRsp.iGeneralResult =
       
   167                 RSat::KMeUnableToProcessCmd;
       
   168             responseOk = ETrue;
       
   169             break;
       
   170             }
       
   171 
       
   172         case MSatUtils::EIdleModeResponseBeyondCapabilities:
       
   173             {
       
   174             LOG( NORMAL, "SETUPIDLEMODETEXT: CSetUpIdleModeTextHandler \
       
   175                 KBeyondMeCapabilities")
       
   176             iSetUpIdleModeTextRsp.iGeneralResult =
       
   177                 RSat::KCmdBeyondMeCapabilities;
       
   178             responseOk = ETrue;
       
   179             break;
       
   180             }
       
   181 
   133         case MSatUtils::ESimResetCalled:
   182         case MSatUtils::ESimResetCalled:
   134             {
   183             {
   135             LOG( NORMAL, "SETUPIDLEMODETEXT: CSetUpIdleModeTextHandler \
   184             LOG( NORMAL, "SETUPIDLEMODETEXT: CSetUpIdleModeTextHandler \
   136                  ESimResetCalled")
   185                  ESimResetCalled")
   137             iSimResetExecuting = ETrue;
   186             iSimResetExecuting = ETrue;
   193             {
   242             {
   194             CSatCommandHandler::Event( aEvent );
   243             CSatCommandHandler::Event( aEvent );
   195             break;
   244             break;
   196             }
   245             }
   197         }
   246         }
       
   247 
       
   248     if ( responseOk && iWaitingForResponse )
       
   249         {
       
   250         LOG( NORMAL, "SETUPIDLEMODETEXT: CSetUpIdleModeTextHandler \
       
   251         send response")
       
   252         iWaitingForResponse = EFalse;
       
   253 
       
   254         // Send terminal response, if the event was solved
       
   255         TerminalRsp( RSat::ESetUpIdleModeText, iSetUpIdleModeTextRspPckg );
       
   256         }
       
   257 
   198     LOG( SIMPLE,
   258     LOG( SIMPLE,
   199         "SETUPIDLEMODETEXT: CSetUpIdleModeTextHandler::Event exiting" )
   259         "SETUPIDLEMODETEXT: CSetUpIdleModeTextHandler::Event exiting" )
   200     }
   260     }
   201 
   261 
   202 // -----------------------------------------------------------------------------
   262 // -----------------------------------------------------------------------------
   340         // Send the response.
   400         // Send the response.
   341         TerminalRsp( RSat::ESetUpIdleModeText, iSetUpIdleModeTextRspPckg );
   401         TerminalRsp( RSat::ESetUpIdleModeText, iSetUpIdleModeTextRspPckg );
   342         }
   402         }
   343     else
   403     else
   344         {
   404         {
       
   405         iWaitingForResponse = ETrue;
       
   406 
   345         // Save data for restore.
   407         // Save data for restore.
   346         iSimResetExecuting = EFalse;
   408         iSimResetExecuting = EFalse;
   347         iLastValidText = idleModeText;
   409         iLastValidText = idleModeText;
   348         iLastValidIconId = iconId;
   410         iLastValidIconId = iconId;
   349         iLastValidIconQualifier = qualifier;
   411         iLastValidIconQualifier = qualifier;
   367                         ENWNone );
   429                         ENWNone );
   368                 LOG2( NORMAL, "SETUPIDLEMODETEXT: CSetUpIdleModeTextHandler \
   430                 LOG2( NORMAL, "SETUPIDLEMODETEXT: CSetUpIdleModeTextHandler \
   369                     remove the homezone indicator and return %d", errorCode )
   431                     remove the homezone indicator and return %d", errorCode )
   370                 }
   432                 }
   371             }
   433             }
   372         
       
   373         iSetUpIdleModeTextRsp.iGeneralResult = RSat::KSuccess;
       
   374         TerminalRsp( RSat::ESetUpIdleModeText, iSetUpIdleModeTextRspPckg );
       
   375         }
   434         }
   376 
   435 
   377     LOG( SIMPLE,
   436     LOG( SIMPLE,
   378         "SETUPIDLEMODETEXT: CSetUpIdleModeTextHandler::HandleCommand exiting" )
   437         "SETUPIDLEMODETEXT: CSetUpIdleModeTextHandler::HandleCommand exiting" )
   379     }
   438     }