videofeeds/vcnsuiengine/inc/vcxnscategoryprovider.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: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef C_VCXNSCATEGORYPROVIDER_H
       
    22 #define C_VCXNSCATEGORYPROVIDER_H
       
    23 
       
    24 // INCLUDES
       
    25 #include <e32base.h>
       
    26 #include "CIptvUtil.h"
       
    27 #include "vcxnscategoryproviderif.h"
       
    28 #include "vcxnscategoryproviderobserver.h"
       
    29 
       
    30 // FORWARD DECLARATIONS
       
    31 class CVcxNsCategory;
       
    32 class CVcxNsCategoryList;
       
    33 class MVcxNsCategoryProviderObserver;
       
    34 class CVcxNsUiEngine;
       
    35 
       
    36 // CLASS DECLARATION
       
    37 
       
    38 /**
       
    39 * Class CVcxNsCategoryProvider handles application categorys.
       
    40 *
       
    41 * @lib vcxnsuiengine.lib
       
    42 */
       
    43 class CVcxNsCategoryProvider : public CBase,
       
    44                                public MVcxNsCategoryProviderIf   
       
    45     {
       
    46 
       
    47 public:
       
    48     
       
    49     /**
       
    50      * Constructor
       
    51      * 
       
    52      * @param aUiEngine Parent ui engine ptr.
       
    53      */
       
    54     static CVcxNsCategoryProvider* NewL( CVcxNsUiEngine& aUiEngine );
       
    55 
       
    56     /**
       
    57      * Destructor
       
    58      */
       
    59     virtual ~CVcxNsCategoryProvider();
       
    60 
       
    61     /**
       
    62      * RegisterObserver.
       
    63      * 
       
    64      * @param aObserver Observer
       
    65      */
       
    66     void RegisterObserver( MVcxNsCategoryProviderObserver* aObserver );
       
    67 
       
    68     /**
       
    69      * DeRegisterObserver.
       
    70      * 
       
    71      * @param aObserver Observer
       
    72      */
       
    73     void DeRegisterObserver( MVcxNsCategoryProviderObserver* aObserver );
       
    74 
       
    75     /**
       
    76      * Get categories for active service.
       
    77      * @param aHighlight On return, hightlight index for category list.
       
    78      * @return Category array. Ownership of categories remains in ui engine.
       
    79      */
       
    80     RPointerArray<CVcxNsCategory>& GetCategoriesL( TInt& aHighlight );
       
    81     
       
    82     /**
       
    83      * Get categories for active service.
       
    84      * @return Vod categorys.
       
    85      */
       
    86     RPointerArray<CVcxNsCategory>& GetCategorysL( );
       
    87 
       
    88     /**
       
    89      * Opens selected category.
       
    90      *
       
    91      * @param aIndex Index of the category to be opened.
       
    92      */
       
    93     void OpenCategoryL( TInt aIndex );
       
    94       
       
    95     /**
       
    96      * Return pointer to active category data
       
    97      * @return Pointer to active category data.
       
    98      *         NULL returned, if category data not found
       
    99      */
       
   100     CVcxNsCategory* GetActiveCategoryDataL();
       
   101     
       
   102     /**
       
   103      * Return specified category data.
       
   104      * @param aServiceId  Service Id
       
   105      * @param aCategoryId Category Id
       
   106      * @return Pointer to category data.
       
   107      *         NULL returned, if specified category data not found
       
   108      */
       
   109     CVcxNsCategory* GetCategoryDataL( TUint32 aServiceId, TUint32 aCategoryId );
       
   110 
       
   111     /**
       
   112      * Get highlight index for content list. 
       
   113      * @return Current highlight index in content list.
       
   114      */
       
   115     TInt GetCurrentHighlightL();
       
   116     
       
   117     /**
       
   118      * Set highlight index for content list. 
       
   119      * @param aIndex Index to save
       
   120      */
       
   121     void SetCurrentHighlightL( TInt aIndex );
       
   122     
       
   123     /**
       
   124      * Update active category data.
       
   125      * This method is needed when count
       
   126      * of videos in category changes (search).
       
   127      * 
       
   128      * @param aCategory Category data to updat  
       
   129      * 
       
   130      */
       
   131     void UpdateActiveCategoryDataL( CVcxNsCategory& aCategory );
       
   132     
       
   133     /**
       
   134      * Reset the categories with given service id.
       
   135      *
       
   136      * @param aServiceId Service id
       
   137      */
       
   138     void RemoveServiceData( TUint32 aServiceId );
       
   139 
       
   140     /**
       
   141      * Starts the category update.
       
   142      *
       
   143      * @return KErrNone or one of the system wide error codes.
       
   144      */
       
   145     TInt RefreshCategorysL();
       
   146 
       
   147 // From MVcxNsCategoryProviderObserver
       
   148 
       
   149     /**
       
   150      * Category update notification.
       
   151      *
       
   152      * @param aIndex Updated item's index
       
   153      */
       
   154     void CategoryUpdated( TInt aIndex );
       
   155     
       
   156     /**
       
   157      * View needs to be refreshed.
       
   158      */
       
   159     void RefreshView();
       
   160 
       
   161     /**
       
   162      * Application state needs to be updated.
       
   163      */
       
   164     void HandleAppStateChangedL();
       
   165 
       
   166     /**
       
   167      * Epg update is ongoing, show the notification.
       
   168      * When downloading and parsing the xml, both parameters are 0.
       
   169      * 
       
   170      * @param aShow If ETrue, show the note, if EFalse, hide it.
       
   171      * @param aDownloadedTbns count of downloaded thumbnails.
       
   172      * @param aTotalTbns Total count of thumbnails to be downloaded.
       
   173      */
       
   174     void ShowUpdatingNoteL( TBool aShow, TInt aDownloadedTbns, TInt aTotalTbns );
       
   175     
       
   176     /**
       
   177      * Handle error. 
       
   178      *
       
   179      * @param aError Error code.
       
   180      * @param aServiceId Service ID 
       
   181      */
       
   182     void HandleErrorL( TInt aError, TUint32 aServiceId );
       
   183     
       
   184     /**
       
   185      * Save category highlight. 
       
   186      * @param aHighlight Highlight index to save.
       
   187      */
       
   188     void SetCategoryHighlight( TInt aHighlight );
       
   189 
       
   190 private:
       
   191     
       
   192     /**
       
   193      * Default constructor.
       
   194      * @param aUiEngine
       
   195      */
       
   196     CVcxNsCategoryProvider( CVcxNsUiEngine& aUiEngine );
       
   197 
       
   198 private:
       
   199     
       
   200     /**
       
   201      * Array of category event observers. Not Own.
       
   202      */
       
   203     RPointerArray<MVcxNsCategoryProviderObserver> iCategoryObservers;
       
   204     
       
   205     /**
       
   206      * UI engine.
       
   207      */
       
   208     CVcxNsUiEngine& iUiEngine;
       
   209 
       
   210     /**
       
   211      * Array of category lists.
       
   212      */
       
   213     RPointerArray<CVcxNsCategoryList> iCategoryListList;
       
   214 
       
   215     };
       
   216 
       
   217 #endif // C_VCXNSCATEGORYPROVIDER_H