servicewidget/servicewidgetdatapublisher/src/cservicewidgetcchhandler.cpp
branchRCL_3
changeset 29 9a48e301e94b
equal deleted inserted replaced
28:3104fc151679 29:9a48e301e94b
       
     1 /*
       
     2 * Copyright (c) 2008 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:  class for cch service handling
       
    15  *                
       
    16  *
       
    17 */
       
    18 
       
    19 #include "cservicewidgetcchhandler.h"
       
    20 
       
    21 #include "cservicewidgetcontentpublisher.h"
       
    22 #include "mservicewidgetobservers.h"
       
    23 #include "servicewidgetcpglobals.h"
       
    24 #include "swpdebugtrace.h"
       
    25 
       
    26 #include <spsettings.h> 
       
    27 #include <spentry.h>
       
    28 #include <spproperty.h>
       
    29 
       
    30 // ---------------------------------------------------------------------------
       
    31 // CServiceWidgetCchHandler::CServiceWidgetCchHandler
       
    32 // ---------------------------------------------------------------------------
       
    33 // 
       
    34 CServiceWidgetCchHandler::CServiceWidgetCchHandler(TUint32 aServiceId, 
       
    35 												   MServiceWidgetServiceStateObserver& aStateObserver ):
       
    36    iServiceId(aServiceId),
       
    37    iStateObserver( aStateObserver ),
       
    38    iServiceState( ESWSNotRegistered )
       
    39    {
       
    40    TRACE_SWP(TXT("CServiceWidgetCchHandler::CServiceWidgetCchHandler iServiceId %d"),iServiceId );
       
    41    }
       
    42 
       
    43 // ---------------------------------------------------------------------------
       
    44 // CServiceWidgetCchHandler::NewL
       
    45 // ---------------------------------------------------------------------------
       
    46 // 
       
    47 CServiceWidgetCchHandler* CServiceWidgetCchHandler::NewL(TUint32 aServiceId, 
       
    48 														 MServiceWidgetServiceStateObserver& aStateObserver  )
       
    49     {
       
    50     TRACE_SWP(TXT("CServiceWidgetCchHandler::NewL() start") );
       
    51     CServiceWidgetCchHandler* self = NewLC(aServiceId, aStateObserver);
       
    52     CleanupStack::Pop(self);
       
    53     TRACE_SWP(TXT("CServiceWidgetCchHandler::NewL() end") );
       
    54     return self;
       
    55     }
       
    56 
       
    57 // ---------------------------------------------------------------------------aOwnStatusKey
       
    58 // CServiceWidgetCchHandler::NewLC
       
    59 // ---------------------------------------------------------------------------
       
    60 // 
       
    61 CServiceWidgetCchHandler* CServiceWidgetCchHandler::NewLC(TUint32 aServiceId,
       
    62 														 MServiceWidgetServiceStateObserver& aStateObserver )
       
    63     {
       
    64     TRACE_SWP(TXT("CServiceWidgetCchHandler::NewLC() start") );
       
    65     CServiceWidgetCchHandler* self =
       
    66         new (ELeave) CServiceWidgetCchHandler(aServiceId, aStateObserver);
       
    67     CleanupStack::PushL(self);
       
    68     self->ConstructL( );
       
    69     TRACE_SWP(TXT("CServiceWidgetCchHandler::NewLC() end") );
       
    70     return self;
       
    71     }
       
    72 
       
    73 // ---------------------------------------------------------------------------
       
    74 // CServiceWidgetCchHandler::ConstructL
       
    75 // ---------------------------------------------------------------------------
       
    76 // 
       
    77 void CServiceWidgetCchHandler::ConstructL()
       
    78 	{
       
    79 	TRACE_SWP(TXT("CServiceWidgetCchHandler::ConstructL() start") );
       
    80 	iCchClient = CCch::NewL();
       
    81 	TRACE_SWP(TXT("CServiceWidgetCchHandler::ConstructL() iCchClient created") );
       
    82 	CCchService* service = iCchClient->GetService( iServiceId );    
       
    83 	if( service )
       
    84 		{
       
    85 		service->AddObserver( *this );      
       
    86 		}
       
    87 	//Configure CCHUI notes
       
    88 	MCchUi& cchui = iCchClient->CchUiApi();
       
    89 	// Configure CCHUI API to show all notes/dialogs except connecting note.
       
    90 	// Also configure that only VoIP and IM subservices are allowed (notes are
       
    91 	// shown only for those).
       
    92 	RArray<MCchUiObserver::TCchUiDialogType> allowedNotes;
       
    93 	RArray<TCCHSubserviceType> allowedSubServices;
       
    94 	CleanupClosePushL( allowedNotes );
       
    95 	CleanupClosePushL( allowedSubServices );
       
    96 
       
    97 	allowedNotes.AppendL( MCchUiObserver::ECchUiDialogTypeUsernamePasswordFailed );
       
    98 	allowedNotes.AppendL( MCchUiObserver::ECchUiDialogTypeAuthenticationFailed );
       
    99 	allowedNotes.AppendL( MCchUiObserver::ECchUiDialogTypeNoConnectionDefined );
       
   100 	allowedNotes.AppendL( MCchUiObserver::ECchUiDialogTypeNoConnectionAvailable );
       
   101 	allowedNotes.AppendL( MCchUiObserver::ECchUiDialogTypeConfirmChangeConnection );
       
   102 	allowedNotes.AppendL( MCchUiObserver::ECchUiDialogTypeChangeConnection );
       
   103 	allowedNotes.AppendL( MCchUiObserver::ECchUiDialogTypeDefectiveSettings );
       
   104 	allowedNotes.AppendL( MCchUiObserver::ECchUiDialogTypeErrorInConnection );  
       
   105 
       
   106 	allowedSubServices.AppendL( ECCHVoIPSub );
       
   107 	allowedSubServices.AppendL( ECCHIMSub );
       
   108 	allowedSubServices.AppendL( ECCHPresenceSub );
       
   109 
       
   110 	cchui.ConfigureVisualizationL( 
       
   111 			allowedNotes, allowedSubServices );
       
   112 	CleanupStack::PopAndDestroy( &allowedSubServices );
       
   113 	CleanupStack::PopAndDestroy( &allowedNotes );
       
   114 	
       
   115 	ReadSupportedSubServices();
       
   116 	TRACE_SWP(TXT("CServiceWidgetCchHandler::ConstructL() end") );
       
   117 	}
       
   118 
       
   119  	
       
   120 // ---------------------------------------------------------------------------
       
   121 // CServiceWidgetCchHandler::~CServiceWidgetCchHandler
       
   122 // ---------------------------------------------------------------------------
       
   123 // 
       
   124 CServiceWidgetCchHandler::~CServiceWidgetCchHandler()
       
   125 	{
       
   126 	TRACE_SWP(TXT("CServiceWidgetCchHandler::~CServiceWidgetCchHandler() start") );
       
   127 	if(iCchClient)
       
   128 		{
       
   129 		CCchService* service = iCchClient->GetService( iServiceId );
       
   130 		if( service )
       
   131 		    {
       
   132 		    service->RemoveObserver(*this);
       
   133 		    }
       
   134 		delete iCchClient; 
       
   135 		}
       
   136 	iSupportedSubServices.Reset();
       
   137 	
       
   138 	delete iServiceName;
       
   139 	delete iOwnData;
       
   140 	TRACE_SWP(TXT("CServiceWidgetCchHandler::~CServiceWidgetCchHandler() end") );
       
   141 	}
       
   142 
       
   143 // ---------------------------------------------------------------------------
       
   144 // CServiceWidgetCchHandler::ReadSupportedSubServices
       
   145 // ---------------------------------------------------------------------------
       
   146 //
       
   147  void CServiceWidgetCchHandler::ReadSupportedSubServices()
       
   148 	{
       
   149 	TRACE_SWP(TXT("CServiceWidgetCchHandler::ReadSupportedSubServices() start") );
       
   150 	iSupportedSubServices.Reset();
       
   151 	TSubServiceState subService;
       
   152 	TBool supported = IsServiceSupported( ECCHIMSub );
       
   153 	if( supported )
       
   154 		{
       
   155 		// im sub service supported
       
   156 		subService.iSubServiceType = ECCHIMSub;
       
   157 		subService.iSubServiceState = GetServiceState( ECCHIMSub );
       
   158 		iSupportedSubServices.Append( subService );	
       
   159 		}
       
   160 	supported = IsServiceSupported( ECCHPresenceSub );
       
   161 	if( supported )
       
   162 		{
       
   163 		// presence sub service supported
       
   164 		subService.iSubServiceType = ECCHPresenceSub;
       
   165 		subService.iSubServiceState = GetServiceState( ECCHPresenceSub );
       
   166 		iSupportedSubServices.Append( subService );	
       
   167 		}
       
   168 	supported = IsServiceSupported( ECCHVoIPSub );
       
   169 	if( supported )
       
   170 		{
       
   171 		// voip sub service supported
       
   172 		subService.iSubServiceType = ECCHVoIPSub;
       
   173 		subService.iSubServiceState = GetServiceState( ECCHVoIPSub );
       
   174 		iSupportedSubServices.Append( subService );	
       
   175 		}
       
   176 	TRACE_SWP(TXT("CServiceWidgetCchHandler::ReadSupportedSubServices() end") );
       
   177 	}
       
   178 
       
   179 
       
   180 // ---------------------------------------------------------------------------
       
   181 // CServiceWidgetCchHandler::ServiceStatusChanged
       
   182 // ---------------------------------------------------------------------------
       
   183 //
       
   184 void CServiceWidgetCchHandler::ServiceStatusChanged(
       
   185                 TInt  aServiceId,
       
   186                 const TCCHSubserviceType aType,
       
   187                 const TCchServiceStatus& aServiceStatus )
       
   188     {
       
   189     TRACE_SWP(TXT("CServiceWidgetCchHandler::ServiceStatusChanged() start") );
       
   190     if( aServiceId != iServiceId )
       
   191 	    {
       
   192 	    return;
       
   193 	    }
       
   194 	TCCHSubserviceState state = aServiceStatus.State();
       
   195     TInt subServiceCount = iSupportedSubServices.Count();
       
   196     TInt error = aServiceStatus.Error();
       
   197     
       
   198     for(TInt i=0; i< subServiceCount; i++)
       
   199 	    {
       
   200 	    TSubServiceState subService = iSupportedSubServices[ i ]; 
       
   201 	    if( subService.iSubServiceType == aType )
       
   202 			{
       
   203 			// sub service is matched ,supported
       
   204 			// check for ALR state if supported ,service may go to waiting state
       
   205 			if( error && (error != KCCHErrorInvalidSettings )  && 
       
   206 				( ECCHConnecting == state ) )
       
   207 				{
       
   208 				// waiting state
       
   209 				iSupportedSubServices[ i ].iSubServiceState = ESWSWaitingForNetwork;	
       
   210 				}
       
   211 			else
       
   212 				{
       
   213 				TSWSTRegistrationState swState = GetLocalServiceState( state );
       
   214 				if( swState == ESWSRegistered && aType == ECCHPresenceSub )
       
   215 					{
       
   216 					// in case of presence subservice ,need to fetch the contact ,so
       
   217 					// move to updating state
       
   218 					iSupportedSubServices[ i ].iSubServiceState = ESWSUpdatingContacts;	
       
   219 					}
       
   220 				else
       
   221 					{
       
   222 					// store the subservice state
       
   223 					iSupportedSubServices[ i ].iSubServiceState = swState;		
       
   224 					}
       
   225 				}
       
   226 			break; // break the loop if subservice matched	
       
   227 			}
       
   228 		}
       
   229 	TSWSTRegistrationState previousState = iServiceState;
       
   230 	// get best match state
       
   231 	iServiceState  = ParseGetServiceState();
       
   232 	
       
   233     if( iServiceState != previousState )
       
   234 		{
       
   235 		// inform the observer only if state changed
       
   236 		TRACE_SWP(TXT("CServiceWidgetCchHandler::ServiceStatusChanged() state changed") );
       
   237 		// some times give the same state call back more than one
       
   238 		TRAP_IGNORE( iStateObserver.HandleServiceStatusChangedL( iServiceState  ) );	
       
   239 		}
       
   240     TRACE_SWP(TXT("CServiceWidgetCchHandler::ServiceStatusChanged() end") );
       
   241     }
       
   242 
       
   243 // ---------------------------------------------------------------------------
       
   244 // CServiceWidgetCchHandler::ParseGetServiceState
       
   245 // ---------------------------------------------------------------------------
       
   246 //
       
   247 TSWSTRegistrationState CServiceWidgetCchHandler::ParseGetServiceState()
       
   248 	{
       
   249 	TRACE_SWP(TXT("CServiceWidgetCchHandler::ParseGetServiceState() start") );
       
   250 	
       
   251 	TInt serviceState = 0;
       
   252 	TInt subServiceCount = iSupportedSubServices.Count();
       
   253 	//Find the cumulative of the ServiceStates of all subservices
       
   254 	// iterate the service array
       
   255 	for ( TInt index = 0; index < subServiceCount ; index++ )        
       
   256 		{	
       
   257 		serviceState |= iSupportedSubServices[index].iSubServiceState;
       
   258 		}
       
   259 	TSWSTRegistrationState swState = ESWSNotRegistered;
       
   260 	//The logic below is that, if any one subservice not enabled for us the service is not enabled
       
   261 	//So to do this we assign priority for each service state
       
   262 	//Connecting gets the High Priority, when copmared to Waiting for Connection,
       
   263 	//Disconnecting, Registered, UnRegistered.
       
   264 	//By this way the Sevice Tab will be more usable and atleast we can perform operations
       
   265 	//related to the the logged in subservice
       
   266 	//its upto the connection handlers to do the job properly, whether to provide connectivity to all
       
   267 	//sub services or not.. 
       
   268 
       
   269 	//Start parsing and decide the state of the ServiceTab   
       
   270 	if ( serviceState & ESWSNetworkConnecting )
       
   271 		{
       
   272 		//Connecting	
       
   273 		swState = ESWSNetworkConnecting;
       
   274 		}
       
   275 	else if ( serviceState & ESWSWaitingForNetwork )
       
   276 		{
       
   277 		//Waiting for Connection	
       
   278 		swState = ESWSWaitingForNetwork;
       
   279 		}
       
   280 	else if ( serviceState & ESWSUpdatingContacts )
       
   281 		{
       
   282 		//Waiting for Connection	
       
   283 		swState = ESWSUpdatingContacts;
       
   284 		}	    	    
       
   285 	else if ( serviceState & ESWSNetworkDisConnecting )
       
   286 		{
       
   287 		//disconnecting	
       
   288 		swState = ESWSNetworkDisConnecting;
       
   289 		}   
       
   290 	else if ( serviceState & ESWSRegistered ) 
       
   291 		{
       
   292 		//Enabled	
       
   293 		swState = ESWSRegistered;
       
   294 		}
       
   295 	TRACE_SWP(TXT("CServiceWidgetCchHandler::ParseGetServiceState() end") );
       
   296 	return swState;   	
       
   297 	}
       
   298 // ---------------------------------------------------------------------------
       
   299 // CServiceWidgetCchHandler::GetServiceState
       
   300 // ---------------------------------------------------------------------------
       
   301 // 
       
   302 TSWSTRegistrationState CServiceWidgetCchHandler::GetServiceState( TCCHSubserviceType aServiceType )
       
   303     {
       
   304     TRACE_SWP(TXT("CServiceWidgetCchHandler::GetServiceState() start") );
       
   305     CCchService* service = iCchClient->GetService( iServiceId );
       
   306    	TCchServiceStatus status;
       
   307 	status.SetState(ECCHUninitialized);
       
   308 	if( service )
       
   309 		{
       
   310 		// Get status from the client
       
   311 	    service->GetStatus(  aServiceType , status );
       
   312 		}		
       
   313 	TRACE_SWP(TXT("CServiceWidgetCchHandler::GetServiceState() end") );
       
   314     return GetLocalServiceState( status.State() );
       
   315     }
       
   316 
       
   317 // ---------------------------------------------------------------------------
       
   318 // CServiceWidgetCchHandler::GetLocalServiceState
       
   319 // ---------------------------------------------------------------------------
       
   320 // 
       
   321 TSWSTRegistrationState CServiceWidgetCchHandler::GetLocalServiceState(TCCHSubserviceState aState )
       
   322     {
       
   323     TRACE_SWP(TXT("CServiceWidgetCchHandler::GetLocalServiceState() start") );
       
   324     TSWSTRegistrationState mappedState = ESWSNotRegistered;
       
   325 	if( ECCHConnecting == aState )
       
   326 		{
       
   327 		mappedState = ESWSNetworkConnecting;	
       
   328 		}
       
   329 	else if( ECCHDisconnecting == aState )
       
   330 		{
       
   331 		mappedState = ESWSNetworkDisConnecting;	
       
   332 		}
       
   333 	else if( ECCHDisabled == aState )
       
   334 		{
       
   335 		mappedState = ESWSNotRegistered;	
       
   336 		}
       
   337 	else if( ECCHEnabled == aState )
       
   338 		{
       
   339 		mappedState = ESWSRegistered;	
       
   340 		}
       
   341 	TRACE_SWP(TXT("CServiceWidgetCchHandler::GetLocalServiceState() end") );
       
   342    	return mappedState;
       
   343     }
       
   344 
       
   345 // ---------------------------------------------------------------------------
       
   346 // CServiceWidgetCchHandler::OwnUserIdL
       
   347 // ---------------------------------------------------------------------------
       
   348 // 
       
   349 const TDesC& CServiceWidgetCchHandler::OwnUserIdL()
       
   350     {
       
   351     TRACE_SWP(TXT("CServiceWidgetCchHandler::OwnUserIdL() start") );	
       
   352     if( iOwnData )
       
   353 		{
       
   354 		delete iOwnData;
       
   355 		iOwnData = NULL;	
       
   356 		}
       
   357 	
       
   358    // call back can not be modified ignore the error
       
   359 	iOwnData = GetConParametersL( ECchUsername );
       
   360 	if( iOwnData )
       
   361 	    {
       
   362 	    TRACE_SWP(TXT("CServiceWidgetCchHandler::OwnUserIdL() valid") );
       
   363 	    TRACE_SWP(TXT("CServiceWidgetCchHandler::OwnUserIdL() end") );	
       
   364 	   	return *iOwnData;	
       
   365 	    }
       
   366 	TRACE_SWP(TXT("CServiceWidgetCchHandler::OwnUserIdL() end") );	
       
   367     return KNullDesC ;
       
   368     }  
       
   369  
       
   370  // ---------------------------------------------------------------------------
       
   371 // CServiceWidgetCchHandler::XimpAdaptationUidL()
       
   372 // ---------------------------------------------------------------------------
       
   373 //
       
   374 TInt CServiceWidgetCchHandler::XimpAdaptationUidL()
       
   375     {
       
   376 	TRACE_SWP(TXT("CServiceWidgetCchHandler::XimpAdaptationUidL() start") );
       
   377     TInt ret = KErrNotFound;
       
   378     CSPSettings* settings = CSPSettings::NewLC(); 
       
   379     CSPProperty* property = CSPProperty::NewLC();
       
   380     TInt err = settings->FindPropertyL( iServiceId,
       
   381                                 EPropertyPCSPluginId,
       
   382                                 *property );    
       
   383     if (KErrNone == err)
       
   384 	    {
       
   385 	    TRACE_SWP(TXT("CServiceWidgetCchHandler::XimpAdaptationUidL() uid read") );
       
   386 	    property->GetValue( ret );
       
   387 	    }
       
   388     CleanupStack::PopAndDestroy(2);// property ,settings
       
   389     TRACE_SWP(TXT("CServiceWidgetCchHandler::XimpAdaptationUidL() end") );
       
   390     return ret;
       
   391     }        
       
   392     
       
   393  // ---------------------------------------------------------------------------
       
   394 // CServiceWidgetCchHandler::GetConParametersL
       
   395 // ---------------------------------------------------------------------------
       
   396 // 
       
   397 HBufC* CServiceWidgetCchHandler::GetConParametersL( TCchConnectionParameter aConnParam )
       
   398     {
       
   399     TRACE_SWP(TXT("CServiceWidgetCchHandler::GetConParametersL() start") );
       
   400     HBufC* temp = NULL;
       
   401     TInt error = KErrNotFound;
       
   402     if(iCchClient)  
       
   403 	    {
       
   404 		CCchService* service = iCchClient->GetService( iServiceId );    
       
   405 		if( service )
       
   406 		   {              
       
   407 		   RBuf buffer;
       
   408 	       CleanupClosePushL( buffer );
       
   409 		   buffer.CreateL(KIMW_MAX_LENGTH);
       
   410 		   error = service->GetConnectionParameter(ECCHUnknown,aConnParam,buffer);
       
   411 		   User::LeaveIfError( error);
       
   412 		   if( buffer.Length() > 0)
       
   413 		      {
       
   414 		      TRACE_SWP(TXT("CServiceWidgetCchHandler::GetConParametersL() buffer valid") );
       
   415               //extract only the user id in case
       
   416 		      // Check for prefix and remove if found
       
   417               TInt prefixLocation = buffer.Locate( ':' );
       
   418               if ( KErrNotFound != prefixLocation  && ECchUsername == aConnParam )
       
   419                   {
       
   420                   temp = buffer.Mid(prefixLocation+1 ).AllocL(); // ownership transferred  
       
   421                   }
       
   422               else
       
   423                   {
       
   424                   temp = buffer.AllocL(); // ownership transferred  
       
   425                   }
       
   426 		      }
       
   427 		   CleanupStack::PopAndDestroy( &buffer );
       
   428 		   }
       
   429 	    }
       
   430 	TRACE_SWP(TXT("CServiceWidgetCchHandler::GetConParametersL() end") );
       
   431     return temp;
       
   432     }
       
   433 
       
   434  // ---------------------------------------------------------------------------
       
   435 // CServiceWidgetCchHandler::IsServiceSupported
       
   436 // ---------------------------------------------------------------------------
       
   437 // 
       
   438 TBool CServiceWidgetCchHandler::IsServiceSupported(TCCHSubserviceType aSubServiceType )
       
   439 	{
       
   440 	TRACE_SWP(TXT("CServiceWidgetCchHandler::IsServiceSupported() start") );
       
   441 	TBool ret = EFalse;
       
   442    	if ( iCchClient )
       
   443 	   	{
       
   444 	   	CCchService* service = iCchClient->GetService( iServiceId );
       
   445 		if( service )
       
   446 			{
       
   447 			service->IsSupported(aSubServiceType, ret );
       
   448 			}		
       
   449 	   	}
       
   450 	TRACE_SWP(TXT("CServiceWidgetCchHandler::IsServiceSupported() end") );
       
   451  	return ret;   	
       
   452  	}
       
   453     
       
   454  // ---------------------------------------------------------------------------
       
   455 // CServiceWidgetCchHandler::IsSubServiceSupported
       
   456 // ---------------------------------------------------------------------------
       
   457 // 
       
   458 TBool CServiceWidgetCchHandler::IsSubServiceSupported(TCCHSubserviceType aSubServiceType )
       
   459 	{
       
   460 	TRACE_SWP(TXT("CServiceWidgetCchHandler::IsSubServiceSupported() start") );
       
   461 	TBool ret = EFalse;
       
   462    	TInt subServiceCount = iSupportedSubServices.Count();
       
   463 	//Find the cumulative of the ServiceStates of all subservices
       
   464 	// iterate the service array
       
   465 	for ( TInt index = 0; index < subServiceCount ; index++ )        
       
   466 		{	
       
   467 		if( iSupportedSubServices[index].iSubServiceType == aSubServiceType )
       
   468 			{
       
   469 			ret = ETrue;
       
   470 			break;	
       
   471 			}
       
   472 		}
       
   473 	TRACE_SWP(TXT("CServiceWidgetCchHandler::IsSubServiceSupported() end") );
       
   474  	return ret;   	
       
   475  	}   
       
   476 
       
   477 
       
   478 // ---------------------------------------------------------------------------
       
   479 // CServiceWidgetCchHandler::GetServiceViewIdL
       
   480 // ---------------------------------------------------------------------------
       
   481 // 
       
   482 TInt CServiceWidgetCchHandler::GetServiceViewIdL( TInt& aTabUid )
       
   483     {
       
   484     TInt serviceviewId = 0 ;
       
   485     if( iServiceId != KErrNotFound)
       
   486         {
       
   487         CSPSettings* spSettings = CSPSettings::NewL();
       
   488         CleanupStack::PushL(spSettings);
       
   489         //get the tabview id from settings
       
   490         CSPProperty* property = CSPProperty::NewLC();
       
   491         spSettings->FindPropertyL( iServiceId,
       
   492                 EPropertyContactViewId,
       
   493                 *property );    
       
   494         property->GetValue(serviceviewId);
       
   495         
       
   496         //get the tab uid from settings
       
   497         spSettings->FindPropertyL( iServiceId,
       
   498                 EPropertyContactViewPluginId,
       
   499                 *property );    
       
   500         property->GetValue(aTabUid);
       
   501         
       
   502         CleanupStack::PopAndDestroy( property );  
       
   503         CleanupStack::PopAndDestroy( spSettings );
       
   504         }
       
   505     return serviceviewId;
       
   506     }
       
   507 
       
   508 // ---------------------------------------------------------------------------
       
   509 // CServiceWidgetCchHandler::EnableServiceL
       
   510 // 
       
   511 // ---------------------------------------------------------------------------
       
   512 //
       
   513 TInt CServiceWidgetCchHandler::EnableServiceL( )
       
   514     {
       
   515     TRACE_SWP(TXT("CServiceWidgetCchHandler::EnableServiceL() start") );
       
   516     TInt error = KErrNotFound;
       
   517 
       
   518     if( iCchClient  )
       
   519         {
       
   520 		iCchClient->SetConnectivityDialogsAllowed( ETrue );
       
   521         CCchService* service = iCchClient->GetService( iServiceId );
       
   522         if( service )
       
   523             {
       
   524             error = service->Enable( ECCHUnknown );
       
   525             }
       
   526         }
       
   527     return error;
       
   528     }
       
   529  // end of file
       
   530