videocollection/hgmyvideos/inc/vcxhgmyvideosvideolistitem.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 25 May 2010 12:44:54 +0300
branchRCL_3
changeset 23 8f0df5c82986
parent 0 96612d01cf9f
permissions -rw-r--r--
Revision: 201019 Kit: 2010121

/*
* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of the License "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:   CVcxHgMyVideosVideoListItem class definition*
*/




#ifndef VCXHGMYVIDEOSVIDEOLISTITEM_H
#define VCXHGMYVIDEOSVIDEOLISTITEM_H

// INCLUDE FILES
#include <coemain.h>
#include <mpxitemid.h>
#include "vcxmyvideosdefs.h"

// FORWARD DECLARATIONS
class CMPXMedia;

// CLASS DECLARATION

/**
 *
 * @lib vcxhgmyvideos.lib
 */
NONSHARABLE_CLASS( CVcxHgMyVideosVideoListItem ) : public CBase
    {
    public:

        /**
         * Two-phased constructor.
		 *
         * @param aMPXMedia MPX Media object, ownership is transferred.
         * @return New object.
         */
        static CVcxHgMyVideosVideoListItem* NewL( CMPXMedia* aMPXMedia );

        /**
         * Two-phased constructor.
		 *
         * @param aMPXMedia MPX Media object, ownership is transferred.
         * @return New object. 
         */
        static CVcxHgMyVideosVideoListItem* NewLC( CMPXMedia* aMPXMedia );

        /**
		 * Compares aNewVideo and aVideoInArray objects by size.
		 * 
		 * @param aNewVideo Video to be added to the list. 
		 * @param aVideoInArray Video in array which is currently compared against aNewVideo.
		 * @return 1 if aNewVideo size is greater, -1 if smaller and 0 if equal.
		 */
		static TInt CompareBySize( const CVcxHgMyVideosVideoListItem& aNewVideo,
                                   const CVcxHgMyVideosVideoListItem& aVideoInArray );
        
		/**
		 * Compares aNewVideo and aVideoInArray objects by name.
		 * 
		 * @param aNewVideo Video to be added to the list. 
		 * @param aVideoInArray Video in array which is currently compared against aNewVideo.
		 * @return -1 if aVideoInArray has smaller value, 1 if greater and 0 if equal.
		 */
		static TInt CompareByName( const CVcxHgMyVideosVideoListItem& aNewVideo,
                                   const CVcxHgMyVideosVideoListItem& aVideoInArray );
        
        /**
		 * Compares aNewVideo and aVideoInArray objects by date.
		 * 
		 * @param aNewVideo Video to be added to the list. 
		 * @param aVideoInArray Video in array which is currently compared against aNewVideo.
		 * @return -1 if aVideoInArray has smaller value, 1 if greater and 0 if equal.
		 */
		static TInt CompareByDate( const CVcxHgMyVideosVideoListItem& aNewVideo,
                                   const CVcxHgMyVideosVideoListItem& aVideoInArray );
		
	    /**
         * Returns MPX Media object.
		 *
		 * @return MPX Media object.
         */
		CMPXMedia* Media();
                
        /**
         * Destructor.
         */
        virtual ~CVcxHgMyVideosVideoListItem();                      
        
    private: // Constructors

        /**
         * Default constructor.
		 *
		 * @param aMPXMedia MPX Media object, ownership is transferred.
         */
        CVcxHgMyVideosVideoListItem( CMPXMedia* aMPXMedia );

        /**
         * 2nd phase constructor.
         */
        void ConstructL();       
    
    private: // Data
        
        /**
		 * MPX media object.
         * Own.
		 */
        CMPXMedia*                      iMedia;
    };

#endif // VCXHGMYVIDEOSVIDEOLISTITEM_H