videocollection/hgmyvideos/inc/vcxhgmyvideosvideolist.h
branchRCL_3
changeset 57 befca0ec475f
equal deleted inserted replaced
56:839377eedc2b 57:befca0ec475f
       
     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:      Class for providing video list.*
       
    15 */
       
    16 
       
    17 
       
    18 
       
    19 
       
    20 #ifndef VCXHGMYVIDEOSVIDEOLIST_H
       
    21 #define VCXHGMYVIDEOSVIDEOLIST_H
       
    22 
       
    23 // INCLUDE FILES
       
    24 #include <coemain.h>
       
    25 #include <e32cmn.h>
       
    26 #include <vcxmyvideosdefs.h>
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class CMPXMedia;
       
    30 class CMPXMediaArray;
       
    31 class CVcxHgMyVideosVideoListItem;
       
    32 class TMPXItemId;
       
    33 
       
    34 // CLASS DECLARATION
       
    35 
       
    36 /**
       
    37  * Class for providing video list.
       
    38  * 
       
    39  * @lib vcxhgmyvideos.lib
       
    40  */
       
    41 NONSHARABLE_CLASS( CVcxHgMyVideosVideoList ) :
       
    42         public CBase
       
    43     {
       
    44     public: // Constructing and destructing.
       
    45 
       
    46         /**
       
    47          * Two-phased constructor.
       
    48          * 
       
    49          * @return New object.
       
    50          */
       
    51         static CVcxHgMyVideosVideoList* NewL();
       
    52 
       
    53         /**
       
    54          * Two-phased constructor.
       
    55          * 
       
    56          * @return New object. 
       
    57          */
       
    58         static CVcxHgMyVideosVideoList* NewLC();
       
    59 
       
    60         /**
       
    61          * Destructor.
       
    62          */
       
    63         virtual ~CVcxHgMyVideosVideoList();
       
    64 
       
    65     public: // Data changes.
       
    66         
       
    67         /**
       
    68          * Removes all items from the video list.
       
    69          */
       
    70         void RemoveVideoList();
       
    71         
       
    72         /**
       
    73          * Replaces video list with new one.
       
    74          * 
       
    75          * @param aVideoList Reference to new video list.
       
    76          */
       
    77         void ReplaceVideoListL( CMPXMediaArray& aVideoList );
       
    78                 
       
    79     public: // Data fetching and status information.
       
    80                
       
    81         /**
       
    82          * Checks whether the new list has the same items as the old one.
       
    83          * 
       
    84 		 * @param aVideoList The new video list.
       
    85          * @return ETrue/EFalse.
       
    86          */        
       
    87         TBool HasSameItemsL( const CMPXMediaArray& aVideoList );
       
    88 
       
    89         /**
       
    90          * Returns count of video items.
       
    91          * 
       
    92          * @return Count of items.
       
    93          */        
       
    94         TInt VideoCount();
       
    95 		
       
    96         /**
       
    97          * Removes MPX Media object from video array.
       
    98          * 
       
    99          * @param aMpxItemId MPX Item Id.
       
   100          * @return Removed index number if succeeded, otherwise KErrNotFound.
       
   101          */
       
   102         TInt RemoveVideo( TMPXItemId aMpxItemId );
       
   103         
       
   104         /**
       
   105          * Resorts the video list. The list can be sorted by date, 
       
   106 		 * size or name.
       
   107          *
       
   108          * @param aSortingOrder Sorting order used.
       
   109          */
       
   110         void ResortVideoListL( const TVcxMyVideosSortingOrder& aSortingOrder );
       
   111         
       
   112         /**
       
   113          * Adds video to video list to the correct position, 
       
   114          * according to sorting order. Ownership of video 
       
   115          * is transferred to video list.
       
   116          *
       
   117          * @param aVideo Video to add.
       
   118          * @param aSortingOrder Sorting order used.
       
   119          */
       
   120         void AddToCorrectPlaceL( CMPXMedia* aVideo,
       
   121                 TVcxMyVideosSortingOrder aSortingOrder );
       
   122         
       
   123         /**
       
   124          * Returns MPX Media object based on index.
       
   125          * 
       
   126          * @param aIndex Index to video list.
       
   127          * @return MPX Media object or NULL.
       
   128          */
       
   129         CMPXMedia* MPXMedia( TInt aIndex );
       
   130         
       
   131         /**
       
   132          * Returns MPX Media object based on MPX Item Id.
       
   133          * 
       
   134          * @pararm aMpxItemId MPX Item Id.
       
   135          * @return MPX Media object or NULL.
       
   136          */
       
   137         CMPXMedia* MPXMediaByMPXItemId( TMPXItemId aMpxItemId );
       
   138         
       
   139         /**
       
   140          * Returns correct list index based on MPX Item Id.
       
   141          * 
       
   142          * @param aMpxItemId MPX Item Id.
       
   143          * @return List index.
       
   144          */
       
   145         TInt IndexByMPXItemId( TMPXItemId aMpxItemId );
       
   146         
       
   147         /**
       
   148          * Translates array index to MPX item id by reading the value from array.
       
   149          *
       
   150          * @param aArrayIndex Index in array.
       
   151          * @return MPX item id
       
   152          */
       
   153         TMPXItemId ArrayIndexToMpxItemIdL( TInt aArrayIndex );
       
   154         
       
   155         /**
       
   156          * Returns MPX Media object based on URI.
       
   157          * 
       
   158          * @param aUri Video's URI.
       
   159          * @return MPX Media object or NULL.
       
   160          */        
       
   161         CMPXMedia* MPXMediaByUri( const TDesC& aUri );
       
   162 
       
   163     private:
       
   164 
       
   165         /**
       
   166          * Constructor.
       
   167          */
       
   168         CVcxHgMyVideosVideoList();
       
   169                 
       
   170     private:
       
   171 
       
   172         /**
       
   173          * Array of videos.
       
   174          * Own.
       
   175          */
       
   176         RPointerArray<CVcxHgMyVideosVideoListItem> iVideoList;
       
   177     };
       
   178 
       
   179 #endif // VCXHGMYVIDEOSVIDEOLIST_H