photosgallery/viewframework/medialists/tsrc/src/glxlistreconstruction.inl
changeset 0 4e91876724a2
equal deleted inserted replaced
-1:000000000000 0:4e91876724a2
       
     1 /*
       
     2 * Copyright (c) 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:    Class that reconstructs a list from notifications
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 // CONSTRUCTION
       
    22 
       
    23 #include "glxmedia.h"
       
    24 
       
    25 template < class _ListClass >
       
    26 inline CGlxListReconstruction< _ListClass >::CGlxListReconstruction()
       
    27     {
       
    28     }
       
    29 
       
    30 template < class _ListClass >
       
    31 inline void CGlxListReconstruction< _ListClass >::SetList( _ListClass& aList )
       
    32     {
       
    33     iList = &aList;
       
    34     }
       
    35     
       
    36 template < class _ListClass >
       
    37 inline const TGlxMediaId& CGlxListReconstruction< _ListClass >::OriginalItem( TInt aIndex ) const    
       
    38     {
       
    39     return iList->Item( aIndex ).Id();
       
    40     }
       
    41         
       
    42 template < class _ListClass >
       
    43 inline TBool CGlxListReconstruction< _ListClass >::ItemsEqual() const
       
    44     {
       
    45     // test lengths match
       
    46     TBool fail = ( iList->Count() != iReconstructedList.Count() );
       
    47     // test all items are the same
       
    48     TInt i = 0;
       
    49     while ( i < iList->Count() && !fail )
       
    50         {
       
    51         fail |= ( iList->Item( i ).Id() == iReconstructedList[ i ] );
       
    52         i++;
       
    53         }
       
    54     return !fail;
       
    55     }
       
    56