convergedconnectionhandler/cchclientapi/src/cchuispshandler.cpp
branchRCL_3
changeset 21 f742655b05bf
parent 20 65a3ef1d5bd0
child 22 d38647835c2e
equal deleted inserted replaced
20:65a3ef1d5bd0 21:f742655b05bf
     1 /*
       
     2 * Copyright (c) 2008-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:  Implementation of class CCchUiSpsHandler.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include <spentry.h>
       
    20 #include <spsettings.h>
       
    21 #include <spproperty.h>
       
    22 #include <spdefinitions.h>
       
    23 
       
    24 #include "cchuilogger.h"
       
    25 #include "cchuispshandler.h"
       
    26 
       
    27 
       
    28 // ======== MEMBER FUNCTIONS ========
       
    29 
       
    30 CCchUiSpsHandler::CCchUiSpsHandler()
       
    31     {
       
    32     }
       
    33 
       
    34 void CCchUiSpsHandler::ConstructL()
       
    35     {
       
    36     CCHUIDEBUG( "CCchUiSpsHandler::ConstructL - IN" );
       
    37     
       
    38     iSettings = CSPSettings::NewL();
       
    39     
       
    40     CCHUIDEBUG( "CCchUiSpsHandler::ConstructL - OUT" );
       
    41     }
       
    42 
       
    43 CCchUiSpsHandler* CCchUiSpsHandler::NewL()
       
    44     {
       
    45     CCchUiSpsHandler* self = NewLC();
       
    46     CleanupStack::Pop(self);
       
    47     return self;
       
    48     }
       
    49 
       
    50 CCchUiSpsHandler* CCchUiSpsHandler::NewLC()
       
    51     {
       
    52     CCchUiSpsHandler* self = new (ELeave) CCchUiSpsHandler();
       
    53     CleanupStack::PushL(self);
       
    54     self->ConstructL();
       
    55     return self;
       
    56     }
       
    57 
       
    58 CCchUiSpsHandler::~CCchUiSpsHandler()
       
    59     {
       
    60     delete iSettings;
       
    61     }
       
    62 
       
    63 // ---------------------------------------------------------------------------
       
    64 // Set temprorary iap id.
       
    65 // ---------------------------------------------------------------------------
       
    66 //
       
    67 void CCchUiSpsHandler::SetTemporaryIapIdL( 
       
    68     TUint32 aServiceId, TUint32 aIapId )
       
    69     {
       
    70     CCHUIDEBUG( "CCchUiSpsHandler::SetTemporaryIapIdL - IN" );    
       
    71     
       
    72     CSPProperty* property = CSPProperty::NewLC();
       
    73     User::LeaveIfError( 
       
    74         property->SetName( ESubPropertyVoIPTemporaryIAPId ) );
       
    75     User::LeaveIfError( property->SetValue( aIapId ) );
       
    76             
       
    77     iSettings->AddOrUpdatePropertyL( aServiceId, *property );
       
    78     CleanupStack::PopAndDestroy( property );
       
    79     
       
    80     CCHUIDEBUG( "CCchUiSpsHandler::SetTemporaryIapIdL - OUT" );
       
    81     }
       
    82 
       
    83 // ---------------------------------------------------------------------------
       
    84 // Set snap id.
       
    85 // ---------------------------------------------------------------------------
       
    86 //
       
    87 void CCchUiSpsHandler::SetSnapIdL( 
       
    88     TUint32 aServiceId, TUint32 aSnapId )
       
    89     {
       
    90     CCHUIDEBUG( "CCchUiSpsHandler::SetSnapIdL - IN" );    
       
    91     
       
    92     CSPProperty* property = CSPProperty::NewLC();
       
    93     User::LeaveIfError( 
       
    94         property->SetName( ESubPropertyVoIPPreferredSNAPId ) );
       
    95     User::LeaveIfError( property->SetValue( aSnapId ) );
       
    96         
       
    97     iSettings->AddOrUpdatePropertyL( aServiceId, *property );
       
    98     CleanupStack::PopAndDestroy( property );
       
    99     
       
   100     CCHUIDEBUG( "CCchUiSpsHandler::SetSnapIdL - OUT" );    
       
   101     }      
       
   102     
       
   103 // ---------------------------------------------------------------------------
       
   104 // Resolves service name
       
   105 // ---------------------------------------------------------------------------
       
   106 //
       
   107 void CCchUiSpsHandler::ServiceNameL( 
       
   108     TUint32 aServiceId, TDes& aServiceName )
       
   109     {
       
   110     CCHUIDEBUG( "CCchUiSpsHandler::ServiceNameL - IN" );    
       
   111 	
       
   112     CSPEntry* entry = CSPEntry::NewLC();
       
   113 	TInt err = iSettings->FindEntryL( aServiceId, *entry );
       
   114 	
       
   115 	if ( !err )
       
   116 	    {
       
   117 	    aServiceName = entry->GetServiceName();
       
   118 	    }
       
   119 	
       
   120 	CleanupStack::PopAndDestroy( entry );    
       
   121     
       
   122 	CCHUIDEBUG( "CCchUiSpsHandler::ServiceNameL - OUT" );    
       
   123     }          
       
   124