videofeeds/hgvodui/inc/vcxhgvodcategorylistmodelhandler.h
changeset 0 96612d01cf9f
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:    HG VOD*
       
    15 */
       
    16 
       
    17 
       
    18 
       
    19 
       
    20 #ifndef VCXHGVODCATEGORYLISTMODELHANDLER_H
       
    21 #define VCXHGVODCATEGORYLISTMODELHANDLER_H
       
    22 
       
    23 #include <ganes/HgScrollBufferObserverIface.h>
       
    24 
       
    25 #include "vcxhgvodmainviewcontainer.h"
       
    26 #include "vcxnscategoryproviderif.h"
       
    27 #include "vcxnscategoryproviderobserver.h"
       
    28 
       
    29 class CHgScroller;
       
    30 class CHgItem;
       
    31 class CVcxHgVodMainView;
       
    32 class CVcxNsUiEngine;
       
    33 class CVcxNsCategory;
       
    34 class CVcxHgVodCategoryListImpl;
       
    35 
       
    36 // CLASS DECLARATION
       
    37 /**
       
    38  *  
       
    39  *  
       
    40  *
       
    41  *  @code
       
    42  *   
       
    43  *  @endcode
       
    44  *
       
    45  *  @lib vcxhgvodui.lib
       
    46  *  @since S60 v5.0
       
    47  */
       
    48 class CVcxHgVodCategoryListModelHandler : public CBase,
       
    49                                           public MVcxNsCategoryProviderObserver,
       
    50                                           public MHgScrollBufferObserver
       
    51     {
       
    52 
       
    53 public:
       
    54 
       
    55     /**
       
    56      * Two-phased constructor.
       
    57      */
       
    58     static CVcxHgVodCategoryListModelHandler* NewL( 
       
    59             CVcxNsUiEngine& aDataProviderIf, 
       
    60             CVcxHgVodMainView& aView, 
       
    61             CHgScroller& aScroller,
       
    62             CVcxHgVodCategoryListImpl& aCategoryListImpl );
       
    63     
       
    64     /**
       
    65      * Two-phased constructor.
       
    66      */
       
    67     static CVcxHgVodCategoryListModelHandler* NewLC( 
       
    68             CVcxNsUiEngine& aDataProviderIf, 
       
    69             CVcxHgVodMainView& aView, 
       
    70             CHgScroller& aScroller,
       
    71             CVcxHgVodCategoryListImpl& aCategoryListImpl );
       
    72 
       
    73     /**
       
    74     * Destructor.
       
    75     */
       
    76     virtual ~CVcxHgVodCategoryListModelHandler();
       
    77 
       
    78     /**
       
    79     * Activate model
       
    80     * 
       
    81     */
       
    82     void DoActivateModelL( );
       
    83     
       
    84     /**
       
    85     * Deactivate model
       
    86     * 
       
    87     */
       
    88     void DoDeActivateModel( );
       
    89     
       
    90     /**
       
    91     * Get services and set to widget model.
       
    92     * 
       
    93     */
       
    94     void SetListContentL();
       
    95     
       
    96     /**
       
    97     * Get category provider interface pointer
       
    98     * 
       
    99     */
       
   100     MVcxNsCategoryProviderIf* CategoryProvider();
       
   101     
       
   102 public:    
       
   103 
       
   104     /**
       
   105      * From MVcxNsCategoryProviderObserver
       
   106      * Notify category's data has been updated.
       
   107      */
       
   108     void CategoryUpdated( TInt aIndex );
       
   109 
       
   110     /**
       
   111      * From MVcxNsCategoryProviderObserver 
       
   112      * Application state or full view data needs to be updated.
       
   113      */
       
   114     void RefreshView();
       
   115 
       
   116     /**
       
   117      * From MVcxNsCategoryProviderObserver 
       
   118      * Application state needs to be updated.
       
   119      */
       
   120     void HandleAppStateChangedL();
       
   121 
       
   122     /**
       
   123      * From MVcxNsCategoryProviderObserver
       
   124      * Epg update is ongoing, show the notification.
       
   125      * When downloading and parsing the xml, both parameters are 0.
       
   126      * 
       
   127      * @param aDownloaded count of downloaded thumbnails.
       
   128      * @param aTotal Total count of thumbnails to be downloaded.
       
   129      */
       
   130     void ShowUpdatingNoteL( TBool aShow, TInt aDownloadedTbns, TInt aTotalTbns );
       
   131 
       
   132     /**
       
   133      * From MVcxNsCategoryProviderObserver
       
   134      * Handle error 
       
   135      * 
       
   136      * @param aError Error to handle in UI
       
   137      */
       
   138     void HandleUpdateErrorL( TInt aError );
       
   139     
       
   140 private:    
       
   141     
       
   142     /**
       
   143      * Default constructor
       
   144      *
       
   145      */
       
   146     CVcxHgVodCategoryListModelHandler( 
       
   147                 CVcxNsUiEngine& aDataProviderIf, 
       
   148                 CVcxHgVodMainView& aView, 
       
   149                 CHgScroller& aScroller,
       
   150                 CVcxHgVodCategoryListImpl& aCategoryListImpl );
       
   151 
       
   152     /**
       
   153      * Constructor
       
   154      *
       
   155      */
       
   156     void ConstructL( );
       
   157 
       
   158     /**
       
   159      * Updates data of item in list.
       
   160 	 * @param aIndex Item's index
       
   161      */
       
   162    void UpdateListItemL( TInt aIndex );
       
   163    
       
   164    /**
       
   165     * Refreshes view.
       
   166     */
       
   167    void RefreshViewL();
       
   168    
       
   169    /**
       
   170     * From MHgScrollBufferObserver
       
   171     * 
       
   172     * Buffer position changed. The items between the aBufferStart 
       
   173     * and aBufferEnd should be loaded as soon as possible.
       
   174     * 
       
   175     * @param aBufferStart The index of the first item in buffer.
       
   176     * @param aBufferEnd The index of the last item in buffer.
       
   177     * @param aDirection The direction of request.
       
   178     */
       
   179    void Request( TInt aBufferStart, TInt aBufferEnd, THgScrollDirection aDirection );
       
   180        
       
   181    /**
       
   182     * From MHgScrollBufferObserver
       
   183     * 
       
   184     * Buffer position changed. The items between the aBufferStart 
       
   185     * and aBufferEnd should be released.
       
   186     * 
       
   187     * @param aBufferStart The index of the first item in buffer.
       
   188     * @param aBufferEnd The index of the last item in buffer.
       
   189     */
       
   190    void Release( TInt aBufferStart, TInt aBufferEnd );
       
   191    
       
   192 private: // data
       
   193     
       
   194     /**
       
   195      * Ref to Ui Engine interface.
       
   196      * 
       
   197      */
       
   198     CVcxNsUiEngine& iDataProviderIf;
       
   199     
       
   200     /**
       
   201      * Reference to vod main view
       
   202      *
       
   203      */
       
   204     CVcxHgVodMainView& iView;
       
   205     
       
   206     /**
       
   207      * Pointer to category provide if in UI engine
       
   208      * 
       
   209      */
       
   210     MVcxNsCategoryProviderIf* iCategoryProvider;
       
   211     
       
   212     /**
       
   213      * Pointer to array that holds categories in UI engine
       
   214      * Not own.
       
   215      */
       
   216     RPointerArray<CVcxNsCategory>* iCategories;
       
   217     
       
   218     /**
       
   219      * Ref to scroller
       
   220      * 
       
   221      */
       
   222     CHgScroller& iScroller;
       
   223     
       
   224     /**
       
   225      * Ref to list implementation
       
   226      * 
       
   227      */
       
   228     CVcxHgVodCategoryListImpl& iListImpl;
       
   229     };
       
   230 
       
   231 #endif // VCXHGVODCATEGORYLISTMODELHANDLER_H