networkhandling/networkhandlingengine/NetworkHandlingSrc/CNWMessageHandler.cpp
branchRCL_3
changeset 3 a4a774cb6ea7
parent 0 ff3b6d0fd310
child 5 7237db0d9fca
equal deleted inserted replaced
0:ff3b6d0fd310 3:a4a774cb6ea7
     1 /*
     1 /*
     2 * Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). 
     2 * Copyright (c) 2002-2010 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 
    19 
    20 // INCLUDE FILES
    20 // INCLUDE FILES
       
    21 #include    <FeatMgr.h>
    21 #include    "NWHandlingEngine.h"
    22 #include    "NWHandlingEngine.h"
    22 #include    "CNWMessageHandler.h"
    23 #include    "CNWMessageHandler.h"
    23 #include    "CNWNetworkCurrentNetworkMonitor.h"
    24 #include    "CNWNetworkCurrentNetworkMonitor.h"
    24 #include    "CNWNetworkRegistrationStatusMonitor.h"
    25 #include    "CNWNetworkRegistrationStatusMonitor.h"
    25 #include    "CNWProgrammableOperatorNameCommand.h"
    26 #include    "CNWProgrammableOperatorNameCommand.h"
    29 #include    "CNWSubscriberIdCommand.h"
    30 #include    "CNWSubscriberIdCommand.h"
    30 #include    "NWLogger.h"
    31 #include    "NWLogger.h"
    31 #ifdef RD_PHONE_NG
    32 #ifdef RD_PHONE_NG
    32 #include    "cnwnetworkselectionsettingmonitor.h"
    33 #include    "cnwnetworkselectionsettingmonitor.h"
    33 #endif // RD_PHONE_NG
    34 #endif // RD_PHONE_NG
       
    35 #include    "CNWDynamicCapsMonitor.h"
    34 // CONSTANTS
    36 // CONSTANTS
    35 const TInt KNWNetworkMonitorCurrent = 0;
    37 const TInt KNWNetworkMonitorCurrent = 0;
    36 const TInt KNWNetworkMonitorMode = 1;
    38 const TInt KNWNetworkMonitorMode = 1;
    37 const TInt KNWNetworkMonitorRegistration = 2;
    39 const TInt KNWNetworkMonitorRegistration = 2;
    38 #ifdef RD_PHONE_NG
    40 #ifdef RD_PHONE_NG
    39 const TInt KNWNetworkMonitorSettingSelection = 3;
    41 const TInt KNWNetworkMonitorSettingSelection = 3;
       
    42 const TInt KNWNetworkMonitorDynamicCaps = 4;
       
    43 #else // RD_PHONE_NG
       
    44 const TInt KNWNetworkMonitorDynamicCaps = 3;
    40 #endif // RD_PHONE_NG
    45 #endif // RD_PHONE_NG
    41 
    46 
    42 
    47 
    43 // ============================ MEMBER FUNCTIONS ==============================
    48 // ============================ MEMBER FUNCTIONS ==============================
    44 
    49 
   205         new ( ELeave ) CNWServiceProviderNameCommand( 
   210         new ( ELeave ) CNWServiceProviderNameCommand( 
   206                 *this, iPhone, iNetworkInfo );
   211                 *this, iPhone, iNetworkInfo );
   207 
   212 
   208     // Start initialising network handling module.
   213     // Start initialising network handling module.
   209     iMonitorContainer[ KNWNetworkMonitorRegistration ]->Initialise();
   214     iMonitorContainer[ KNWNetworkMonitorRegistration ]->Initialise();
       
   215 
       
   216     // Create CNWDynamicCapsMonitor object and insert it to monitor container.
       
   217     // Will be used to hide alpha tag when CS registration is unsuccessful
       
   218     FeatureManager::InitializeLibL();
       
   219     TInt err( KErrNone );
       
   220     if( FeatureManager::FeatureSupported( 
       
   221             KFeatureIdFfDisplayNetworkNameAfterCsRegistration ))
       
   222         {
       
   223         TRAP(err, 
       
   224             CNWDynamicCapsMonitor* tempDynamicCapsMonitor =
       
   225                 CNWDynamicCapsMonitor::NewL( *this, iPhone, iNetworkInfo, 
       
   226                                              iCustomAPI );
       
   227             CleanupStack::PushL( tempDynamicCapsMonitor );
       
   228 
       
   229             User::LeaveIfError( iMonitorContainer.Insert( 
       
   230                                         tempDynamicCapsMonitor,
       
   231                                         KNWNetworkMonitorDynamicCaps ) );
       
   232             CleanupStack::Pop( tempDynamicCapsMonitor ); );
       
   233         if( err == KErrNone )
       
   234             {
       
   235             iMonitorContainer
       
   236                 [ KNWNetworkMonitorDynamicCaps ]->Initialise();
       
   237             }
       
   238         }
       
   239     FeatureManager::UnInitializeLib();
       
   240     User::LeaveIfError(err);
   210     
   241     
   211     NWLOGSTRING( KNWOBJECT,
   242     NWLOGSTRING( KNWOBJECT,
   212         "NW: CNWMessageHandler::BaseConstructL() End" );
   243         "NW: CNWMessageHandler::BaseConstructL() End" );
   213     }
   244     }
   214 
   245 
   397             return _L("ENWMessageProgrammableOperatorInfoUpdating"); 
   428             return _L("ENWMessageProgrammableOperatorInfoUpdating"); 
   398         case MNWMessageObserver::ENWMessageNetworkProviderNameUpdating:
   429         case MNWMessageObserver::ENWMessageNetworkProviderNameUpdating:
   399             return _L("ENWMessageNetworkProviderNameUpdating"); 
   430             return _L("ENWMessageNetworkProviderNameUpdating"); 
   400         case MNWMessageObserver::ENWMessageServiceProviderNameUpdating:
   431         case MNWMessageObserver::ENWMessageServiceProviderNameUpdating:
   401             return _L("ENWMessageServiceProviderNameUpdating"); 
   432             return _L("ENWMessageServiceProviderNameUpdating"); 
       
   433         case MNWMessageObserver::ENWMessageDynamicCapsChange:
       
   434             {
       
   435             return _L("ENWMessageDynamicCapsChange");
       
   436             break;
       
   437             }
   402         default:
   438         default:
   403             NWLOGSTRING2( KNWINT, 
   439             NWLOGSTRING2( KNWINT, 
   404                 "NW: CNWMessageHandler::GetNameByMessage, unknown message = %d",
   440                 "NW: CNWMessageHandler::GetNameByMessage, unknown message = %d",
   405                  static_cast<TInt>( aMessage ) );
   441                  static_cast<TInt>( aMessage ) );
   406             return _L("Unknown message");
   442             return _L("Unknown message");