videocollection/hgmyvideos/src/vcxhgmyvideoscategorylistimpl.cpp
changeset 0 96612d01cf9f
child 8 ce5ada96ab30
equal deleted inserted replaced
-1:000000000000 0:96612d01cf9f
       
     1 /*
       
     2 * Copyright (c) 2008 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 the License "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:      Implementation of UI functionality for category list.*
       
    15 */
       
    16 
       
    17 
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21 #include <ganes/HgScroller.h>
       
    22 #include <vcxhgmyvideos.rsg>
       
    23 
       
    24 #include "vcxhgmyvideoscategorylistimpl.h"
       
    25 #include "vcxhgmyvideoscategorymodelhandler.h"
       
    26 #include "vcxhgmyvideosmodel.h"
       
    27 #include "vcxhgmyvideosmainview.h"
       
    28 #include "vcxhgmyvideoscollectionclient.h"
       
    29 
       
    30 // ============================ MEMBER FUNCTIONS ===============================
       
    31 
       
    32 // -----------------------------------------------------------------------------
       
    33 // CVcxHgMyVideosCategoryListImpl::NewL()
       
    34 // -----------------------------------------------------------------------------
       
    35 //
       
    36 CVcxHgMyVideosCategoryListImpl* CVcxHgMyVideosCategoryListImpl::NewL(
       
    37         CVcxHgMyVideosModel& aModel,
       
    38         CVcxHgMyVideosMainView& aView,
       
    39         CHgScroller& aScroller )
       
    40     {
       
    41     CVcxHgMyVideosCategoryListImpl* self = 
       
    42         CVcxHgMyVideosCategoryListImpl::NewLC( aModel, aView, aScroller );
       
    43     CleanupStack::Pop( self );
       
    44     return self;
       
    45     }
       
    46 
       
    47 // -----------------------------------------------------------------------------
       
    48 // CVcxHgMyVideosCategoryListImpl::NewLC()
       
    49 // -----------------------------------------------------------------------------
       
    50 //
       
    51 CVcxHgMyVideosCategoryListImpl* CVcxHgMyVideosCategoryListImpl::NewLC(
       
    52         CVcxHgMyVideosModel& aModel,
       
    53         CVcxHgMyVideosMainView& aView,
       
    54         CHgScroller& aScroller )
       
    55     {
       
    56     CVcxHgMyVideosCategoryListImpl* self = 
       
    57         new (ELeave) CVcxHgMyVideosCategoryListImpl( aModel, aView, aScroller );
       
    58     CleanupStack::PushL( self );
       
    59     self->ConstructL();
       
    60     return self;
       
    61     }
       
    62     
       
    63 // -----------------------------------------------------------------------------
       
    64 // CVcxHgMyVideosCategoryListImpl::CVcxHgMyVideosCategoryListImpl()
       
    65 // -----------------------------------------------------------------------------
       
    66 //
       
    67 CVcxHgMyVideosCategoryListImpl::CVcxHgMyVideosCategoryListImpl( 
       
    68         CVcxHgMyVideosModel& aModel,
       
    69         CVcxHgMyVideosMainView& aView,
       
    70         CHgScroller& aScroller )
       
    71     : CVcxHgMyVideosListBase( aModel, aView, aScroller ) 
       
    72     {
       
    73     }
       
    74 
       
    75 // -----------------------------------------------------------------------------
       
    76 // CVcxHgMyVideosCategoryListImpl::ConstructL()
       
    77 // -----------------------------------------------------------------------------
       
    78 //
       
    79 void CVcxHgMyVideosCategoryListImpl::ConstructL()
       
    80     {
       
    81     CVcxHgMyVideosListBase::ConstructL();
       
    82     iCategoryModel = new (ELeave) CVcxHgMyVideosCategoryModelHandler( iModel, *iScroller );
       
    83     iScroller->SetFlags( CHgScroller::EHgScrollerKeyMarkingDisabled );
       
    84     iScroller->SetSelectionObserver( *this );
       
    85     }
       
    86 
       
    87 // -----------------------------------------------------------------------------
       
    88 // CVcxHgMyVideosCategoryListImpl::~CVcxHgMyVideosCategoryListImpl()
       
    89 // -----------------------------------------------------------------------------
       
    90 //
       
    91 CVcxHgMyVideosCategoryListImpl::~CVcxHgMyVideosCategoryListImpl()
       
    92     {
       
    93     delete iCategoryModel;
       
    94     }
       
    95 
       
    96 // -----------------------------------------------------------------------------
       
    97 // CVcxHgMyVideosCategoryListImpl::DoListActivateL()
       
    98 // -----------------------------------------------------------------------------
       
    99 //
       
   100 void CVcxHgMyVideosCategoryListImpl::DoListActivateL( TInt aIndex )
       
   101     {  
       
   102     iCategoryModel->DoModelActivateL();
       
   103     CVcxHgMyVideosListBase::DoListActivateL( aIndex );
       
   104     iCategoryModel->GetCategoryListL();
       
   105     iScroller->SetFocus( ETrue );
       
   106     }
       
   107 
       
   108 // -----------------------------------------------------------------------------
       
   109 // CVcxHgMyVideosCategoryListImpl::DoListDeactivate()
       
   110 // -----------------------------------------------------------------------------
       
   111 //
       
   112 void CVcxHgMyVideosCategoryListImpl::DoListDeactivate()
       
   113     {    
       
   114     CVcxHgMyVideosListBase::DoListDeactivate();
       
   115     iCategoryModel->DoModelDeactivate();
       
   116     iScroller->SetFocus( EFalse );
       
   117     }
       
   118 
       
   119 // -----------------------------------------------------------------------------
       
   120 // CVcxHgMyVideosCategoryListImpl::Highlight() 
       
   121 // -----------------------------------------------------------------------------
       
   122 //
       
   123 TInt CVcxHgMyVideosCategoryListImpl::Highlight()
       
   124     {
       
   125     return iCategoryModel->Highlight();
       
   126     }
       
   127 
       
   128 // -----------------------------------------------------------------------------
       
   129 // CVcxHgMyVideosCategoryListImpl::HandleSelectL()
       
   130 // -----------------------------------------------------------------------------
       
   131 // 
       
   132 void CVcxHgMyVideosCategoryListImpl::HandleSelectL( TInt /* aIndex */ )
       
   133     {    
       
   134     iView.DynInitMskL();
       
   135     }
       
   136 
       
   137 // -----------------------------------------------------------------------------
       
   138 // CVcxHgMyVideosCategoryListImpl::HandleOpenL()
       
   139 // -----------------------------------------------------------------------------
       
   140 // 
       
   141 void CVcxHgMyVideosCategoryListImpl::HandleOpenL( TInt /*aIndex*/ )
       
   142     {
       
   143     TInt highlight = Highlight();
       
   144     
       
   145     if ( highlight >= 0 && iModel.TouchSupport() )
       
   146         {
       
   147         iView.ActivateVideoListL( iCategoryModel->ResolveCategoryId( highlight ) );
       
   148         }
       
   149     }
       
   150 
       
   151 // -----------------------------------------------------------------------------
       
   152 // CVcxHgMyVideosCategoryListImpl::SetEmptyListTextL()
       
   153 // -----------------------------------------------------------------------------
       
   154 //
       
   155 void CVcxHgMyVideosCategoryListImpl::SetEmptyListTextL()
       
   156     {
       
   157     CVcxHgMyVideosListBase::SetEmptyListTextByResourceL( R_VCXHGMYVIDEOS_OPENING_CATEGORIES );
       
   158     }
       
   159 
       
   160 // -----------------------------------------------------------------------------
       
   161 // CVcxHgMyVideosCategoryListImpl::SetTitleTextL()
       
   162 // -----------------------------------------------------------------------------
       
   163 //
       
   164 void CVcxHgMyVideosCategoryListImpl::SetTitleTextL( TInt /*aIndex*/ )
       
   165     {
       
   166     CVcxHgMyVideosListBase::SetTitleTextByResourceL( R_VCXHGMYVIDEOS_MY_VIDEOS_TITLE );
       
   167     }