コード例 #1
0
void T_CSPSettings::T_CSPSettings_CheckSupportedLsL(  )
    {    
    // Test CheckSupportedL( TServiceId aServiceId, const RPropertyNameArray& aNameArray )
    
    CSPProperty* property = CSPProperty::NewLC();
    iCSPSettings->FindPropertyL( 0, EPropertyVoIPSubServicePluginId, *property );
    iCSPSettings->FindPropertyL( 2, EPropertyVoIPSubServicePluginId, *property );
    CleanupStack::PopAndDestroy( property );

    
    // Test CheckSupportedL( TServiceId aServiceId )
    
    CSPEntry* entry = CSPEntry::NewLC();
    iCSPSettings->FindEntryL( 0, *entry );
    entry->SetServiceId( 2 );
    iCSPSettings->FindEntryL( 2, *entry );
    CleanupStack::PopAndDestroy( entry );
    
    
    // Test CheckSupportedL( TSPItemType aPropertyType )
    
    RPropertyArray* propertyArray = new (ELeave) RPropertyArray( 3 );
    CleanupStack::PushL( propertyArray );
    iCSPSettings->FindSubServicePropertiesL( 0, EItemTypeVMBXSubProperty, *propertyArray );

    
    // Test CheckSupportedL( const RPropertyArray& aPropertyArray )
    
    RIdArray serviceIds;
    CleanupClosePushL( serviceIds );
    iCSPSettings->FindServiceIdsFromPropertiesL( *propertyArray, serviceIds );

    CleanupStack::PopAndDestroy( &serviceIds );    
    CleanupStack::PopAndDestroy( propertyArray );
    }
コード例 #2
0
// ---------------------------------------------------------------------------
// Stores new service provider settings entry
// ---------------------------------------------------------------------------
//
void CSPSettingsEngine::AddEntryL( CSPEntry& aEntry )
    {
    XSPSLOGSTRING( "CSPSettingsEngine::AddEntryL() - IN" );
    
    // check the service name is not empty
    if( aEntry.GetServiceName().Length() == 0 )
        {
        User::LeaveIfError( KErrArgument );
        }

    // construct RIpAppPropArray
    RIpAppPropArray array;
    TCleanupItem cleanup( CSPSettingsEngine::CleanupPointerArray, &array );
    CleanupStack::PushL( cleanup );
    
    ConvertSpEntryToCenRepArrayL( aEntry, array );

    // Create new unique service ID
    TInt newId = 0;
    iCenRepUtils->AddEntryL( newId, array );
    aEntry.SetServiceId( newId );
    
    CleanupStack::PopAndDestroy( &array );
    
    XSPSLOGSTRING( "CSPSettingsEngine::AddEntryL() - OUT" );
    }
コード例 #3
0
// ---------------------------------------------------------------------------
// Find service provider settings entry by service ID
// ---------------------------------------------------------------------------
//
 TInt CSPSettingsEngine::FindEntryL( TServiceId aServiceId, CSPEntry& aEntry )
    {
    XSPSLOGSTRING2( "CSPSettingsEngine::FindEntryL( %d ) - IN", aServiceId );
    
    RIpAppPropArray array;
    TCleanupItem cleanup( CSPSettingsEngine::CleanupPointerArray, &array );
    CleanupStack::PushL( cleanup );

    TInt err = iCenRepUtils->FindEntryL( aServiceId, array );
    
    if( err == KErrNone )
        {
        TInt count = array.Count();

        for( TInt i = 0; i < count; i++ )
            {
            CCenRepDatabaseProperty* property = array[i];
            
            if( property->GetName() == EServiceName )
                {
                User::LeaveIfError( aEntry.SetServiceName( property->GetDesValue() ) );
                }
            else
                {
                CSPProperty* spProperty = CSPProperty::NewLC();
                User::LeaveIfError( spProperty->SetName( (TServicePropertyName)( property->GetName() )));
                User::LeaveIfError( spProperty->SetValue( property->GetDesValue() ));
                
                User::LeaveIfError( aEntry.AddPropertyL( *spProperty ));
                CleanupStack::PopAndDestroy( spProperty );
                }
            }
        }
    CleanupStack::PopAndDestroy( &array );
    
    aEntry.SetServiceId( aServiceId );
    
    XSPSLOGSTRING2( "CSPSettingsEngine::FindEntryL( %d ) - OUT", aServiceId );
    
    return err;
    }