phonebookui/Phonebook/View/src/CPbkFetchDlgPages.cpp
changeset 0 e686773b3f54
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /*
       
     2 * Copyright (c) 2002 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: 
       
    15 *       Provides methods for MPbkFetchDlgPages implementation.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21 #include "CPbkFetchDlgPages.h"
       
    22 
       
    23 
       
    24 // ================= MEMBER FUNCTIONS =======================
       
    25 
       
    26 CPbkFetchDlgPages::~CPbkFetchDlgPages()
       
    27     {
       
    28     for (TInt i=iPages.Count()-1; i>=0; --i)
       
    29         {
       
    30         delete iPages[i];
       
    31         }
       
    32     iPages.Close();
       
    33     }
       
    34 
       
    35 TInt CPbkFetchDlgPages::DlgPageCount() const
       
    36     {
       
    37     return iPages.Count();
       
    38     }
       
    39 
       
    40 MPbkFetchDlgPage& CPbkFetchDlgPages::DlgPageAt(TInt aIndex) const
       
    41     {
       
    42     return *const_cast<MPbkFetchDlgPage*>(iPages[aIndex]);
       
    43     }
       
    44 
       
    45 MPbkFetchDlgPage* CPbkFetchDlgPages::DlgPageWithId(TInt aPageId) const
       
    46     {
       
    47     const TInt count = iPages.Count();
       
    48     for (TInt i=0; i < count; ++i)
       
    49         {
       
    50         const MPbkFetchDlgPage* page = iPages[i];
       
    51         if (page->FetchDlgPageId() == aPageId)
       
    52             {
       
    53             return const_cast<MPbkFetchDlgPage*>(page);
       
    54             }
       
    55         }
       
    56     return NULL;
       
    57     }
       
    58 
       
    59 
       
    60 // End of File