videofeeds/clientapi/inc/CIptvVodContentClient.h
changeset 0 96612d01cf9f
equal deleted inserted replaced
-1:000000000000 0:96612d01cf9f
       
     1 /*
       
     2 * Copyright (c) 2004-2007 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:    VoD ECG content API*
       
    15 */
       
    16 
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CIPTVVODCONTENTCLIENT_H
       
    21 #define CIPTVVODCONTENTCLIENT_H
       
    22 
       
    23 // INCLUDES
       
    24 #include <e32base.h>
       
    25 #include "CIptvUtil.h"
       
    26 
       
    27 #include "MIptvVodContent.h"
       
    28 #include "CIptvService.h"
       
    29 #include "RIptvClientSession.h"
       
    30         
       
    31 // FORWARD DECLARATIONS
       
    32 class CIptvVodContentCategoryBriefDetails;
       
    33 class CIptvVodContentContentBriefDetails;
       
    34 class CIptvVodContentContentFullDetails;
       
    35 class MIptvVodContentClientObserver;
       
    36 class CIptvVodContentUpdateObserver;
       
    37 class CIptvMediaContent;
       
    38 class TIptvRssSearchQuery;
       
    39 class CIptvMyVideosGlobalFileId;
       
    40 
       
    41 // CLASS DECLARATION
       
    42 
       
    43 /**
       
    44 *  VoD ECG content API
       
    45 *
       
    46 *  @lib IptvClientApi.lib
       
    47 *  @since Engine 1.0
       
    48 */
       
    49 class CIptvVodContentClient : public CActive, MIptvVodContent
       
    50     {
       
    51     public:  // Constructors and destructor
       
    52         
       
    53         /**
       
    54         * Two-phased constructor.
       
    55         */
       
    56         static IMPORT_C CIptvVodContentClient* NewL(TIptvServiceId aServiceId, MIptvVodContentClientObserver& aClientObserver );
       
    57         /**
       
    58         * Two-phased constructor.
       
    59         */
       
    60         static IMPORT_C CIptvVodContentClient* NewLC(TIptvServiceId aServiceId, MIptvVodContentClientObserver& aClientObserver );
       
    61         
       
    62         /**
       
    63         * Destructor.
       
    64         */
       
    65         virtual ~CIptvVodContentClient();
       
    66     
       
    67     public: // New functions
       
    68         
       
    69         /**
       
    70         * Get list of ECG categories. 
       
    71         * The order of categories is defined by database originated from service provider.
       
    72         * @since                        Engine 1.0
       
    73         * @param    aParentCategoryId   Points to category ID which sub-categories should be listed. Use KIptvVodContentCategoryRootId if the root is referenced.
       
    74         * @param    aCategoryList       Reference to a array where pointer to created category list is returned.
       
    75         * @return                       Error code.
       
    76         */
       
    77         IMPORT_C TInt GetEcgCategoryListL(TIptvCategoryId aParentCategoryId, RPointerArray<CIptvVodContentCategoryBriefDetails>& aCategoryList);
       
    78 
       
    79         /**
       
    80         * Get full detais of one category item.
       
    81         * @since                        Engine 1.0 Notice! In Engine 1.1 CIptvVodContentCategoryFullDetails class is removed! There is only one category class CIptvVodContentCategoryBriefDetails.
       
    82         * @param    aCategoryId         Selected category ID identifier.
       
    83         * @param    aCategory           Reference to a full details data returned.
       
    84         * @return                       Error code.
       
    85         */
       
    86         IMPORT_C TInt GetCategoryDetailsL(TIptvCategoryId aCategoryId, CIptvVodContentCategoryBriefDetails& aCategory);
       
    87 
       
    88         /**
       
    89         * Get parent category ID identifier. 
       
    90         * This method allows application to browse toward root category, then two consecutive calls are needed.
       
    91         * Note that root is KIptvVodContentCategoryRootId.
       
    92         * @since                        Engine 1.0
       
    93         * @param    aCategoryId         Points to category ID which parent category is requested.
       
    94         * @param    aParentId           Reference to returned parend ID.
       
    95         * @return                       Error code.        
       
    96         */
       
    97         IMPORT_C TInt GetParentCategoryL(TIptvCategoryId aCategoryId, TIptvCategoryId& aParentId);
       
    98 
       
    99         /**
       
   100         * Get list of ECG contents in the specified category in order defined by database originated from service provider.
       
   101         * @since                        Engine 1.0
       
   102         * @param    aCategoryId         Selected category ID identifier. Use KIptvVodContentCategoryRootId if the root is referenced.
       
   103         * @param    aSearchString       A search string used to filter contents search. If empty string, no filtering issued.
       
   104         * @param    aFrom               The start index for listed contents.
       
   105         * @param    aAmount             Amount of content elementes to be listes. If zero, all starting from aFrom.
       
   106         * @param    aTotalAmount        Reference to a variable where total amount of content is returned.
       
   107         * @param    aEcgList            Reference to list of returned items.
       
   108         * @return                       Error code.        
       
   109         */
       
   110         IMPORT_C TInt GetEcgListL(TIptvCategoryId aCategoryId, TDesC& aSearchString, TUint32 aFrom, TUint32 aAmount, TUint32& aTotalAmount, RPointerArray<CIptvVodContentContentBriefDetails>& aEcgList);
       
   111         
       
   112         /**
       
   113         * Get list of all ECG contents in alphabetical order.
       
   114         * @since                        Engine 1.0
       
   115         * @param    aSearchString       A search string used to filter contents search. If empty string, no filtering issued.
       
   116         * @param    aFrom               The start index for listed contents.
       
   117         * @param    aAmount             Amount of content elementes to be listes. If zero, all starting from aFrom.
       
   118         * @param    aTotalAmount        Reference to a variable where total amount of content is returned.
       
   119         * @param    aEcgList            Reference to list of returned items.
       
   120         * @return                       Error code.        
       
   121         */
       
   122         IMPORT_C TInt GetEcgAllListL(TDesC& aSearchString, TUint32 aFrom, TUint32 aAmount, TUint32& aTotalAmount, RPointerArray<CIptvVodContentContentBriefDetails>& aEcgList);
       
   123 
       
   124         /**
       
   125         * Get full detais of one content item.
       
   126         * @since                        Engine 1.0
       
   127         * @param    aContentId          Selected content ID identifier.
       
   128         * @param    aContentFullDetails Reference to returned full details data.
       
   129         * @return                       Error code.        
       
   130         */
       
   131         IMPORT_C TInt GetContentDetailsL(TIptvContentId aContentId, CIptvVodContentContentFullDetails& aContentFullDetails);
       
   132 
       
   133         /**
       
   134         * Set IAP for service.
       
   135         * @since                        Engine 1.0
       
   136         * @param    aIap                Internet access point.
       
   137         * @return                       Error code.
       
   138         */
       
   139         IMPORT_C TInt SetIapL(const TUint32 aIap);
       
   140 
       
   141         /**
       
   142         * Update Ecg.
       
   143         * @since                        Engine 1.0
       
   144         * @return                       Error code.
       
   145         */
       
   146         IMPORT_C TInt UpdateEcgL();
       
   147 
       
   148         /**
       
   149         * Verify service group.
       
   150         * @since                        Engine 1.0
       
   151         * @return                       Error code.
       
   152         */
       
   153         IMPORT_C TInt CheckGroupL();
       
   154 
       
   155         /**
       
   156         * Get time when service was last updated.
       
   157         * @since                        Engine 1.0
       
   158         * @param    aTime               Reference to TTime object when DB was last updated.
       
   159         * @return                       Error code.
       
   160         */
       
   161         IMPORT_C TInt GetUpdateTimeL(TTime& aTime);
       
   162 
       
   163         /** 
       
   164         * Get content access objects belonging to given content.
       
   165         * @since                        Engine 1.1
       
   166         * @param    aContentId          Content ID.
       
   167         * @param    aCAList             Content access list.
       
   168         * @return                       Error code.
       
   169         */
       
   170         IMPORT_C TInt GetContentAccessListL(TUint32 aContentId, RPointerArray<CIptvMediaContent>& aCAList);
       
   171 
       
   172         /** 
       
   173         * Set last play position to content access.
       
   174         * @since    Engine 1.1
       
   175         * @param    aContentId          Content id
       
   176         * @param    aIndex              Content access index (id).
       
   177         * @param    aPosition           Position.
       
   178         * @return                       Error code.
       
   179         */
       
   180         IMPORT_C TInt SetLastPositionL(TUint32 aContentId, TUint32 aIndex, TUint32 aPosition);
       
   181 
       
   182         /** 
       
   183         * Start search operation initiated by the UI
       
   184         * @since
       
   185         * @param    aQuery	Query containing the keyword used for search
       
   186         * @return	One of the Symbian error codes.
       
   187         */
       
   188 		IMPORT_C TInt Search( TIptvRssSearchQuery& aQuery );
       
   189 		
       
   190         /** 
       
   191         * Cancel currently active search operation if any.
       
   192         * @since
       
   193         * @param    None
       
   194         * @return	One of the Symbian error codes.
       
   195         */
       
   196 		IMPORT_C TInt CancelSearch();
       
   197 		
       
   198         /** 
       
   199         * Set Mpx media id to content.
       
   200         * @param    aContentId          Content id
       
   201         * @param    aCaIndex            Content access index
       
   202         * @param    aMpxId              Mpx id.
       
   203         * @return                       Error code.
       
   204         */
       
   205         IMPORT_C TInt SetMpxIdL( TUint32 aContentId,
       
   206                                  TUint32 aCaIndex,
       
   207                                  TUint32 aMpxId );
       
   208 
       
   209         /**
       
   210          * Reset global Id.
       
   211          *
       
   212          * @param aFileId    Global file id to be reset.
       
   213          * @param aServiceId Service id.
       
   214          */
       
   215         IMPORT_C void ResetGlobalId(
       
   216             CIptvMyVideosGlobalFileId& aFileId,
       
   217             TUint32 aServiceId );
       
   218     
       
   219         /**
       
   220          * Check if automatic update is needed for  
       
   221          * contents.
       
   222          * @param On return, ETrue if update is needed. 
       
   223          *        Otherwise EFalse
       
   224          * 
       
   225          * @return One of the Symbian error codes.
       
   226          */
       
   227         IMPORT_C TInt UpdateAvailableL( TBool& aAvailable );
       
   228         
       
   229         /**
       
   230          * Cancel ecg update.
       
   231          */
       
   232         IMPORT_C void CancelUpdate();
       
   233 
       
   234     private:
       
   235 
       
   236         /**
       
   237         * From CActive, handles an active object’s request completion event
       
   238         */
       
   239         void RunL();
       
   240 
       
   241         /**
       
   242         * From CActive, implements cancellation of an outstanding request.
       
   243         * This function is called as part of the active object’s Cancel().
       
   244         */
       
   245         void DoCancel();
       
   246 
       
   247     private:
       
   248 
       
   249         /**
       
   250         * C++ default constructor.
       
   251         */
       
   252         CIptvVodContentClient(TIptvServiceId aServiceId, MIptvVodContentClientObserver& aClientObserver);
       
   253 
       
   254         /**
       
   255         * By default Symbian 2nd phase constructor is private.
       
   256         */
       
   257         void ConstructL();
       
   258 
       
   259         /**
       
   260         * Send size request to server.
       
   261         */
       
   262         void SendSizeRequestL(TInt aMessage, TUint32 aParam, TRequestStatus& aStatus);
       
   263 
       
   264         /**
       
   265         * Send size request to server.
       
   266         */
       
   267         void SendSizeRequestL( TInt aMessage,
       
   268                                TUint32 aUintParam1,
       
   269                                TUint32 aUintParam2,
       
   270                                const TDesC& aDesCParam,
       
   271                                TRequestStatus& aStatus );
       
   272 
       
   273         /**
       
   274         * Send size request to server.
       
   275         */
       
   276         void SendSizeRequestL( TInt aMessage,
       
   277                                TUint32 aUintParam1,
       
   278                                TUint32 aUintParam2,
       
   279                                TUint32 aUintParam3,
       
   280                                const TDesC& aDesCParam,
       
   281                                TRequestStatus& aStatus );
       
   282 
       
   283         /**
       
   284         * Send request to server.
       
   285         *
       
   286         * @param aMessage Message to send.
       
   287         * @param aFileIdParam Message parameter, global file Id.
       
   288         * @param aUintParam   Message parameter, TUint32.
       
   289         * @return KErrNone or one of system wide error codes.
       
   290         */         
       
   291         TInt SendRequestL(
       
   292             TInt aMessage,
       
   293             CIptvMyVideosGlobalFileId& aFileIdParam,
       
   294             TUint32 aUintParam);
       
   295 
       
   296         /**
       
   297         * Send request to server.
       
   298         */
       
   299         void SendRequestL(TInt aMessage, TUint32 aParam, TRequestStatus& aStatus);
       
   300         
       
   301         /**
       
   302         * Handle category list size request.
       
   303         */
       
   304         void HandleVodContentGetEcgCategoryListSizeReqL();
       
   305 
       
   306         /**
       
   307         * Handle category list data request.
       
   308         */
       
   309         void HandleVodContentGetEcgCategoryListDataReqL(RPointerArray<CIptvVodContentCategoryBriefDetails>& aCategoryList);        
       
   310 
       
   311         /**
       
   312         * Handle category details size request.
       
   313         */
       
   314         void HandleVodContentGetCategoryDetailsSizeReqL();
       
   315 
       
   316         /**
       
   317         * Handle category details data request.
       
   318         */
       
   319         void HandleVodContentGetCategoryDetailsDataReqL(CIptvVodContentCategoryBriefDetails& aCategory);
       
   320 
       
   321         /**
       
   322         * Handle get parent category request.
       
   323         */
       
   324         void HandleVodContentGetParentCategoryReqL(TIptvCategoryId& aParentId);
       
   325 
       
   326         /**
       
   327         * Handle get ecg list size request.
       
   328         */
       
   329         void HandleVodContentGetEcgListSizeReqL();
       
   330 
       
   331         /**
       
   332         * Handle get ecg list data request.
       
   333         */
       
   334         void HandleVodContentGetEcgListDataReqL(TUint32& aTotalAmount, RPointerArray<CIptvVodContentContentBriefDetails>& aEcgList);
       
   335 
       
   336         /**
       
   337         * Handle get ecg all list size request.
       
   338         */
       
   339         void HandleVodContentGetEcgAllListSizeReqL();
       
   340 
       
   341         /**
       
   342         * Handle get ecg all list data request.
       
   343         */
       
   344         void HandleVodContentGetEcgAllListDataReqL(TUint32& aTotalAmount, RPointerArray<CIptvVodContentContentBriefDetails>& aEcgList);
       
   345 
       
   346         /**
       
   347         * Handle content details size request.
       
   348         */
       
   349         void HandleVodContentGetContentDetailsSizeReqL();
       
   350 
       
   351         /**
       
   352         * Handle content details data request.
       
   353         */
       
   354         void HandleVodContentGetContentDetailsDataReqL(CIptvVodContentContentFullDetails& aContentFullDetails);
       
   355 
       
   356         /**
       
   357         * Send cancel request.
       
   358         */
       
   359         void SendCancelRequest();
       
   360         
       
   361         /**
       
   362         * Send cancel update request.
       
   363         */
       
   364         void SendCancelUpdateRequest();
       
   365 
       
   366         /**
       
   367         * Handle update time.
       
   368         */
       
   369         void HandleVodContentGetUpdateTimeL( TTime& aTime );
       
   370 
       
   371         /**
       
   372         * Send get update time request.
       
   373         */
       
   374         void SendUpdateTimeRequestL( TRequestStatus& aStatus );
       
   375 
       
   376         /**
       
   377         * CleanupL
       
   378         */
       
   379         void CleanupL();            
       
   380 
       
   381         void HandleVodContentGetCAListSizeReqL();
       
   382         void HandleVodContentGetCAListDataReqL(RPointerArray<CIptvMediaContent>& aCAList);
       
   383         void SendLastPositionL(TInt aMessage, TUint32 aContentId, TUint32 aIndex, TUint32 aPosition, TRequestStatus& aStatus);
       
   384 
       
   385         /**
       
   386         * Write mpx id to ecg database.
       
   387         * @param    aContentId          Content id
       
   388         * @param    aCaIndex            Content access index
       
   389         * @param    aMpxId              Mpx id.
       
   390         * @param    aStatus             Request status.
       
   391         */
       
   392         void SendMpxIdL( TInt aMessage, 
       
   393                          TUint32 aContentId, 
       
   394                          TUint32 aCaIndex, 
       
   395                          TUint32 aMpxId, 
       
   396                          TRequestStatus& aStatus );
       
   397         
       
   398         /**
       
   399         * Send update check request.
       
   400         *
       
   401         */
       
   402         void SendUpdateCheckRequestL( TRequestStatus& aStatus );
       
   403         
       
   404         /**
       
   405         * Handle vod content update check 
       
   406         * @param aAvailable On return, ETrue if update is available and needed,
       
   407         * otherwise EFalse.
       
   408         */
       
   409         void HandleVodContentUpdateCheckL( TBool& aAvailable );
       
   410 
       
   411     private:    // Data
       
   412 
       
   413         // Reference to observer class implemented by the application.
       
   414         MIptvVodContentClientObserver& iClientObserver;
       
   415 
       
   416         /**
       
   417         * iSession, the server session.
       
   418         */
       
   419         RIptvClientSession iSession;
       
   420 
       
   421         /**
       
   422         * iMsg Heap object to restore memory for IPC messaging.
       
   423         */
       
   424         HBufC8* iMsg;
       
   425 
       
   426         /**
       
   427         * iMsgPtr Passed to RIptvClientSession object to store the sent and received data.
       
   428         * Points to iData heap object.
       
   429         */
       
   430         TPtr8 iMsgPtr;		                
       
   431                 
       
   432         /**
       
   433         * Service ID.
       
   434         */
       
   435         TIptvServiceId iServiceId;        
       
   436 
       
   437         /**
       
   438         * Pointer to CIptvVodContentUpdateObserver.
       
   439         */    
       
   440         CIptvVodContentUpdateObserver* iObserver;
       
   441     };
       
   442 
       
   443 #endif      // CIPTVVODCONTENTCLIENT_H