harvester/harvesterplugins/WMVPlugin/inc/harvesterwmvplugin.h
changeset 0 c53acadfccc6
child 8 6752808b2036
equal deleted inserted replaced
-1:000000000000 0:c53acadfccc6
       
     1 /*
       
     2 * Copyright (c) 2007-2009 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 "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:  Harvests metadata for wmv video file
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef C_HARVESTERWMVPLUGIN_H
       
    19 #define C_HARVESTERWMVPLUGIN_H
       
    20 
       
    21 #include <e32base.h>
       
    22 #include <apmstd.h>
       
    23 
       
    24 // forward declaration
       
    25 class CMdEPropertyDef;
       
    26 class CMdEObjectDef;
       
    27 
       
    28 const TInt KMaxTitleLength( 255 ); //to fit in db
       
    29 const TInt KMaxMimeTypeLength( KMaxDataTypeLength );
       
    30 
       
    31 /**
       
    32  * Helper class to hold all property definitions 
       
    33  * (pointers are not owned) used in harvester OMA DRM plug-in.
       
    34  */
       
    35 class CHarvesterWmvPluginPropertyDefs : public CBase
       
    36 	{
       
    37 	public:
       
    38 		// Common property definitions
       
    39 		CMdEPropertyDef* iCreationDatePropertyDef;
       
    40 		CMdEPropertyDef* iLastModifiedDatePropertyDef;
       
    41 		CMdEPropertyDef* iSizePropertyDef;
       
    42 		CMdEPropertyDef* iItemTypePropertyDef;
       
    43 		
       
    44 	private:
       
    45 		CHarvesterWmvPluginPropertyDefs();
       
    46 	
       
    47 		void ConstructL(CMdEObjectDef& aObjectDef);
       
    48 
       
    49 	public:	
       
    50 		static CHarvesterWmvPluginPropertyDefs* NewL(CMdEObjectDef& aObjectDef);
       
    51 	};
       
    52 
       
    53 /**
       
    54  *  Data class for wmv harvester
       
    55  *
       
    56  *  Includes clip metadata to save to db.
       
    57  *
       
    58  */
       
    59 class CHarvesterWmvClipDetails : public CBase
       
    60     {
       
    61 public:
       
    62 
       
    63     /** NewL */
       
    64     static CHarvesterWmvClipDetails* NewL()
       
    65         {
       
    66         CHarvesterWmvClipDetails* self = new (ELeave) CHarvesterWmvClipDetails;
       
    67         return self;
       
    68         }
       
    69     
       
    70     /** Destructor */
       
    71     virtual ~CHarvesterWmvClipDetails()
       
    72         {
       
    73         }
       
    74     
       
    75 public:
       
    76 
       
    77     /**
       
    78     * Mime type
       
    79     */
       
    80     TBuf<KMaxMimeTypeLength> iMimeType;
       
    81 
       
    82     /**
       
    83     * Modification date
       
    84     */
       
    85     TTime iModifiedDate;
       
    86 
       
    87     /**
       
    88     * File size
       
    89     */
       
    90     TUint32 iFileSize;
       
    91 
       
    92 private:
       
    93 
       
    94     /**
       
    95      * Default constructor
       
    96      */
       
    97     CHarvesterWmvClipDetails() : iFileSize( 0 )
       
    98     {
       
    99     }
       
   100         
       
   101     };
       
   102 
       
   103 #include <harvesterplugin.h>
       
   104 #include "harvesterdata.h"
       
   105 
       
   106 /**
       
   107  *  This class implements WMV harvester plugin.
       
   108  *
       
   109  *  @lib harvesterwmvplugin.dll
       
   110  *  @since S60 S60 v3.2
       
   111  */
       
   112 class CHarvesterWMVPlugin : public CHarvesterPlugin
       
   113     {
       
   114 public:
       
   115 
       
   116     /**
       
   117      * Constructs a new CHarvesterWMVPlugin implementation.
       
   118      * 
       
   119      * @return A pointer to the new CHarvesterWMVPlugin implementation
       
   120      */
       
   121     static CHarvesterWMVPlugin* NewL();
       
   122  
       
   123     /**
       
   124     * Destructor.
       
   125     */
       
   126     virtual ~CHarvesterWMVPlugin();
       
   127 
       
   128 // from base class CHarvesterPlugin
       
   129     
       
   130     /**
       
   131     * Harvest file. 
       
   132     * 
       
   133     * @param aHarvesterData  
       
   134     */
       
   135     void HarvestL( CHarvesterData* aHarvesterData );
       
   136 
       
   137 private:
       
   138 
       
   139     /**
       
   140     * C++ constructor
       
   141     */
       
   142     CHarvesterWMVPlugin();
       
   143 
       
   144     /**
       
   145     * 2nd phase constructor
       
   146     */
       
   147     void ConstructL();
       
   148     
       
   149     /**
       
   150      * Gathers data from file to meta data object. 
       
   151      * Leaves if mime type is not supported
       
   152      *
       
   153      * @param aMetadataObject  Reference to metadata object to gather the data. 
       
   154      */
       
   155     void GatherDataL( CMdEObject& aMetadataObject, CHarvesterWmvClipDetails& aClipDetails );
       
   156      
       
   157      /**
       
   158       * Handle object properties
       
   159       */
       
   160     void HandleObjectPropertiesL( 
       
   161          CHarvesterData& aHD,
       
   162          CHarvesterWmvClipDetails& aClipDetails,
       
   163          TBool aIsAdd);
       
   164 
       
   165 
       
   166 private: // data
       
   167 	CHarvesterWmvPluginPropertyDefs* iPropDefs;
       
   168     };
       
   169 
       
   170 #endif // C_HARVESTERWMVPLUGIN_H