videofeeds/clientapi/inc/CIptvMyVideosClient.h
changeset 0 96612d01cf9f
equal deleted inserted replaced
-1:000000000000 0:96612d01cf9f
       
     1 /*
       
     2 * Copyright (c) 2006 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:    My Videos Client API header file.*
       
    15 */
       
    16 
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CIPTVMYVIDEOSCLIENT_H
       
    21 #define CIPTVMYVIDEOSCLIENT_H
       
    22 
       
    23 #include <e32base.h>
       
    24 #include "CIptvUtil.h"
       
    25 #include "MIptvMyVideos.h"
       
    26 #include "RIptvClientSession.h"
       
    27 
       
    28 class CIptvMyVideosVideoBriefDetails;
       
    29 class CIptvMyVideosVideoFullDetails;
       
    30 class CIptvMyVideosFolder;
       
    31 class CIptvMyVideosGlobalFileId;
       
    32 class CIptvMyVideosGlobalFolderId;
       
    33 class MIptvMyVideosClientObserver;
       
    34 class CIptvMyVideosContentUpdateObserver;
       
    35 class CIptvMyVideosTotalVideoLengthObserver;
       
    36 class CIptvMyVideosCopyOrMoveObserver;
       
    37 
       
    38 /**
       
    39  *  My Videos Client API.
       
    40  *
       
    41  *  @lib IptvEngineClient.dll
       
    42  *  @since
       
    43  */
       
    44 class CIptvMyVideosClient : public CActive,
       
    45                             public MIptvMyVideos
       
    46     {
       
    47 
       
    48 public:
       
    49 
       
    50     /**
       
    51      * Two-phased constructor.
       
    52      *
       
    53      * @param aClientObserver Observer.
       
    54      * @param aMaintenance In MDS version only MDS maintenance handling client
       
    55      *        sets this parameter to true. In legacy DB version maintenance is
       
    56      *        performed by default and for example MobileTV client should set
       
    57      *        this to true to SKIP the maintenance.
       
    58      * @return New CIptvMyVideosClient object.
       
    59      */
       
    60     static IMPORT_C CIptvMyVideosClient* NewL(
       
    61         MIptvMyVideosClientObserver& aClientObserver,
       
    62         TBool aMaintenance = EFalse );
       
    63 
       
    64     /**
       
    65      * Two-phased constructor.
       
    66      *
       
    67      * @param aClientObserver Observer.
       
    68      * @param aMaintenance In MDS version only MDS maintenance handling client
       
    69      *        sets this parameter to true. In legacy DB version maintenance is
       
    70      *        performed by default and for example MobileTV client should set
       
    71      *        this to true to SKIP the maintenance.
       
    72      * @return New CIptvMyVideosClient object.
       
    73      */
       
    74     static IMPORT_C CIptvMyVideosClient* NewLC(
       
    75         MIptvMyVideosClientObserver& aClientObserver,
       
    76         TBool aMaintenance = EFalse );
       
    77 
       
    78     /**
       
    79      * Destructor.
       
    80      */
       
    81     virtual ~CIptvMyVideosClient();
       
    82 
       
    83 // From MIptvMyVideos
       
    84 
       
    85     /**
       
    86      * Gets folder list in the alphabetical order.
       
    87      *
       
    88      * @param aParentFolderId Points to folder ID which sub-folders should be listed.
       
    89      *        Note that the root folder ID is generated by CIptvMyVideosGlobalFolderId::NewRootFolderL().
       
    90      * @param aFrom The start index for listed folders.
       
    91      * @param aAmount Amount of folders to be listed. If zero, all are listed.
       
    92      * @param aTotalAmount Reference to a variable where total amount of folders is returned.
       
    93      * @param aFolderList Reference to a list of items returned.
       
    94      * @return Error code, KErrNone if no errors, otherwise one of the system wide error codes.
       
    95      */
       
    96     IMPORT_C TInt GetFolderListL(
       
    97         CIptvMyVideosGlobalFolderId& aParentFolderId,
       
    98         TUint32 aFrom,
       
    99         TUint32 aAmount,
       
   100         TUint32& aTotalAmount,
       
   101         RPointerArray<CIptvMyVideosFolder>& aFolderList );
       
   102 
       
   103     /**
       
   104      * Gets parent forlder ID identifier.
       
   105      * Note that at the beginning of the browse operation, the root folder ID is generated by
       
   106      * CIptvMyVideosGlobalFolderId::NewRootFolderL().
       
   107      *
       
   108      * @param aFolderId Points to a folder ID which parent folder is requested.
       
   109      * @param aParentFolder Reference to a storage where to parent folder ID is returned.
       
   110      * @return Error code, KErrNone if no errors, otherwise one of the system wide error codes.
       
   111      */
       
   112     IMPORT_C TInt GetParentFolderL(
       
   113         CIptvMyVideosGlobalFolderId& aFolderId,
       
   114         CIptvMyVideosGlobalFolderId& aParentFolder );
       
   115 
       
   116     /**
       
   117      * Gets folder name.
       
   118      *
       
   119      * @param aFolderId ID of the folder which name is requested.
       
   120      * @param aName On return, name of the folder.
       
   121      * @return KErrNone or one of the system wide error codes.
       
   122      */
       
   123     IMPORT_C TInt GetFolderNameL(
       
   124         CIptvMyVideosGlobalFolderId& aFolderId,
       
   125         TDes& aName);
       
   126 
       
   127     /**
       
   128      * Delete folder asynchronously.
       
   129      * Deletion includes all sub forlders and files at the tree.
       
   130      * MIptvMyVideosClientObserver::DeleteResponse is called when operation is finished.
       
   131      *
       
   132      * @param aFolderId Points to folder ID to be deleted.
       
   133      * @return Error code, KErrNone if no errors, otherwise one of the system wide error codes.
       
   134      */
       
   135     IMPORT_C TInt DeleteFolderReqL(
       
   136         CIptvMyVideosGlobalFolderId& aFolderId );
       
   137 
       
   138     /**
       
   139      * Delete folder.
       
   140      * Deletion includes all sub forlders and files at the tree.
       
   141      *
       
   142      * @param aFolderId Points to folder ID to be deleted.
       
   143      * @return Error code, KErrNone if no errors, otherwise one of the system wide error codes.
       
   144      */
       
   145     IMPORT_C TInt DeleteFolderL(
       
   146         CIptvMyVideosGlobalFolderId& aFolderId );
       
   147 
       
   148     /**
       
   149      * Gets a video list in a chronological order.
       
   150      *
       
   151      * @param aParentFolderId Points to folder ID which video files should be listed.
       
   152      *                        Note that the root folder ID is generated by
       
   153      *                        CIptvMyVideosGlobalFolderId::NewRootFolderL().
       
   154      * @param aFrom           The start index for listed folders.
       
   155      * @param aAmount         Amount of folders to be listed. If zero, all listed.
       
   156      * @param aTotalAmount    Reference to a variable where total amount of folders is returned.
       
   157      * @param aVideoList      Reference to a list of items returned.
       
   158      * @return Error code, KErrNone if no errors, otherwise one of the system wide error codes.
       
   159      */
       
   160     IMPORT_C TInt GetVideoListL(
       
   161         CIptvMyVideosGlobalFolderId& aParentFolderId,
       
   162         TUint32 aFrom,
       
   163         TUint32 aAmount,
       
   164         TUint32& aTotalAmount,
       
   165         RPointerArray<CIptvMyVideosVideoBriefDetails>& aVideoList );
       
   166 
       
   167     /**
       
   168      * Gets full video details.
       
   169      *
       
   170      * @param aFileId Identifier to a video file requested.
       
   171      * @param aFullDetails Reference to a list of items returned.
       
   172      * @return Error code, KErrNone if no errors, otherwise one of the system wide error codes.
       
   173      */
       
   174     IMPORT_C TInt GetVideoDetailsL(
       
   175         CIptvMyVideosGlobalFileId& aFileId,
       
   176         CIptvMyVideosVideoFullDetails& aFullDetails );
       
   177 
       
   178     /**
       
   179      * Gets full video details by file localpath
       
   180      *
       
   181      * @since R2.0
       
   182      * @param aLocalPath Path to video file, used as search key.
       
   183      * @param aFullDetails Reference to a item to be returned.
       
   184      * @return Error code, KErrNone if no errors, KErrNotFound if there is no such
       
   185      *         video. On unexpected error, one of the other system wide error codes.
       
   186      */
       
   187     IMPORT_C TInt GetVideoDetailsForPathL(
       
   188         const TDesC& aLocalPath,
       
   189         CIptvMyVideosVideoFullDetails& aFullDetails );
       
   190 
       
   191     /**
       
   192      * Requests total video lengt and total file size (sum of all videos).
       
   193      * The result is returned asynchronously trough observer callback.
       
   194      *
       
   195      * @return Error code, KErrNone if no errors, otherwise one of the system wide error codes.
       
   196      */
       
   197     IMPORT_C TInt GetTotalVideoLengthRequestL();
       
   198 
       
   199     /**
       
   200      * Sets video details information.
       
   201      *
       
   202      * @param aVideoFullDetails New video details information.
       
   203      * @return Error code, KErrNone if no errors, otherwise one of the system wide error codes.
       
   204      */
       
   205     IMPORT_C TInt SetVideoDetailsL(
       
   206         CIptvMyVideosVideoFullDetails& aVideoFullDetails );
       
   207 
       
   208     /**
       
   209      * Deletes a video asynchronously.
       
   210      * Operation includes clean up that removes files from file system,
       
   211      * deletes data related to FileId and releases FileId identifier.
       
   212      * MIptvMyVideosClientObserver::DeleteResponse is called when operation is finished.
       
   213      *
       
   214      * @param aFileId File ID identifier for the video to be deleted.
       
   215      * @return Error code, KErrNone if no errors, otherwise one of the system wide error codes.
       
   216      */
       
   217     IMPORT_C TInt DeleteVideoReqL(
       
   218         CIptvMyVideosGlobalFileId& aFileId );
       
   219 
       
   220     /**
       
   221      * Deletes a video.
       
   222      * Operation includes clean up that removes files from file system,
       
   223      * deletes data related to FileId and releases FileId identifier.
       
   224      *
       
   225      * @param aFileId File ID identifier for the video to be deleted.
       
   226      * @return Error code, KErrNone if no errors, otherwise one of the system wide error codes.
       
   227      */
       
   228     IMPORT_C TInt DeleteVideoL(
       
   229         CIptvMyVideosGlobalFileId& aFileId );
       
   230 
       
   231     /**
       
   232      * Copy video file asynchronously to another My Videos Folder.
       
   233      * Target drive must be different that source drive.
       
   234      * MIptvMyVideosClientObserver::CopyOrMoveComplete is called when operation is finished.
       
   235      *
       
   236      * @param aSourceFileId Source video file ID to be copied.
       
   237      * @param aTargetFolderId My Videos target folder where to be copied. Note if target is a root,
       
   238      *        that root folder ID is generated by CIptvMyVideosGlobalFolderId::NewRootFolderL() with a drive letter.
       
   239      * @return Error code, KErrNone if no errors, otherwise one of the system wide error codes.
       
   240      */
       
   241     IMPORT_C TInt CopyReqL(
       
   242         CIptvMyVideosGlobalFileId& aSourceFileId,
       
   243         CIptvMyVideosGlobalFolderId& aTargetFolderId );
       
   244 
       
   245     /**
       
   246      * Copy video file synchronously to another My Videos Folder.
       
   247      * Target drive must be different that source drive.
       
   248      *
       
   249      * @param aSourceFileId Source video file ID to be copied.
       
   250      * @param aTargetFolderId My Videos target folder where to be copied. Note if target is a root, that root
       
   251      *        folder ID is generated by CIptvMyVideosGlobalFolderId::NewRootFolderL() with a drive letter.
       
   252      * @return Error code, KErrNone if no errors, otherwise one of the system wide error codes.
       
   253      */
       
   254     IMPORT_C TInt CopyL(
       
   255         CIptvMyVideosGlobalFileId& aSourceFileId,
       
   256         CIptvMyVideosGlobalFolderId& aTargetFolderId );
       
   257 
       
   258     /**
       
   259      * Copy My Videos folder tree and videos asynchronously.
       
   260      * Target drive must be different that source drive.
       
   261      * MIptvMyVideosClientObserver::CopyOrMoveComplete is called when operation is finished.
       
   262      *
       
   263      * @param aSourceFolderId Source folder ID to be copied.
       
   264      * @param aTargetFolderId My Videos target folder where to be copied. Note if target is a root, that
       
   265      *        root folder ID is generated by CIptvMyVideosGlobalFolderId::NewRootFolderL() with a drive letter.
       
   266      * @return Error code, KErrNone if no errors, otherwise one of the system wide error codes.
       
   267      */
       
   268     IMPORT_C TInt CopyReqL(
       
   269         CIptvMyVideosGlobalFolderId& aSourceFolderId,
       
   270         CIptvMyVideosGlobalFolderId& aTargetFolderId );
       
   271 
       
   272     /**
       
   273      * Copy My Videos folder tree and videos synchronously.
       
   274      * Target drive must be different that source drive.
       
   275      *
       
   276      * @param aSourceFolderId Source folder ID to be copied.
       
   277      * @param aTargetFolderId My Videos target folder where to be copied. Note if target is a root, that
       
   278      *        root folder ID is generated by CIptvMyVideosGlobalFolderId::NewRootFolderL() with a drive letter.
       
   279      * @param aFailed On return, count of items that could not be copied.
       
   280      * @return Error code, KErrNone if no errors, otherwise one of the system wide error codes.
       
   281      */
       
   282     IMPORT_C TInt CopyL(
       
   283         CIptvMyVideosGlobalFolderId& aSourceFolderId,
       
   284         CIptvMyVideosGlobalFolderId& aTargetFolderId,
       
   285         TUint32& aFailed );
       
   286 
       
   287     /**
       
   288      * Move video file to another My Videos Folder asynchronously.
       
   289      * If target is in an another physical file system drive, actual video contents is also moved.
       
   290      * MIptvMyVideosClientObserver::CopyOrMoveComplete is called when operation is finished.
       
   291      *
       
   292      * @param aSourceFileId Source video file ID to be moved.
       
   293      * @param aTargetFolderId My Videos target folder where to be moved. Note if target is a root, that
       
   294      *        root folder ID is generated by CIptvMyVideosGlobalFolderId::NewRootFolderL() with a drive letter.
       
   295      * @return Error code, KErrNone if no errors, otherwise one of the system wide error codes.
       
   296      */
       
   297     IMPORT_C TInt MoveReqL(
       
   298         CIptvMyVideosGlobalFileId& aSourceFileId,
       
   299         CIptvMyVideosGlobalFolderId& aTargetFolderId );
       
   300 
       
   301     /**
       
   302      * Move video file to another My Videos Folder synchronously.
       
   303      * If target is in an another physical file system drive, actual video contents is also moved.
       
   304      *
       
   305      * @param aSourceFileId Source video file ID to be moved.
       
   306      * @param aTargetFolderId My Videos target folder where to be moved. Note if target is a root, that root
       
   307      *        folder ID is generated by CIptvMyVideosGlobalFolderId::NewRootFolderL() with a drive letter.
       
   308      * @return Error code, KErrNone if no errors, otherwise one of the system wide error codes.
       
   309      */
       
   310     IMPORT_C TInt MoveL(
       
   311         CIptvMyVideosGlobalFileId& aSourceFileId,
       
   312         CIptvMyVideosGlobalFolderId& aTargetFolderId );
       
   313 
       
   314     /**
       
   315      * Move My Videos folder tree and videos asynchronously.
       
   316      * If target is in an another physical file system drive, actual video contents is also moved.
       
   317      * MIptvMyVideosClientObserver::CopyOrMoveComplete is called when operation is finished.
       
   318      *
       
   319      * @param aSourceFolderId Source folder ID to be moved.
       
   320      * @param aTargetFolderId My Videos target folder where to be moved. Note if target is a root, that
       
   321      *        root folder ID is generated by CIptvMyVideosGlobalFolderId::NewRootFolderL() with a drive letter.
       
   322      * @return Error code, KErrNone if no errors, otherwise one of the system wide error codes.
       
   323      */
       
   324     IMPORT_C TInt MoveReqL(
       
   325         CIptvMyVideosGlobalFolderId& aSourceFolderId,
       
   326         CIptvMyVideosGlobalFolderId& aTargetFolderId );
       
   327 
       
   328     /**
       
   329      * Move My Videos folder tree and videos synchronously.
       
   330      * If target is in an another physical file system drive, actual video contents is also moved.
       
   331      *
       
   332      * @param aSourceFolderId Source folder ID to be moved.
       
   333      * @param aTargetFolderId My Videos target folder where to be moved. Note if target is a root, that root
       
   334      *        folder ID is generated by CIptvMyVideosGlobalFolderId::NewRootFolderL() with a drive letter.
       
   335      * @param aFailed On return, count of items that could not be moved.
       
   336      * @return Error code, KErrNone if no errors, otherwise one of the system wide error codes.
       
   337      */
       
   338     IMPORT_C TInt MoveL(
       
   339         CIptvMyVideosGlobalFolderId& aSourceFolderId,
       
   340         CIptvMyVideosGlobalFolderId& aTargetFolderId,
       
   341         TUint32& aFailed );
       
   342 
       
   343     /**
       
   344      * Cancels any ongoing move or copy operation.
       
   345      * MIptvMyVideosClientObserver::CopyOrMoveComplete is called when cancel is actually done.
       
   346      *
       
   347      * @return Error code, KErrNone if no errors, otherwise one of the system wide error codes.
       
   348      */
       
   349     IMPORT_C TInt CancelCopyOrMoveL();
       
   350 
       
   351     /**
       
   352      * Rename My Videos folder.
       
   353      *
       
   354      * @param aFolderId Folder to be renamed.
       
   355      * @param aName New name string.
       
   356      * @return Error code, KErrNone if no errors, otherwise one of the system wide error codes.
       
   357      */
       
   358     IMPORT_C TInt RenameDatabaseFolderL(
       
   359         CIptvMyVideosGlobalFolderId& aFolderId,
       
   360         TDesC& aName );
       
   361 
       
   362     /**
       
   363      * Create a new My Videos folder.
       
   364      *
       
   365      * @param aParentFolderId Parent folder ID where the new folder is created. Note if the parent folder is a root,
       
   366      *        that root folder ID is generated by CIptvMyVideosGlobalFolderId::NewRootFolderL() with a drive letter.
       
   367      * @param aName Name fot the new folder.
       
   368      * @param aNewFolderId Reference to a storage where new folder ID is returned.
       
   369      * @return Error code, KErrNone if no errors, otherwise one of the system wide error codes.
       
   370      */
       
   371     IMPORT_C TInt NewDatabaseFolderL(
       
   372         CIptvMyVideosGlobalFolderId& aParentFolderId,
       
   373         TDesC& aName,
       
   374         CIptvMyVideosGlobalFolderId& aNewFolderId );
       
   375 
       
   376     /**
       
   377      * Adds a new video entry to the database.
       
   378      *
       
   379      * @since R2.0
       
   380      * @param aFullDetails             Full details structure of the video to be added to database.
       
   381      *                                 Note, this parameter is both input and output parameter.
       
   382      * @param aVideoType               Type of video, see enumeration TVideoType.
       
   383      * @param aSizeEstimateInKiloBytes Estimate of the size of the new video. Method will ensure
       
   384      *                                 that there is enough free space on disk for the video.
       
   385      * @return Error code, KErrNone if no errors, KErrNotSupported if video type to add is not supported,
       
   386      *         KErrArgument if arguments are invalid, KErrDiskFull if there is no space for new video,
       
   387      *         KErrNotReady if external resources are not available, and possibly other error in
       
   388      *         unexpected error  cases.
       
   389      */
       
   390     IMPORT_C TInt CreateVideoL(
       
   391         CIptvMyVideosVideoFullDetails& aFullDetails,
       
   392         TVideoType aVideoType,
       
   393         TUint32 aSizeEstimateInKiloBytes );
       
   394 
       
   395     /**
       
   396      * Ensures that there is enough of free space on disk for new video. This version of the
       
   397      * method cannot change the used drive, it just tries to free space on current drive.
       
   398      *
       
   399      * @since R2.0
       
   400      * @param aFileId                   Global File ID of the file that needs the space.
       
   401      * @param aRequiredSpaceInKiloBytes Required space (size of file) in kilobytes.
       
   402      * @return Error code, KErrNone if no errors, KErrArgument if the argument is invalid,
       
   403      *         KErrDiskFull if cannot free enough space for video, and possibly other error
       
   404      *         in unexpected error cases.
       
   405      */
       
   406     IMPORT_C TInt EnsureFreeSpaceL(
       
   407         CIptvMyVideosGlobalFileId& aFileId,
       
   408         TUint32 aRequiredSpaceInKiloBytes );
       
   409 
       
   410     /**
       
   411      * Ensures that there is enough of free space on disk for new video. This version of the
       
   412      * method might transfer the video to another drive if current drive cannot provide enough
       
   413      * of free space. If the video is transferred, the original video entry is removed.
       
   414      *
       
   415      * @since R2.0
       
   416      * @param aCurrentFileId            Global File ID of the file that needs the space.
       
   417      * @param aRequiredSpaceInKiloBytes Required space (size of file) in kilobytes.
       
   418      * @param aNewFileId                Possible new Global File ID of the file if file needs to
       
   419      *                                  be re-located on another drive. Matches original File ID
       
   420      *                                  if there is no need for re-location.
       
   421      * @return Error code, KErrNone if no errors, KErrArgument if the argument is invalid,
       
   422      *         KErrDiskFull if video needs to be re-located to another drive, KErrCancel if
       
   423      *         cannot free enough space for video, and possibly other error in unexpected
       
   424      *         error cases.
       
   425      */
       
   426     IMPORT_C TInt EnsureFreeSpaceL(
       
   427         CIptvMyVideosGlobalFileId& aCurrentFileId,
       
   428         TUint32 aRequiredSpaceInKiloBytes,
       
   429         CIptvMyVideosGlobalFileId& aNewFileId );
       
   430 
       
   431     /**
       
   432      * Count total video length and total file size (sum of all videos).
       
   433      *
       
   434      * @param aTotalPlayTime Total play time (not used).
       
   435      * @param aTotalFileSize Total file size in kilo bytes.
       
   436      * @return Error code,
       
   437      *         KErrNone if no errors,
       
   438      *         otherwise one of the system wide error codes.
       
   439      */
       
   440     IMPORT_C TInt GetTotalVideoLengthL(
       
   441         TIptvPlayTime& aTotalPlayTime,
       
   442         TIptvFileSize& aTotalFileSize );
       
   443 
       
   444     /**
       
   445      * Deletes all videos which are under downloading.
       
   446      *
       
   447      * @return Error code,
       
   448      *         KErrNone if no errors,
       
   449      *         otherwise one of the system wide error codes.
       
   450      */
       
   451     IMPORT_C TInt DeleteAllDownloadsL();
       
   452 
       
   453 private:
       
   454 
       
   455     /**
       
   456      * From CActive, handles an active object’s request completion event.
       
   457      */
       
   458     void RunL();
       
   459 
       
   460     /**
       
   461      * From CActive, implements cancellation of an outstanding request.
       
   462      * This function is called as part of the active object’s Cancel().
       
   463      */
       
   464     void DoCancel();
       
   465 
       
   466     /**
       
   467      * From CActive, handles errors in RunL method.
       
   468      */
       
   469     TInt RunError( TInt aError );
       
   470 
       
   471     /**
       
   472      * C++ default constructor.
       
   473      *
       
   474      * @param aClientObserver Observer.
       
   475      */
       
   476     CIptvMyVideosClient( MIptvMyVideosClientObserver& aClientObserver );
       
   477 
       
   478     /**
       
   479      * Symbian 2nd phase constructor.
       
   480      *
       
   481      * @param aMaintenance In MDS version only MDS maintenance handling client
       
   482      *        sets this parameter to true. In legacy DB version maintenance is
       
   483      *        performed by default and for example MobileTV client should set
       
   484      *        this to true to SKIP the maintenance.
       
   485      */
       
   486     void ConstructL( TBool aMaintenance );
       
   487 
       
   488 protected: // Sending of initial requests to server.
       
   489 
       
   490     /**
       
   491      * Send request to server.
       
   492      *
       
   493      * @param aMessage     Message to send.
       
   494      * @param aFileIdParam Message parameter, global file Id.
       
   495      * @return KErrNone or one of system wide error codes.
       
   496      */
       
   497     TInt SendRequestL(
       
   498         TInt aMessage, CIptvMyVideosGlobalFileId& aFileIdParam );
       
   499 
       
   500     /**
       
   501      * Send request to server.
       
   502      *
       
   503      * @param aMessage        Message to send.
       
   504      * @param aSourceFileId   Message parameter, global file Id.
       
   505      * @param aTargetFolderId Message parameter, global folder Id.
       
   506      * @return KErrNone or one of system wide error codes.
       
   507      */
       
   508     TInt SendRequestL(
       
   509         TInt aMessage,
       
   510         CIptvMyVideosGlobalFileId& aSourceFileId,
       
   511         CIptvMyVideosGlobalFolderId& aTargetFolderId );
       
   512 
       
   513     /**
       
   514      * Send request to server.
       
   515      *
       
   516      * @param aMessage       Message to send.
       
   517      * @param aFolderIdParam Message parameter, global folder Id.
       
   518      * @return KErrNone or one of system wide error codes.
       
   519      */
       
   520     TInt SendRequestL(
       
   521         TInt aMessage, CIptvMyVideosGlobalFolderId& aFolderIdParam );
       
   522 
       
   523     /**
       
   524      * Send request to server.
       
   525      *
       
   526      * @param aMessage  Message to send.
       
   527      * @param aFolderId Message parameter, global folder Id.
       
   528      * @param aName     Message parameter, name.
       
   529      * @return KErrNone or one of system wide error codes.
       
   530      */
       
   531     TInt SendRequestL(
       
   532         TInt aMessage,
       
   533         CIptvMyVideosGlobalFolderId& aFolderId,
       
   534         const TDesC& aName );
       
   535 
       
   536     /**
       
   537      * Send request to server.
       
   538      *
       
   539      * @param aMessage        Message to send.
       
   540      * @param aSourceFolderId Message parameter, global folder Id.
       
   541      * @param aTargetFolderId Message parameter, global folder Id.
       
   542      * @return KErrNone or one of system wide error codes.
       
   543      */
       
   544     TInt SendRequestL(
       
   545         TInt aMessage,
       
   546         CIptvMyVideosGlobalFolderId& aSourceFolderId,
       
   547         CIptvMyVideosGlobalFolderId& aTargetFolderId );
       
   548 
       
   549     /**
       
   550      * Send request to server.
       
   551      *
       
   552      * @param aMessage       Message to send.
       
   553      * @param aFolderIdParam Message parameter, global folder Id.
       
   554      * @param aUintParam1    Message parameter, TUint32.
       
   555      * @param aUintParam2    Message parameter, TUint32.
       
   556      * @return KErrNone or one of system wide error codes.
       
   557      */
       
   558     TInt SendRequestL(
       
   559         TInt aMessage,
       
   560         CIptvMyVideosGlobalFolderId& aFolderIdParam,
       
   561         TUint32 aUintParam1,
       
   562         TUint32 aUintParam2 );
       
   563 
       
   564     /**
       
   565      * Send request to server.
       
   566      *
       
   567      * @param aMessage Message to send.
       
   568      * @param aVideoFullDetails Message parameter, video full details.
       
   569      * @return KErrNone or one of system wide error codes.
       
   570      */
       
   571     TInt SendRequestL(
       
   572         TInt aMessage,
       
   573         CIptvMyVideosVideoFullDetails& aVideoFullDetails );
       
   574 
       
   575     /**
       
   576      * Send request to server.
       
   577      *
       
   578      * @param aMessage Message to send.
       
   579      * @param aVideoFullDetails Message parameter, video full details.
       
   580      * @param aUintParam1       Message parameter, TUint32.
       
   581      * @param aUintParam2       Message parameter, TUint32.
       
   582      * @return KErrNone or one of system wide error codes.
       
   583      */
       
   584     TInt SendRequestL(
       
   585         TInt aMessage,
       
   586         CIptvMyVideosVideoFullDetails& aVideoFullDetails,
       
   587         TUint32 aUintParam1,
       
   588         TUint32 aUintParam2 );
       
   589 
       
   590     /**
       
   591      * Send request to server.
       
   592      *
       
   593      * @param aMessage Message to send.
       
   594      * @param aFileIdParam Message parameter, global file Id.
       
   595      * @param aUintParam   Message parameter, TUint32.
       
   596      * @return KErrNone or one of system wide error codes.
       
   597      */
       
   598     TInt SendRequestL(
       
   599         TInt aMessage,
       
   600         CIptvMyVideosGlobalFileId& aFileIdParam,
       
   601         TUint32 aUintParam );
       
   602 
       
   603 protected: // Handling servers replies to initial requests.
       
   604 
       
   605     /**
       
   606      * Handles received size reply and starts data request.
       
   607      *
       
   608      * @param aMessage Message.
       
   609      * @return KErrNone or one of system wide error codes.
       
   610      */
       
   611     TInt HandleMyVideosSizeReqL( TInt aMessage );
       
   612 
       
   613     /**
       
   614      * Generic method for finishing request with no response data.
       
   615      *
       
   616      * @return KErrNone or one of system wide error codes.
       
   617      */
       
   618     TInt HandleMyVideosReqL();
       
   619 
       
   620     /**
       
   621      * Handle get folder list data request.
       
   622      *
       
   623      * @param aTotalAmount On return, total amount of folders.
       
   624      * @param aFolderList  On return, folder list.
       
   625      * @return KErrNone or one of system wide error codes.
       
   626      */
       
   627     TInt HandleMyVideosGetFolderListDataReqL(
       
   628         TUint32& aTotalAmount,
       
   629         RPointerArray<CIptvMyVideosFolder>& aFolderList );
       
   630 
       
   631     /**
       
   632      * Handle get parent folder data request.
       
   633      *
       
   634      * @param aParentFolder On return, parent folder Id.
       
   635      * @return KErrNone or one of system wide error codes.
       
   636      */
       
   637     TInt HandleMyVideosGetParentFolderDataReqL(
       
   638         CIptvMyVideosGlobalFolderId& aParentFolder );
       
   639 
       
   640     /**
       
   641      * Handle get folder name data request.
       
   642      *
       
   643      * @param On return, name.
       
   644      * @return KErrNone or one of system wide error codes.
       
   645      */
       
   646     TInt HandleMyVideosGetFolderNameDataReqL( TDes& aName );
       
   647 
       
   648     /**
       
   649      * Handle get video list data request.
       
   650      *
       
   651      * @param On return, total amount of videos.
       
   652      * @param On return, list of videos.
       
   653      * @return KErrNone or one of system wide error codes.
       
   654      */
       
   655     TInt HandleMyVideosGetVideoListDataReqL(
       
   656         TUint32& aTotalAmount,
       
   657         RPointerArray<CIptvMyVideosVideoBriefDetails>& aVideoList );
       
   658 
       
   659     /**
       
   660      * Handle get video full details data request.
       
   661      *
       
   662      * @param On return, video full details.
       
   663      * @return KErrNone or one of system wide error codes.
       
   664      */
       
   665     TInt HandleMyVideosGetVideoDetailsDataReqL(
       
   666         CIptvMyVideosVideoFullDetails& aFullDetails );
       
   667 
       
   668     /**
       
   669      * Handle copy folder data request.
       
   670      *
       
   671      * @param aFailed On return, count of failed items.
       
   672      * @return KErrNone or one of system wide error codes.
       
   673      */
       
   674     TInt HandleMyVideosCopyFolderDataReqL(
       
   675         TUint32& aFailed );
       
   676 
       
   677     /**
       
   678      * Handle move folder data request.
       
   679      *
       
   680      * @param aFailed On return, count of failed items.
       
   681      * @return KErrNone or one of system wide error codes.
       
   682      */
       
   683     TInt HandleMyVideosMoveFolderDataReqL( TUint32& aFailed );
       
   684 
       
   685     /**
       
   686      * Handle new database folder data request.
       
   687      *
       
   688      * @param On return, Global folder Id of new folder.
       
   689      * @return KErrNone or one of system wide error codes.
       
   690      */
       
   691     TInt HandleMyVideosNewDatabaseFolderDataReqL(
       
   692         CIptvMyVideosGlobalFolderId& aNewFolderId );
       
   693 
       
   694     /**
       
   695      * Handle ensure free space data request.
       
   696      *
       
   697      * @param On return, Global File Id of new file.
       
   698      * @return KErrNone or one of system wide error codes.
       
   699      */
       
   700     TInt HandleMyVideosEnsureFreeSpaceDataReqL(
       
   701         CIptvMyVideosGlobalFileId& aNewFileId );
       
   702 
       
   703     /**
       
   704      * Checks if a string has any of the characters that are invalid
       
   705      * as a part of file name.
       
   706      *
       
   707      * @param aString String to check.
       
   708      * @return ETrue if string inludes invalid characters.
       
   709      */
       
   710     TBool HasInvalidFileNameChars( const TDesC& aString );
       
   711 
       
   712 private: // Data
       
   713 
       
   714     /**
       
   715      * iClientObserver A referense to observer of the client which is making the requests.
       
   716      */
       
   717     MIptvMyVideosClientObserver& iClientObserver;
       
   718 
       
   719     /**
       
   720      * iSession, the server session.
       
   721      */
       
   722     RIptvClientSession iSession;
       
   723 
       
   724     /**
       
   725      * iMsg Heap object to restore memory for IPC messaging.
       
   726      */
       
   727     HBufC8* iMsg;
       
   728 
       
   729     /**
       
   730      * iMsgPtr Passed to RIptvClientSession object to store the sent and received data.
       
   731      *          Points to iData heap object.
       
   732      */
       
   733     TPtr8 iMsgPtr;
       
   734 
       
   735     /**
       
   736      * Observer for content update messages from server.
       
   737      */
       
   738     CIptvMyVideosContentUpdateObserver* iContentUpdateObserver;
       
   739 
       
   740     /**
       
   741      * Observer for total video length responses from server.
       
   742      */
       
   743     CIptvMyVideosTotalVideoLengthObserver* iTotalVideoLengthObserver;
       
   744 
       
   745     /**
       
   746      * Observer for copy or move completed responses from server.
       
   747      */
       
   748     CIptvMyVideosCopyOrMoveObserver* iCopyOrMoveObserver;
       
   749 
       
   750     /**
       
   751      * Active request of this object.
       
   752      */
       
   753     TInt iActiveRequest;
       
   754     };
       
   755 
       
   756 #endif // CIPTVMYVIDEOSCLIENT_H