uifw/ganes/src/HgDoubleGraphicListFlat.cpp
changeset 47 2f0c06423c72
parent 46 0e1e0022bd03
child 53 3c67ea82fafc
equal deleted inserted replaced
46:0e1e0022bd03 47:2f0c06423c72
     1 /*
       
     2 * Copyright (c) 2009 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 *
       
    16 */
       
    17 
       
    18 
       
    19 #include <ganes/HgDoubleGraphicListFlat.h>
       
    20 #include <ganes/HgItem.h>
       
    21 #include "HgMarquee.h"
       
    22 #include "HgLayoutData.h"
       
    23 #include "HgIndicatorManager.h"
       
    24 #include "HgDrawUtils.h"
       
    25 #include "HgConstants.h"
       
    26 
       
    27 
       
    28 #include <AknsUtils.h>
       
    29 #include <AknUtils.h>
       
    30 #include <AknsDrawUtils.h>
       
    31 
       
    32 #include <layoutmetadata.cdl.h>
       
    33 #include <aknlayoutscalable_avkon.cdl.h>
       
    34 #include <gulicon.h>
       
    35 
       
    36 using namespace AknLayoutScalable_Avkon;
       
    37 
       
    38 // -----------------------------------------------------------------------------
       
    39 // CHgDoubleGraphicListFlat::NewL()
       
    40 // -----------------------------------------------------------------------------
       
    41 //
       
    42 EXPORT_C CHgDoubleGraphicListFlat* CHgDoubleGraphicListFlat::NewL(
       
    43         const TRect& aRect, 
       
    44         TInt aItemCount, 
       
    45         CGulIcon* aDefaultIcon,
       
    46         RWsSession* aSession)
       
    47     {
       
    48     CHgDoubleGraphicListFlat* self = new ( ELeave ) CHgDoubleGraphicListFlat( 
       
    49             aItemCount, 
       
    50             aDefaultIcon );
       
    51 
       
    52     CleanupStack::PushL (self );
       
    53     self->ConstructL( aRect, aSession );
       
    54     CleanupStack::Pop (self );
       
    55     return self;
       
    56     }
       
    57 
       
    58 // -----------------------------------------------------------------------------
       
    59 // CHgDoubleGraphicListFlat::~CHgDoubleGraphicListFlat()
       
    60 // -----------------------------------------------------------------------------
       
    61 //
       
    62 EXPORT_C CHgDoubleGraphicListFlat::~CHgDoubleGraphicListFlat( )
       
    63     {
       
    64     
       
    65     }
       
    66 
       
    67 // -----------------------------------------------------------------------------
       
    68 // CHgDoubleGraphicListFlat::PreferredImageSize()
       
    69 // -----------------------------------------------------------------------------
       
    70 //
       
    71 EXPORT_C TSize CHgDoubleGraphicListFlat::PreferredImageSize()
       
    72     {
       
    73     TAknLayoutRect image;
       
    74     image.LayoutRect(TRect(), AknLayoutScalable_Avkon::list_double_large_graphic_pane_g1( 0 ));
       
    75     return image.Rect().Size();
       
    76     }
       
    77 
       
    78 // -----------------------------------------------------------------------------
       
    79 // CHgDoubleGraphicListFlat::HandleSizeChanged()
       
    80 // -----------------------------------------------------------------------------
       
    81 //
       
    82 void CHgDoubleGraphicListFlat::HandleSizeChanged()
       
    83     {
       
    84     // Call base implementation
       
    85     CHgDoubleGraphicList::HandleSizeChanged();
       
    86 
       
    87     iHeight = Rect().Height();
       
    88     
       
    89     if(iHeight % iRowHeight) iItemsOnScreen++;
       
    90     
       
    91     if( iCurrentRow != KErrNotFound )
       
    92         FitTopItemToView( iCurrentRow );
       
    93     }
       
    94 
       
    95 // -----------------------------------------------------------------------------
       
    96 // CHgDoubleGraphicListFlat::DrawItem()
       
    97 // -----------------------------------------------------------------------------
       
    98 //
       
    99 void CHgDoubleGraphicListFlat::DrawItem( TInt aIndex, const TRect& aRect ) const
       
   100     {
       
   101     CHgDoubleGraphicList::DrawItem( aIndex, aRect );
       
   102     }
       
   103 
       
   104 // -----------------------------------------------------------------------------
       
   105 // CHgDoubleGraphicListFlat::CHgDoubleGraphicListFlat()
       
   106 // -----------------------------------------------------------------------------
       
   107 //
       
   108 CHgDoubleGraphicListFlat::CHgDoubleGraphicListFlat( TInt aItemCount, 
       
   109                                             CGulIcon* aDefaultIcon )
       
   110 : CHgDoubleGraphicList( aItemCount, aDefaultIcon )
       
   111     {
       
   112     SetFlags( EHgScrollerFlatStatusPane ); // Set Flat status pane on
       
   113     }
       
   114