videofeeds/vcnsuiengine/inc/vcxnsuiengine.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_VCXNSUIENGINE_H
       
    22 #define C_VCXNSUIENGINE_H
       
    23 
       
    24 //  INCLUDES
       
    25 #include <e32base.h>
       
    26 
       
    27 #include "iptvlastwatcheddata.h"
       
    28 
       
    29 // FORWARD DECLARATIONS
       
    30 class CVcxNsServiceProvider;
       
    31 class CVcxNsContentProvider;
       
    32 class CVcxNsCategoryProvider;
       
    33 class MVcxNsServiceProviderIf;
       
    34 class MVcxNsContentProviderIf;
       
    35 class MVcxNsCategoryProviderIf;
       
    36 class CVcxNsServiceClientHandler;
       
    37 class CVcxNsContentClientHandler;
       
    38 class CVcxNsMpxCollectionClientHandler;
       
    39 class CVcxNsEventRouter;
       
    40 class CVcxNsContentSearchHandler;
       
    41 class MVcxNsContentSearchIf;
       
    42 class CVcxNsUpdateProgressHandler;
       
    43 class MVcxNsUpdateProgressIf;
       
    44 class CVcxConnectionUtility;
       
    45 class CVcxNsStreamingHandler;
       
    46 class CIptvLastWatchedApi;
       
    47 class CMediatorEventProvider;
       
    48 class CVcxNsContent;
       
    49 
       
    50 // ENUMS
       
    51 
       
    52 /**
       
    53 *  Video Center application states
       
    54 */
       
    55 typedef enum
       
    56     {
       
    57     EStateNoState = 0,
       
    58     EStateServiceView,
       
    59     EStateCategoryView,
       
    60     EStateContentView,
       
    61     EStateCustomView,
       
    62     EStateSetting,
       
    63     EStateMyVideos,
       
    64     EStateBrowser,
       
    65     EStatePlayback,
       
    66     EStateOther
       
    67     } TVcxNsAppState;
       
    68 
       
    69 // CLASS DECLARATION
       
    70 
       
    71 /**
       
    72 *  Video Center Ui Engine class
       
    73 *
       
    74 *  @lib vcxnsuiengine.lib
       
    75 */
       
    76 class CVcxNsUiEngine : public CBase
       
    77 	{
       
    78 
       
    79 public:
       
    80 
       
    81     /**
       
    82     * Get instance of VcxNs ui engine.
       
    83     *
       
    84     * Returns a pointer to existing, or else creates a new instance.
       
    85     * NOTE: this increases automatically the reference count, so this should
       
    86     * not be called multiple times without cleaning the references.
       
    87     *
       
    88     * @return Pointer to CVcxNsUiEngine.
       
    89     */
       
    90     IMPORT_C static CVcxNsUiEngine* InstanceL();
       
    91 
       
    92     /**
       
    93     * Remove the reference to this ui engine instance.
       
    94     *
       
    95     * Decreases the reference count by one, this should
       
    96     * be called when not needing ui engine anymore. When
       
    97     * all references are removed, the ui engine is destructed.
       
    98     */
       
    99     IMPORT_C void DecreaseReferenceCount();
       
   100 
       
   101 // New functions
       
   102 
       
   103     /**
       
   104     * Get pointer to app service provider object. Ownership not transferred.
       
   105     *
       
   106     * @return Pointer to CVcxNsServiceProvider.
       
   107     */
       
   108     IMPORT_C MVcxNsServiceProviderIf* GetServiceProviderL();
       
   109 
       
   110     /**
       
   111     * Get pointer to app content provider object. Ownership not transferred.
       
   112     *
       
   113     * @return Pointer to CVcxNsContentProvider.
       
   114     */
       
   115     IMPORT_C MVcxNsContentProviderIf* GetContentProviderL();
       
   116 
       
   117     /**
       
   118     * Get pointer to app category provider object. Ownership not transferred.
       
   119     *
       
   120     * @return Pointer to CVcxNsCategoryProvider.
       
   121     */
       
   122     IMPORT_C MVcxNsCategoryProviderIf* GetCategoryProviderL();
       
   123     
       
   124     /**
       
   125     * Get pointer to app content search handler object. 
       
   126     * Ownership not transferred.
       
   127     *
       
   128     * @return Pointer to content search interface.
       
   129     */
       
   130     IMPORT_C MVcxNsContentSearchIf* ContentSearchHandlerL();
       
   131     
       
   132     /**
       
   133     * Get pointer to content update progress handler 
       
   134     * Ownership not transferred.
       
   135     *
       
   136     * @return Pointer to update progress interface.
       
   137     */
       
   138     IMPORT_C MVcxNsUpdateProgressIf* ProgressHandlerL();
       
   139 
       
   140     /**
       
   141     * Get the videocenter application state.
       
   142     * 
       
   143     * @return Current videocenter application state
       
   144     */
       
   145     IMPORT_C TVcxNsAppState VcAppState();
       
   146 
       
   147     /**
       
   148     * Set the videocenter application state.
       
   149     * 
       
   150     * @param aAppState New videocenter application state
       
   151     */
       
   152     IMPORT_C void SetVcAppState( TVcxNsAppState aAppState );
       
   153 
       
   154     /**
       
   155     * Handle back command. Activates previous application state.
       
   156     *
       
   157     * @return Was the back event consumed. If EFalse,
       
   158     *         the back event should be handled by caller.
       
   159     */
       
   160     IMPORT_C TBool HandleBack();
       
   161     
       
   162     /**
       
   163     * Handle clieant app exit command. Clears application states.
       
   164     */
       
   165     IMPORT_C void ResetStates();
       
   166     
       
   167     /**
       
   168      * Returns active Category id
       
   169      * @return Id of the category
       
   170      */
       
   171     IMPORT_C TUint32 ActiveCategory();
       
   172     
       
   173     /**
       
   174      * Get iap for connection
       
   175      * @return IAP. 
       
   176      */
       
   177     IMPORT_C TUint32 GetAvailableIapL();
       
   178     
       
   179     /**
       
   180      * Get WAP id for the connection.
       
   181      * @return WAP id matching the given IAP id.
       
   182      */
       
   183     IMPORT_C TUint32 GetAvailableWapIdL();
       
   184 
       
   185     /**
       
   186      * Starts to play the given content 
       
   187      * 
       
   188      * NOTE: this Works only with MPX video player
       
   189      * 
       
   190      * @param aContent Content to be played. 
       
   191      */
       
   192     IMPORT_C void PlayVideoL( CVcxNsContent* aContent );
       
   193 
       
   194     /**
       
   195      * Starts to play the given content 
       
   196      * 
       
   197      * NOTE: this Works only with MPX video player
       
   198      * 
       
   199      * @param aContent Content to be played. Ownership not passed.
       
   200      */
       
   201     IMPORT_C void PlayStreamL( CVcxNsContent* aContent );
       
   202     
       
   203     /**
       
   204      * Starts to play the last watched
       
   205      * 
       
   206      * NOTE: this Works only with MPX video player
       
   207      */  
       
   208     IMPORT_C void PlayLastWatchedL();
       
   209     
       
   210     /**
       
   211      * Should be called when playback of video is starting. Updates 'Last
       
   212      * Watched' information to Matrix and dat-file.
       
   213      * 
       
   214      * @param aContent Content item representing played video.
       
   215     */
       
   216     IMPORT_C void VideoPlaybackStartingL( CVcxNsContent* aContent );
       
   217     
       
   218     /**
       
   219      * Removes the topmost state from application state stack.
       
   220      * Needed for vod view changes, where back navigation route changes.
       
   221      * This is intended just for UI engine's internal use
       
   222      */
       
   223     void PopAppStateStack();
       
   224 
       
   225     /**
       
   226     * Get service provider ptr, ownership not transferred.
       
   227     * for ui engine internal use, pointer can be NULL
       
   228     *
       
   229     * @return Pointer to CVcxNsServiceProvider
       
   230     */
       
   231     CVcxNsServiceProvider* ServiceProvider();
       
   232 
       
   233     /**
       
   234     * Get content provider ptr, ownership not transferred.
       
   235     * for ui engine internal use, pointer can be NULL
       
   236     *
       
   237     * @return Pointer to CVcxNsContentProvider
       
   238     */
       
   239     CVcxNsContentProvider* ContentProvider();
       
   240 
       
   241     /**
       
   242     * Get category provider ptr, ownership not transferred.
       
   243     * for ui engine internal use, pointer can be NULL
       
   244     *
       
   245     * @return Pointer to CVcxNsContentProvider
       
   246     */
       
   247     CVcxNsCategoryProvider* CategoryProvider();
       
   248 
       
   249     /**
       
   250     * Get pointer to service client handler class
       
   251     *
       
   252     * @return Pointer to CVcxNsServiceClientHandler.
       
   253     * ownership not transferred.
       
   254     */
       
   255     CVcxNsServiceClientHandler* GetServiceClientHandlerL();
       
   256 
       
   257     /**
       
   258     * Get pointer to content client handler class
       
   259     *
       
   260     * @return Pointer to CVcxNsContentClientHandler.
       
   261     * ownership not transferred.
       
   262     */
       
   263     CVcxNsContentClientHandler* GetContentClientHandlerL();
       
   264 
       
   265     /**
       
   266     * Get pointer to Mpx collection client handle
       
   267     *
       
   268     * @return Pointer to CVcxNsContentClientHandler.
       
   269     * ownership not transferred.
       
   270     */
       
   271     CVcxNsMpxCollectionClientHandler* GetMpxCollectionClientHandlerL();
       
   272     
       
   273     /**
       
   274     * Get pointer to search handler.
       
   275     *
       
   276     * @return Pointer to CVcxNsContentSearchHandler.
       
   277     * ownership not transferred.
       
   278     */
       
   279     CVcxNsContentSearchHandler* GetContentSearchHandlerL();
       
   280     
       
   281     /**
       
   282     * Get pointer to event handler class
       
   283     *
       
   284     * @return Pointer to CVcxNsEventRouter.
       
   285     * ownership not transferred.
       
   286     */
       
   287     CVcxNsEventRouter* GetEventRouter();
       
   288     
       
   289     /**
       
   290     * Get pointer to progress update handler
       
   291     *
       
   292     * @return Pointer to progress handler.
       
   293     * Ownership not transferred.
       
   294     */
       
   295     CVcxNsUpdateProgressHandler* GetProgressHandler();
       
   296     
       
   297     /**
       
   298      * Returns active Service id
       
   299      * 
       
   300      * @return Active service's id
       
   301      */
       
   302     TUint32 ActiveService();
       
   303 
       
   304     /**
       
   305      * Set active Service id
       
   306      * 
       
   307      * @param aServiceId Active service's id
       
   308      */
       
   309     void SetActiveService( TUint32 aServiceId );
       
   310 
       
   311     /**
       
   312      * Returns active Service group
       
   313      * 
       
   314      * @return Active service group id
       
   315      */
       
   316     TUint32 ActiveServiceGroup();
       
   317 
       
   318     /**
       
   319      * Set active Service group id
       
   320      * 
       
   321      * @param aServiceId Active service group id
       
   322      */
       
   323     void SetActiveServiceGroup( TUint32 aServiceId );
       
   324 
       
   325     /**
       
   326      * Set active Category id
       
   327      * @param aCategoryId Active gategory's id
       
   328      */
       
   329     void SetActiveCategory( TUint32 aCategoryId );
       
   330 
       
   331 // from MvcxNsPlayerObserver
       
   332 
       
   333     /**
       
   334      * MnpwoLastPlaybackPosition
       
   335      * @param aContentUri Content Uri
       
   336      * @return Play position
       
   337      */
       
   338     TInt MnpwoLastPlaybackPosition( const TDesC& aContentUri );
       
   339 
       
   340     /**
       
   341      * MnpwoSetLastPlaybackPosition
       
   342      * @param aContentUri Content Uri
       
   343      * @param aPos Play position
       
   344      */
       
   345     void MnpwoSetLastPlaybackPosition( const TDesC& aContentUri, TInt aPos );
       
   346     
       
   347 private:
       
   348 
       
   349     /**
       
   350     * Deletes the ui engine instance.
       
   351     * @param aThis class pointer
       
   352     */
       
   353     static void DeleteInstance( CVcxNsUiEngine* aThis );
       
   354 
       
   355     /**
       
   356     * Increases the reference count to this ui engine instance.
       
   357     */
       
   358     void IncreaseReferenceCount();
       
   359 
       
   360     CVcxNsUiEngine();
       
   361 
       
   362     void ConstructL();
       
   363 
       
   364     virtual ~CVcxNsUiEngine();
       
   365     
       
   366     void RaisePlayEventL( CVcxNsContent* aContent );
       
   367     
       
   368     void WriteLastWatchedL( CVcxNsContent* aContent );
       
   369     
       
   370     /**
       
   371      * @return The content. Ownership is transferred to caller.
       
   372      */
       
   373     CVcxNsContent* LastWatchedToContentL();
       
   374 
       
   375 private:
       
   376 
       
   377 // Data
       
   378 
       
   379     /**
       
   380     * Service provider
       
   381     */
       
   382     CVcxNsServiceProvider* iServiceProvider;
       
   383 
       
   384     /**
       
   385     * Content provider
       
   386     */
       
   387     CVcxNsContentProvider* iContentProvider;
       
   388 
       
   389     /**
       
   390     * Category provider
       
   391     */
       
   392     CVcxNsCategoryProvider* iCategoryProvider;
       
   393 
       
   394     /**
       
   395     * Count of references to this ui engine object.
       
   396     */
       
   397     TInt iReferenceCount;
       
   398 
       
   399     /**
       
   400      * Service client handler
       
   401      */
       
   402     CVcxNsServiceClientHandler* iServiceClientHandler;
       
   403 
       
   404     /**
       
   405      * Content client handler
       
   406      */
       
   407     CVcxNsContentClientHandler* iContentClientHandler;
       
   408 
       
   409     /**
       
   410      * Mpx collection client handler
       
   411      */
       
   412     CVcxNsMpxCollectionClientHandler* iMpxCollectionClientHandler;
       
   413 
       
   414     /**
       
   415      * Application state
       
   416      */
       
   417     TVcxNsAppState iApplicationState;
       
   418 
       
   419     /**
       
   420      * Event router
       
   421      */
       
   422     CVcxNsEventRouter* iEventRouter;
       
   423 
       
   424     /**
       
   425      * Application state history, needed for handling back commands.
       
   426      */
       
   427     RArray<TVcxNsAppState> iAppStateStack;
       
   428 
       
   429     /**
       
   430      * Active Service id
       
   431      */
       
   432     TUint32 iActiveService;
       
   433 
       
   434     /**
       
   435      * Active Service Group id
       
   436      */
       
   437     TUint32 iActiveServiceGroup;
       
   438     
       
   439     /**
       
   440      * Active Category id
       
   441      */
       
   442     TUint32 iActiveCategory;
       
   443 	
       
   444     /**
       
   445      *  Content search handler.
       
   446      *  Own.
       
   447      */
       
   448 	CVcxNsContentSearchHandler* iContentSearchHandler;
       
   449 	
       
   450     /**
       
   451      * Connection utility
       
   452      */
       
   453     CVcxConnectionUtility* iConnUtil;
       
   454     
       
   455     /**
       
   456      * Content update progress handler.
       
   457      * Own.
       
   458      */
       
   459     CVcxNsUpdateProgressHandler* iProgressHandler;
       
   460 	
       
   461     /**
       
   462      * Pointer to 'Last Watched' API.
       
   463      * Own.
       
   464      */
       
   465     CIptvLastWatchedApi* iLastWatchedApi;
       
   466     
       
   467     /**
       
   468      * Pointer to Mediator Event class.
       
   469      * Own.
       
   470      */        
       
   471     CMediatorEventProvider* iMediatorEventProvider;
       
   472     
       
   473     /**
       
   474      * Pointer to Streaming Handler.
       
   475      * Own.
       
   476      */
       
   477     CVcxNsStreamingHandler* iStreamingHandler;
       
   478     
       
   479 	};
       
   480 
       
   481 #endif // C_VCXNSUIENGINE_H