phonebookui/Phonebook2/UIControls/inc/CPbk2ContactViewIterator.h
branchRCL_3
changeset 20 f4a778e096c2
parent 0 e686773b3f54
equal deleted inserted replaced
19:5b6f26637ad3 20:f4a778e096c2
       
     1 /*
       
     2 * Copyright (c) 2005-2007 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:  Phonebook 2 contact link iterator.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPBK2CONTACTVIEWITERATOR_H
       
    20 #define CPBK2CONTACTVIEWITERATOR_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <MPbk2ContactLinkIterator.h>
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class MVPbkContactViewBase;
       
    28 
       
    29 // CLASS DECLARATIONS
       
    30 NONSHARABLE_CLASS( CPbk2ContactViewIterator ) : public CBase,
       
    31                                                 public MPbk2ContactLinkIterator
       
    32     {
       
    33     public: // Constructors and destructor
       
    34 
       
    35         /**
       
    36          * Creates a new instance of this class.
       
    37          *
       
    38          * @param aView             Contact view base.
       
    39          * @param aSelectedIndexes  Array of selected indexes.
       
    40          * @return  A new instance of this class.
       
    41          */
       
    42         static CPbk2ContactViewIterator* NewLC(
       
    43                 MVPbkContactViewBase& aView,
       
    44                 TArray<TInt> aSelectedIndexes );
       
    45 
       
    46         /**
       
    47          * Destructor.
       
    48          */
       
    49         ~CPbk2ContactViewIterator();
       
    50 
       
    51     public: // From MPbk2ContactLinkIterator
       
    52         TBool HasNext() const;
       
    53         TBool HasPrevious() const;
       
    54         MVPbkContactLink* NextL();
       
    55         MVPbkContactLink* PreviousL();
       
    56         void SetToFirst();
       
    57         void SetToLast();
       
    58 
       
    59     private: // Implementation
       
    60         CPbk2ContactViewIterator(
       
    61                 MVPbkContactViewBase& aView,
       
    62                 TArray<TInt> aSelectedIndexes );
       
    63 
       
    64     private: // Data
       
    65         /// Ref: Contact view
       
    66         MVPbkContactViewBase& iView;
       
    67         /// Ref: Selected indexes
       
    68         TArray<TInt> iSelectedIndexes;
       
    69         /// Own: Current index
       
    70         TInt iCursor;
       
    71     };
       
    72 
       
    73 #endif // CPBK2CONTACTVIEWITERATOR_H
       
    74 
       
    75 // End of File