profilesservices/ProfileEngine/WrapperSrc/CProEngProfileNameArrayImpl.cpp
changeset 0 8c5d936e5675
equal deleted inserted replaced
-1:000000000000 0:8c5d936e5675
       
     1 /*
       
     2 * Copyright (c) 2002-2004 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 CProEngProfileNameArrayImpl.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21 #include    "CProEngProfileNameArrayImpl.h"
       
    22 #include    <MProfilesNamesArray.h>
       
    23 #include    <MProfileName.h>
       
    24 
       
    25 // ============================ MEMBER FUNCTIONS ===============================
       
    26 
       
    27 // -----------------------------------------------------------------------------
       
    28 // CProEngProfileNameArrayImpl::CProEngProfileNameArrayImpl
       
    29 // -----------------------------------------------------------------------------
       
    30 //
       
    31 CProEngProfileNameArrayImpl::CProEngProfileNameArrayImpl(
       
    32         MProfilesNamesArray* aProfilesNamesArray )
       
    33         : iProfilesNamesArray( aProfilesNamesArray )
       
    34     {
       
    35     }
       
    36 
       
    37 // -----------------------------------------------------------------------------
       
    38 // CProEngProfileNameArrayImpl::NewL
       
    39 // Two-phased constructor.
       
    40 // -----------------------------------------------------------------------------
       
    41 //
       
    42 CProEngProfileNameArrayImpl* CProEngProfileNameArrayImpl::NewL(
       
    43         MProfilesNamesArray* aProfilesNamesArray )
       
    44     {
       
    45     return new ( ELeave ) CProEngProfileNameArrayImpl( aProfilesNamesArray );
       
    46     }
       
    47 
       
    48 // Destructor
       
    49 CProEngProfileNameArrayImpl::~CProEngProfileNameArrayImpl()
       
    50     {
       
    51     delete iProfilesNamesArray;
       
    52     }
       
    53 
       
    54 // -----------------------------------------------------------------------------
       
    55 // CProEngProfileNameArrayImpl::MdcaCount
       
    56 // -----------------------------------------------------------------------------
       
    57 //
       
    58 TInt CProEngProfileNameArrayImpl::MdcaCount() const
       
    59     {
       
    60     return iProfilesNamesArray->MdcaCount();
       
    61     }
       
    62 
       
    63 // -----------------------------------------------------------------------------
       
    64 // CProEngProfileNameArrayImpl::MdcaPoint
       
    65 // -----------------------------------------------------------------------------
       
    66 //
       
    67 TPtrC CProEngProfileNameArrayImpl::MdcaPoint( TInt aIndex ) const
       
    68     {
       
    69     const MProfileName* profileName =
       
    70         iProfilesNamesArray->ProfileName( aIndex );
       
    71 
       
    72     if( profileName )
       
    73         {
       
    74         return profileName->Name();
       
    75         }
       
    76 
       
    77     return KNullDesC();
       
    78     }
       
    79 
       
    80 // -----------------------------------------------------------------------------
       
    81 // CProEngProfileNameArrayImpl::ProfileId
       
    82 // -----------------------------------------------------------------------------
       
    83 //
       
    84 TInt CProEngProfileNameArrayImpl::ProfileId( TInt aIndex ) const
       
    85     {
       
    86     const MProfileName* profileName =
       
    87         iProfilesNamesArray->ProfileName( aIndex );
       
    88 
       
    89     if( profileName )
       
    90         {
       
    91         return profileName->Id();
       
    92         }
       
    93 
       
    94     return KErrNotFound;
       
    95     }
       
    96 
       
    97 // -----------------------------------------------------------------------------
       
    98 // CProEngProfileNameArrayImpl::FindById
       
    99 // -----------------------------------------------------------------------------
       
   100 //
       
   101 TInt CProEngProfileNameArrayImpl::FindById( TInt aId ) const
       
   102     {
       
   103     return iProfilesNamesArray->FindById( aId );
       
   104     }
       
   105 
       
   106 // -----------------------------------------------------------------------------
       
   107 // CProEngProfileNameArrayImpl::FindByName
       
   108 // -----------------------------------------------------------------------------
       
   109 //
       
   110 TInt CProEngProfileNameArrayImpl::FindByName( const TDesC& aProfileName ) const
       
   111     {
       
   112     return iProfilesNamesArray->FindByName( aProfileName );
       
   113     }
       
   114 
       
   115 //  End of File
       
   116