satengine/satserver/Engine/src/CSatCommandContainer.cpp
changeset 35 6aefa3341fcc
parent 33 8d5d7fcf9b59
child 51 12bc758d6a02
equal deleted inserted replaced
33:8d5d7fcf9b59 35:6aefa3341fcc
    18 
    18 
    19 
    19 
    20 #include    <f32file.h>
    20 #include    <f32file.h>
    21 #include    <barsc.h>
    21 #include    <barsc.h>
    22 #include    <bautils.h>
    22 #include    <bautils.h>
    23 #include    <SatServer.rsg>
       
    24 #include    <ecom.h>
    23 #include    <ecom.h>
    25 #include    <e32property.h>
    24 #include    <e32property.h>
    26 #include    <data_caging_path_literals.hrh>
    25 #include    <data_caging_path_literals.hrh>
    27 #include    <startupdomainpskeys.h>
    26 #include    <startupdomainpskeys.h>
    28 #include    <satdomainpskeys.h>
    27 #include    <satdomainpskeys.h>
       
    28 #include    <hbtextresolversymbian.h>
    29 
    29 
    30 #include    "MSatSystemState.h"
    30 #include    "MSatSystemState.h"
    31 #include    "TSatSystemStateFactory.h"
    31 #include    "TSatSystemStateFactory.h"
    32 #include    "MSatSystemStateChangeNotifier.h"
    32 #include    "MSatSystemStateChangeNotifier.h"
    33 #include    "CSatCommandContainer.h"
    33 #include    "CSatCommandContainer.h"
    50 #include    "csatprofilechangeobserver.h"
    50 #include    "csatprofilechangeobserver.h"
    51 #include    "SATInternalPSKeys.h"
    51 #include    "SATInternalPSKeys.h"
    52 #include    "csatmultimodeapi.h"
    52 #include    "csatmultimodeapi.h"
    53 #include    "csatsactivewrapper.h"
    53 #include    "csatsactivewrapper.h"
    54 
    54 
    55 // Drive letter for resource file
    55 _LIT( KResourceDrive, "z:\\resource\\qt\\translations" );
    56 _LIT( KResourceDrive, "Z:" );
    56 _LIT( KSatServerRsc, "satapp_");
    57 // SatServer's resource file
    57 _LIT( KSatLogTitle, "txt_simatk_title_sim_services");
    58 _LIT( KSatServerRsc, "SatServer.rsc" );
    58 _LIT( KSatCmccTitle, "txt_simatk_titlw_cmcc_sim_services");
    59 
       
    60 
    59 
    61 const TUid KSatInterfaceDefinitionUid = { 0x1000f001 };
    60 const TUid KSatInterfaceDefinitionUid = { 0x1000f001 };
    62 const TInt KSizeOfBuf = 50;
    61 const TInt KSizeOfBuf = 50;
    63 
    62 
    64 const TInt8 KCreateSatAppNamePop( 2 );
       
    65 
    63 
    66 // Important plugins UIDs. These are started on startup
    64 // Important plugins UIDs. These are started on startup
    67 // Implementation UID is from the <plugin>.rss
    65 // Implementation UID is from the <plugin>.rss
    68 const TUid KSetUpEventListUid = { 0x10202993 };
    66 const TUid KSetUpEventListUid = { 0x10202993 };
    69 
    67 
   393         {
   391         {
   394         LOG( NORMAL, "SATENGINE:   Event: ECmccSimDetected" )
   392         LOG( NORMAL, "SATENGINE:   Event: ECmccSimDetected" )
   395         iIsCmccSim = ETrue;
   393         iIsCmccSim = ETrue;
   396 
   394 
   397         // Update default name read in ConstructL.
   395         // Update default name read in ConstructL.
   398         TRAPD( err, CreateSatAppNameL( R_QTN_SAT_CMCC_TITLE ) );
   396         TRAPD( err, CreateSatAppNameL( KSatCmccTitle ) );
   399         LOG2( NORMAL, "SATENGINE:   Error: %i", err )
   397         LOG2( NORMAL, "SATENGINE:   Error: %i", err )
   400         if ( KErrNone == err )
   398         if ( KErrNone == err )
   401             {
   399             {
   402             // Notify application name update.
   400             // Notify application name update.
   403             NotifyEvent( EApplNameUpdated );
   401             NotifyEvent( EApplNameUpdated );
   625     LOG( NORMAL, "SATENGINE: CSatCommandContainer::RestoreSatAppNameL calling" )
   623     LOG( NORMAL, "SATENGINE: CSatCommandContainer::RestoreSatAppNameL calling" )
   626     if ( !iIsCmccSim )
   624     if ( !iIsCmccSim )
   627         {
   625         {
   628         LOG( NORMAL,
   626         LOG( NORMAL,
   629             "SATENGINE: CSatCommandContainer::RestoreSatAppNameL name reset" )
   627             "SATENGINE: CSatCommandContainer::RestoreSatAppNameL name reset" )
   630         CreateSatAppNameL( R_QTN_SAT_LOG_TITLE );
   628         CreateSatAppNameL( KSatLogTitle );
   631         }
   629         }
   632     LOG( NORMAL, "SATENGINE: CSatCommandContainer::RestoreSatAppNameL exiting" )
   630     LOG( NORMAL, "SATENGINE: CSatCommandContainer::RestoreSatAppNameL exiting" )
   633     }
   631     }
   634 
   632 
   635 // -----------------------------------------------------------------------------
   633 // -----------------------------------------------------------------------------
   900 void CSatCommandContainer::ConstructL()
   898 void CSatCommandContainer::ConstructL()
   901     {
   899     {
   902     LOG( NORMAL, "SATENGINE: CSatCommandContainer::ConstructL calling" )
   900     LOG( NORMAL, "SATENGINE: CSatCommandContainer::ConstructL calling" )
   903 
   901 
   904     iIsCmccSim = EFalse;
   902     iIsCmccSim = EFalse;
   905     CreateSatAppNameL( R_QTN_SAT_LOG_TITLE );
   903     CreateSatAppNameL( KSatLogTitle );
   906 
   904 
   907     // Register for ui events in order to keep track if user or command
   905     // Register for ui events in order to keep track if user or command
   908     // has launched the ui.
   906     // has launched the ui.
   909     iEventMediator.RegisterL( this, MSatUtils::ESatUiClosed );
   907     iEventMediator.RegisterL( this, MSatUtils::ESatUiClosed );
   910     iEventMediator.RegisterL( this, MSatUtils::ECmccSimDetected );
   908     iEventMediator.RegisterL( this, MSatUtils::ECmccSimDetected );
   989 // -----------------------------------------------------------------------------
   987 // -----------------------------------------------------------------------------
   990 // CSatCommandContainer::CreateSatAppNameL
   988 // CSatCommandContainer::CreateSatAppNameL
   991 // (other items were commented in a header).
   989 // (other items were commented in a header).
   992 // -----------------------------------------------------------------------------
   990 // -----------------------------------------------------------------------------
   993 //
   991 //
   994 void CSatCommandContainer::CreateSatAppNameL( const TInt aResourceId )
   992 void CSatCommandContainer::CreateSatAppNameL( const TDesC& aResourceId )
   995     {
   993     {
   996     LOG( NORMAL, "SATENGINE: CSatCommandContainer::CreateSatAppNameL calling" )
   994     LOG( NORMAL, "SATENGINE: CSatCommandContainer::CreateSatAppNameL calling" )
   997 
   995     delete iSatAppName;
   998     // Open the RFs session.
   996     iSatAppName = NULL;
   999     RFs fs;
   997     const TBool textResolver = HbTextResolverSymbian::Init( 
  1000 
   998         KSatServerRsc, KResourceDrive );
  1001     User::LeaveIfError( fs.Connect() );
   999     LOG2(NORMAL,"SATENGINE: CSatCommandContainer::\
  1002 
  1000         CreateSatAppNameL textResolver = %d", textResolver ) 
  1003     // Push close operation in tbe cleanup stack
  1001     LOG2(NORMAL,"SATENGINE: CSatCommandContainer::\
  1004     CleanupClosePushL( fs );
  1002         CreateSatAppNameL aResourceId = %S", &aResourceId )
  1005 
  1003 
  1006     RResourceFile resFile;
  1004     iSatAppName = HbTextResolverSymbian::LoadL( aResourceId );
  1007     // Backslashes are already defined in resource file, not needed here.
  1005     LOG2(NORMAL,"SATENGINE: CSatCommandContainer::\
  1008     TBuf<KSizeOfBuf> buf( KResourceDrive );
  1006         CreateSatAppNameL iSatAppName = %S", iSatAppName )
  1009     buf.Append( KDC_RESOURCE_FILES_DIR );
       
  1010     buf.Append( KSatServerRsc );
       
  1011 
       
  1012     TFileName fileName( buf );
       
  1013 
       
  1014     BaflUtils::NearestLanguageFile( fs, fileName );
       
  1015 
       
  1016     // Open the resource file
       
  1017     resFile.OpenL( fs, fileName );
       
  1018 
       
  1019     // Push close operation in the cleanup stack
       
  1020     CleanupClosePushL( resFile );
       
  1021 
       
  1022     resFile.ConfirmSignatureL( ESatSResourceSignature );
       
  1023 
       
  1024     // Reads a resource structure with memory allocation.
       
  1025     HBufC8* dataBuffer = resFile.AllocReadLC( aResourceId );
       
  1026 
       
  1027     TResourceReader resReader;
       
  1028     resReader.SetBuffer( dataBuffer );
       
  1029 
       
  1030     // Reads a string with memory allocation
       
  1031     iSatAppName = resReader.ReadHBufCL();
       
  1032     iSatBipName.Copy( SatAppName() );
  1007     iSatBipName.Copy( SatAppName() );
  1033 
       
  1034     // dataBuffer
       
  1035     CleanupStack::PopAndDestroy( dataBuffer );
       
  1036     // resFile, Calls resFile.Close()
       
  1037     // fs, Calls fs.Close
       
  1038     CleanupStack::PopAndDestroy( KCreateSatAppNamePop );
       
  1039 
       
  1040     LOG( NORMAL, "SATENGINE: CSatCommandContainer::CreateSatAppNameL exiting" )
  1008     LOG( NORMAL, "SATENGINE: CSatCommandContainer::CreateSatAppNameL exiting" )
  1041     }
  1009     }
  1042 
  1010 
  1043 // -----------------------------------------------------------------------------
  1011 // -----------------------------------------------------------------------------
  1044 // CSatCommandContainer::CreateAndGetBIPUtilsL
  1012 // CSatCommandContainer::CreateAndGetBIPUtilsL