profilesservices/ProfileEngine/WrapperSrc/CProEngProfileNameArrayImpl.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Mon, 21 Jun 2010 15:59:17 +0300
branchRCL_3
changeset 41 3b67655da2cc
parent 0 8c5d936e5675
permissions -rw-r--r--
Revision: 201023 Kit: 2010125

/*
* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:  Implementation of CProEngProfileNameArrayImpl.
*
*/



// INCLUDE FILES
#include    "CProEngProfileNameArrayImpl.h"
#include    <MProfilesNamesArray.h>
#include    <MProfileName.h>

// ============================ MEMBER FUNCTIONS ===============================

// -----------------------------------------------------------------------------
// CProEngProfileNameArrayImpl::CProEngProfileNameArrayImpl
// -----------------------------------------------------------------------------
//
CProEngProfileNameArrayImpl::CProEngProfileNameArrayImpl(
        MProfilesNamesArray* aProfilesNamesArray )
        : iProfilesNamesArray( aProfilesNamesArray )
    {
    }

// -----------------------------------------------------------------------------
// CProEngProfileNameArrayImpl::NewL
// Two-phased constructor.
// -----------------------------------------------------------------------------
//
CProEngProfileNameArrayImpl* CProEngProfileNameArrayImpl::NewL(
        MProfilesNamesArray* aProfilesNamesArray )
    {
    return new ( ELeave ) CProEngProfileNameArrayImpl( aProfilesNamesArray );
    }

// Destructor
CProEngProfileNameArrayImpl::~CProEngProfileNameArrayImpl()
    {
    delete iProfilesNamesArray;
    }

// -----------------------------------------------------------------------------
// CProEngProfileNameArrayImpl::MdcaCount
// -----------------------------------------------------------------------------
//
TInt CProEngProfileNameArrayImpl::MdcaCount() const
    {
    return iProfilesNamesArray->MdcaCount();
    }

// -----------------------------------------------------------------------------
// CProEngProfileNameArrayImpl::MdcaPoint
// -----------------------------------------------------------------------------
//
TPtrC CProEngProfileNameArrayImpl::MdcaPoint( TInt aIndex ) const
    {
    const MProfileName* profileName =
        iProfilesNamesArray->ProfileName( aIndex );

    if( profileName )
        {
        return profileName->Name();
        }

    return KNullDesC();
    }

// -----------------------------------------------------------------------------
// CProEngProfileNameArrayImpl::ProfileId
// -----------------------------------------------------------------------------
//
TInt CProEngProfileNameArrayImpl::ProfileId( TInt aIndex ) const
    {
    const MProfileName* profileName =
        iProfilesNamesArray->ProfileName( aIndex );

    if( profileName )
        {
        return profileName->Id();
        }

    return KErrNotFound;
    }

// -----------------------------------------------------------------------------
// CProEngProfileNameArrayImpl::FindById
// -----------------------------------------------------------------------------
//
TInt CProEngProfileNameArrayImpl::FindById( TInt aId ) const
    {
    return iProfilesNamesArray->FindById( aId );
    }

// -----------------------------------------------------------------------------
// CProEngProfileNameArrayImpl::FindByName
// -----------------------------------------------------------------------------
//
TInt CProEngProfileNameArrayImpl::FindByName( const TDesC& aProfileName ) const
    {
    return iProfilesNamesArray->FindByName( aProfileName );
    }

//  End of File