diff -r 000000000000 -r c53acadfccc6 harvester/harvesterplugins/WMVPlugin/inc/harvesterwmvplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/harvester/harvesterplugins/WMVPlugin/inc/harvesterwmvplugin.h Mon Jan 18 20:34:07 2010 +0200 @@ -0,0 +1,170 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "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: Harvests metadata for wmv video file +* +*/ + +#ifndef C_HARVESTERWMVPLUGIN_H +#define C_HARVESTERWMVPLUGIN_H + +#include +#include + +// forward declaration +class CMdEPropertyDef; +class CMdEObjectDef; + +const TInt KMaxTitleLength( 255 ); //to fit in db +const TInt KMaxMimeTypeLength( KMaxDataTypeLength ); + +/** + * Helper class to hold all property definitions + * (pointers are not owned) used in harvester OMA DRM plug-in. + */ +class CHarvesterWmvPluginPropertyDefs : public CBase + { + public: + // Common property definitions + CMdEPropertyDef* iCreationDatePropertyDef; + CMdEPropertyDef* iLastModifiedDatePropertyDef; + CMdEPropertyDef* iSizePropertyDef; + CMdEPropertyDef* iItemTypePropertyDef; + + private: + CHarvesterWmvPluginPropertyDefs(); + + void ConstructL(CMdEObjectDef& aObjectDef); + + public: + static CHarvesterWmvPluginPropertyDefs* NewL(CMdEObjectDef& aObjectDef); + }; + +/** + * Data class for wmv harvester + * + * Includes clip metadata to save to db. + * + */ +class CHarvesterWmvClipDetails : public CBase + { +public: + + /** NewL */ + static CHarvesterWmvClipDetails* NewL() + { + CHarvesterWmvClipDetails* self = new (ELeave) CHarvesterWmvClipDetails; + return self; + } + + /** Destructor */ + virtual ~CHarvesterWmvClipDetails() + { + } + +public: + + /** + * Mime type + */ + TBuf iMimeType; + + /** + * Modification date + */ + TTime iModifiedDate; + + /** + * File size + */ + TUint32 iFileSize; + +private: + + /** + * Default constructor + */ + CHarvesterWmvClipDetails() : iFileSize( 0 ) + { + } + + }; + +#include +#include "harvesterdata.h" + +/** + * This class implements WMV harvester plugin. + * + * @lib harvesterwmvplugin.dll + * @since S60 S60 v3.2 + */ +class CHarvesterWMVPlugin : public CHarvesterPlugin + { +public: + + /** + * Constructs a new CHarvesterWMVPlugin implementation. + * + * @return A pointer to the new CHarvesterWMVPlugin implementation + */ + static CHarvesterWMVPlugin* NewL(); + + /** + * Destructor. + */ + virtual ~CHarvesterWMVPlugin(); + +// from base class CHarvesterPlugin + + /** + * Harvest file. + * + * @param aHarvesterData + */ + void HarvestL( CHarvesterData* aHarvesterData ); + +private: + + /** + * C++ constructor + */ + CHarvesterWMVPlugin(); + + /** + * 2nd phase constructor + */ + void ConstructL(); + + /** + * Gathers data from file to meta data object. + * Leaves if mime type is not supported + * + * @param aMetadataObject Reference to metadata object to gather the data. + */ + void GatherDataL( CMdEObject& aMetadataObject, CHarvesterWmvClipDetails& aClipDetails ); + + /** + * Handle object properties + */ + void HandleObjectPropertiesL( + CHarvesterData& aHD, + CHarvesterWmvClipDetails& aClipDetails, + TBool aIsAdd); + + +private: // data + CHarvesterWmvPluginPropertyDefs* iPropDefs; + }; + +#endif // C_HARVESTERWMVPLUGIN_H