mpxplugins/viewplugins/views/collectionviewhg/inc/mpxcollectionviewhgswitchbuffer.h
branchRCL_3
changeset 15 a1247965635c
equal deleted inserted replaced
14:c54d95799c80 15:a1247965635c
       
     1 /*
       
     2 * Copyright (c) 2006 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: Defines a container for buffer switch handling.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef MPXCOLLECTIONVIEWHGSWITCHBUFFER_H_
       
    19 #define MPXCOLLECTIONVIEWHGSWITCHBUFFER_H_
       
    20 
       
    21 #include <e32base.h>
       
    22 
       
    23 class CHgScroller;
       
    24 class CHgVgMediaWall;
       
    25 class CGulIcon;
       
    26 
       
    27 NONSHARABLE_CLASS(CMPXCollectionViewHgSwitchBuffer) : public CBase
       
    28     {
       
    29 public:
       
    30 
       
    31     static CMPXCollectionViewHgSwitchBuffer* CreateBufferLC( CHgScroller& aScroller );
       
    32 
       
    33     static CMPXCollectionViewHgSwitchBuffer* CreateBufferLC( CHgVgMediaWall& aMediaWall );
       
    34 
       
    35     virtual ~CMPXCollectionViewHgSwitchBuffer();
       
    36 
       
    37 public:
       
    38     void FillFromBufferL( CHgVgMediaWall& aMediaWall );
       
    39     void FillFromBufferL( CHgScroller& aScroller, TSize aSize );
       
    40     void SetIndexOffset( TInt aOffset );
       
    41 
       
    42 protected:
       
    43     CMPXCollectionViewHgSwitchBuffer();
       
    44 
       
    45 protected:
       
    46     void AddToBufferL( CGulIcon& aIcon, TInt aIndex );
       
    47 
       
    48 private:
       
    49     NONSHARABLE_CLASS( CBufferItem ) : public CBase
       
    50         {
       
    51     public:
       
    52         CBufferItem(CGulIcon* aIcon, TInt aIndex)
       
    53         : iIcon( aIcon ), iIndex( aIndex )
       
    54             {
       
    55 
       
    56             }
       
    57 
       
    58         virtual ~CBufferItem()
       
    59             {
       
    60             delete iIcon;
       
    61             iIcon = NULL;
       
    62             }
       
    63 
       
    64         /**
       
    65          *
       
    66          */
       
    67         CGulIcon* GetIcon()
       
    68             {
       
    69             CGulIcon* icon = iIcon;
       
    70             iIcon = NULL;
       
    71             return icon;
       
    72             }
       
    73 
       
    74         /**
       
    75          *
       
    76          */
       
    77         TInt Index()
       
    78             {
       
    79             return iIndex;
       
    80             }
       
    81 
       
    82         private:
       
    83         CGulIcon* iIcon;
       
    84         TInt iIndex;
       
    85         };
       
    86 
       
    87     RPointerArray<CBufferItem> iBuffer;
       
    88     TInt iOffset;
       
    89     };
       
    90 
       
    91 
       
    92 #endif /* MPXCOLLECTIONVIEWHGSWITCHBUFFER_H_ */