phoneclientserver/phoneclient/Src/UssdWrapper/CPhCltUssdImp.cpp
changeset 15 d7fc66ccd6fb
parent 13 e32024264ebb
child 27 7eb70891911c
--- a/phoneclientserver/phoneclient/Src/UssdWrapper/CPhCltUssdImp.cpp	Fri Apr 16 15:31:58 2010 +0300
+++ b/phoneclientserver/phoneclient/Src/UssdWrapper/CPhCltUssdImp.cpp	Mon May 03 13:01:45 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies). 
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -27,12 +27,8 @@
 #include <f32file.h>
 #include <charconv.h>
 #include <gsmuelem.h>
-//
-#include <coemain.h>
-#include <avkon.hrh>
-#include <avkon.rsg> 
-
-#include <phoneclient.rsg> 
+#include <coemain.h>  
+//#include <phoneclient.rsg> 
 #include <exterror.h>
 
 #include <gsmerror.h>
@@ -40,7 +36,8 @@
 
 #include "mphcltussdnotecontrollercallback.h" 
 #include "cphcltussdnotecontroller.h" 
-
+#include "cphcltussdcommonconstant.h"
+#include "tflogger.h"
 // CONSTANTS
 
 const TUint8 KPhCltUssdDcsDefaultAlphabet = 0x0f; // 00001111
@@ -333,10 +330,12 @@
 //
 CPhCltUssdImp* CPhCltUssdImp::NewL( TBool aShowNotes )
     {
+    TFLOGSTRING("CPhCltUssdImp: NewL call")
     CPhCltUssdImp* self = new( ELeave ) CPhCltUssdImp;
     CleanupStack::PushL( self );
     self->ConstructL( aShowNotes );
     CleanupStack::Pop(); // self
+    TFLOGSTRING("CPhCltUssdImp: NewL exit")
     return self;
     }
 
@@ -348,14 +347,14 @@
 //
 void CPhCltUssdImp::ConstructL( TBool aShowNotes )
     {
+    TFLOGSTRING("CPhCltUssdImp: ConstructL call")
     // The note controller is needed only if the notes are shown.
     iNoteController = NULL;
     
     if ( aShowNotes )
         {
         iNoteController = CPhCltUssdNoteController::NewL( 
-            *this, 
-            CActive::EPriorityStandard );
+            *this );
         }
 
     iDCS = KPhCltUssdDcsDefaultAlphabet;
@@ -365,6 +364,7 @@
     iRequestHandler = CPhCltUssdRequestHandler::NewL( 
         *this, 
         CActive::EPriorityStandard );
+    TFLOGSTRING("CPhCltUssdImp: ConstructL exit")
     }
 
 
@@ -376,6 +376,7 @@
 //
 CPhCltUssdImp::CPhCltUssdImp()
     {
+    TFLOGSTRING("CPhCltUssdImp: CPhCltUssdImp call_exit")
     } 
 
 
@@ -386,6 +387,7 @@
 //
 CPhCltUssdImp::~CPhCltUssdImp()
     {
+    TFLOGSTRING("CPhCltUssdImp: ~CPhCltUssdImp call") 
     if ( iWait )
         {
         if ( iWait->IsStarted() )
@@ -400,7 +402,8 @@
     iRequestHandler = NULL;
     
     delete iNoteController;
-    iNoteController = NULL;      
+    iNoteController = NULL;
+    TFLOGSTRING("CPhCltUssdImp: ~CPhCltUssdImp exit") 
     }
 
 
@@ -414,7 +417,8 @@
 void CPhCltUssdImp::HandleSendEventL( const TInt aError )
     {
     *iSendError = Min( aError , KErrNone );
-
+    TFLOGSTRING2("CPhCltUssdImp: HandleSendEventL\
+            aError = %d call", aError)
     // iNoteController is allocated only if notes are shown.
     if ( iNoteController )
         {
@@ -428,12 +432,12 @@
                 {
                 // All Ok.
                 case KErrNone:
-                    iNoteController->ShowGlobalConfirmationNoteL( R_TEXT_DONE );
+                    iNoteController->ShowGlobalInformationNoteL( EPhCltUssdDone );
                     break;
 
                 // Operation cancelled.
                 case KErrCancel:
-                    iNoteController->ShowGlobalInformationNoteL( R_TEXT_UNCONFIRMED );
+                    iNoteController->ShowGlobalInformationNoteL( EPhCltUssdUnconfirme );
                     break;
 
                 // Ongoing Ussd session or the string is barred due SS request
@@ -441,17 +445,17 @@
                 case KErrInUse:
                 case KErrAccessDenied:
                 case KErrGsmSSCallBarred:
-                    iNoteController->ShowGlobalInformationNoteL( R_TEXT_NOT_ALLOWED );
+                    iNoteController->ShowGlobalInformationNoteL( EPhCltUssdNotallowed );
                     break;
 
                 // No network coverage.
                 case KErrGsmSMSNoNetworkService:
-                    iNoteController->ShowGlobalInformationNoteL( R_TEXT_NO_SERVICE );
+                    iNoteController->ShowGlobalInformationNoteL(EPhCltUssdNoservice );
                     break;
 
                 // Offline mode.
                 case KErrGsmOfflineOpNotAllowed:
-                    iNoteController->ShowGlobalInformationNoteL( R_TEXT_OFFLINE );
+                    iNoteController->ShowGlobalInformationNoteL( EPhCltUssdOffline );
                     break;
                     
                 case KErrSatControl:
@@ -459,7 +463,7 @@
 
                 // Unknown error.
                 default:
-                    iNoteController->ShowGlobalInformationNoteL( R_TEXT_NOT_DONE );
+                    iNoteController->ShowGlobalInformationNoteL( EPhCltUssdNotDone );
                     break;
                 }
             }
@@ -470,6 +474,7 @@
         {
         iWait->AsyncStop();
         }
+    TFLOGSTRING("CPhCltUssdImp: HandleSendEventL exit")
     }
 
 
@@ -531,6 +536,7 @@
     const TDesC8& aMsgData, 
     const TUint8 iSendDcs )
     {
+    TFLOGSTRING("CPhCltUssdImp: SendUssd call")
     __ASSERT_ALWAYS( aMsgData.Length() <= KPhCltUssdMax7BitCharacterOctets,
         User::Invariant() );
 
@@ -568,15 +574,16 @@
 
     TInt error = KErrNone;
     iSendError = &error;
-  
+    TFLOGSTRING("CPhCltUssdImp: SendUssd iRequestHandler")
     iRequestHandler->SendUssd( aMsgData , attributePckg );
     // iNoteController is allocated only if notes are shown.
+    TFLOGSTRING("CPhCltUssdImp: SendUssd ShowGlobalWaitNoteL")
     if ( iNoteController )
         {
-        TRAP_IGNORE( iNoteController->ShowGlobalWaitNoteL( 
-            R_TEXT_SENDING, 
-            R_AVKON_SOFTKEYS_QUIT ) );
+        TRAP_IGNORE( iNoteController->ShowGlobalWaitNoteL(); 
+                    );
         }
+    TFLOGSTRING("CPhCltUssdImp: SendUssd iWait") 
 
     // Set this active object to wait the completion of the send request.
     iWait->Start();
@@ -586,6 +593,7 @@
         {
         iSendError = NULL;
         }
+    TFLOGSTRING("CPhCltUssdImp: SendUssd exit") 
     return error;
     }
 
@@ -598,7 +606,9 @@
 //
 void CPhCltUssdImp::SendUssdCancel()
     {
+    TFLOGSTRING("CPhCltUssdImp: SendUssdCancel call")
     iRequestHandler->SendUssdCancel();
+    TFLOGSTRING("CPhCltUssdImp: SendUssdCancel exit")
     }
 
 
@@ -621,7 +631,10 @@
 //
 TInt CPhCltUssdImp::AppStarting()
     {
-    return iRequestHandler->UssdClient().AppStarting();
+    TFLOGSTRING("CPhCltUssdImp: AppStarting call")
+    TInt res = iRequestHandler->UssdClient().AppStarting();
+    TFLOGSTRING2("CPhCltUssdImp: AppStarting exit res = %d",res)
+    return res;
     }
     
 // -----------------------------------------------------------------------------
@@ -633,7 +646,10 @@
 TInt CPhCltUssdImp::AppTerminating( 
       TPhCltUssdAppExitReason aExitReason )
     {
-    return iRequestHandler->UssdClient().AppTerminating( aExitReason );
+    TFLOGSTRING("CPhCltUssdImp: AppTerminating call")
+    TInt res = iRequestHandler->UssdClient().AppTerminating( aExitReason );
+    TFLOGSTRING2("CPhCltUssdImp: AppTerminating exit res = %d",res)
+    return res;
     }
     
 // -----------------------------------------------------------------------------
@@ -644,7 +660,10 @@
 //    
 TBool CPhCltUssdImp::AppToForeground()
     {
-    return iRequestHandler->UssdClient().AppToForeground();
+    TFLOGSTRING("CPhCltUssdImp: AppToForeground call")
+    TBool res =  iRequestHandler->UssdClient().AppToForeground();
+    TFLOGSTRING2("CPhCltUssdImp: AppToForeground exit res = %d",res)
+    return res;
     }
     
 // -----------------------------------------------------------------------------
@@ -655,7 +674,10 @@
 //    
 TInt CPhCltUssdImp::AppToBackground()
     {
-    return iRequestHandler->UssdClient().AppToBackground();
+    TFLOGSTRING("CPhCltUssdImp: AppToBackground call")
+    TInt res = iRequestHandler->UssdClient().AppToBackground();
+    TFLOGSTRING2("CPhCltUssdImp: AppToBackground exit res = %d",res)
+    return res;
     }
 
 // -----------------------------------------------------------------------------
@@ -669,7 +691,9 @@
             TDes& aReceiveMessage, 
             TPckg< TUint >& aShowNotesAndDcs )
     {
+    TFLOGSTRING("CPhCltUssdImp: StartSAT call")
     iRequestHandler->UssdClient().StartSAT( aStatus, aReceiveMessage, aShowNotesAndDcs );
+    TFLOGSTRING("CPhCltUssdImp: StartSAT exit")
     }
  
 // -----------------------------------------------------------------------------
@@ -680,24 +704,22 @@
 //   
  void CPhCltUssdImp::StopSAT()
     {
+    TFLOGSTRING("CPhCltUssdImp: StopSAT call")
     iRequestHandler->UssdClient().StopSAT();
+    TFLOGSTRING("CPhCltUssdImp: StopSAT exit")
     }
 
 
 // -----------------------------------------------------------------------------
-// CPhCltUssdImp::GlobalNoteDismissedL
+// CPhCltUssdImp::GlobalWaitNoteHidden
 //
-// Dialog is cancelled by the right softkey.
+// Dialog is hidden by the cancel key.
 // -----------------------------------------------------------------------------
 //
-void CPhCltUssdImp::GlobalWaitNoteDismissedL( TInt aButtonId )
+void CPhCltUssdImp::GlobalWaitNoteHidden()
     {
-    if ( aButtonId == EAknSoftkeyClose || 
-         aButtonId == EAknSoftkeyCancel ||
-         aButtonId == EAknSoftkeyQuit )
-        {   
-        SendUssdCancel();
-        }
+    TFLOGSTRING("CPhCltUssdImp: GlobalWaitNoteHidden call")
+    TFLOGSTRING("CPhCltUssdImp: GlobalWaitNoteHidden exit")
     }
 
 
@@ -709,8 +731,8 @@
 //
 void CPhCltUssdImp::EncodeL( const TDesC& aSrc, TDes8& aDes )
     {
-    //
-     aDes.Zero();
+    TFLOGSTRING("CPhCltUssdImp: EncodeL call")
+    aDes.Zero();
     TSmsDataCodingScheme::TSmsAlphabet alphabet = 
         TSmsDataCodingScheme::ESmsAlphabet7Bit; // default
         
@@ -813,6 +835,7 @@
         }
     
     CleanupStack::PopAndDestroy(3); // fs, packer, charConv
+    TFLOGSTRING("CPhCltUssdImp: EncodeL exit")
     }
 
 // -----------------------------------------------------------------------------