harvester/harvesterplugins/AudioPlaylistPlugin/inc/harvesteraudioplaylistplugin.h
branchRCL_3
changeset 21 85f623e1ef41
parent 20 f23c07ec56e2
child 22 29d87345eaeb
equal deleted inserted replaced
20:f23c07ec56e2 21:85f623e1ef41
     1 /*
       
     2 * Copyright (c) 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: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __CHARVESTERAUDIOPLAYLISTPLUGIN_H__
       
    20 #define __CHARVESTERAUDIOPLAYLISTPLUGIN_H__
       
    21 
       
    22 #include <mdeobject.h>
       
    23 #include <fbs.h>
       
    24 #include <imageconversion.h>
       
    25 #include <harvesterplugin.h>
       
    26 #include <monitorplugin.h>
       
    27 #include <mdesession.h>
       
    28 #include "harvesteraudioplaylistparser.h"
       
    29 
       
    30 class CHarvestData;
       
    31 
       
    32 /**
       
    33  * Helper class to hold all property definitions 
       
    34  * (pointers are not owned) used in harvester audio plug-in.
       
    35  */
       
    36 class CHarvesterAudioPlaylistPluginPropertyDefs : public CBase
       
    37     {
       
    38     public:
       
    39         // Common property definitions
       
    40         CMdEPropertyDef* iCreationDatePropertyDef;
       
    41         CMdEPropertyDef* iLastModifiedDatePropertyDef;
       
    42         CMdEPropertyDef* iSizePropertyDef;
       
    43         CMdEPropertyDef* iItemTypePropertyDef;
       
    44         CMdEPropertyDef* iTitlePropertyDef;
       
    45         
       
    46         CMdEPropertyDef* iAlbumTypeDef;
       
    47         
       
    48         CMdEPropertyDef* iAlbumIDDef;
       
    49         CMdEPropertyDef* iAudioObjectIDDef;
       
    50         CMdEPropertyDef* iPositionDef;
       
    51 
       
    52     private:
       
    53         CHarvesterAudioPlaylistPluginPropertyDefs();
       
    54     
       
    55         void ConstructL(CMdEObjectDef& aObjectDef);
       
    56 
       
    57     public: 
       
    58         static CHarvesterAudioPlaylistPluginPropertyDefs* NewL(CMdEObjectDef& aObjectDef);
       
    59     };
       
    60 
       
    61 
       
    62 class CHarvesterAudioPlaylistPlugin : public CHarvesterPlugin
       
    63 	{
       
    64 	public:
       
    65 		/**
       
    66 		* Construction
       
    67 		* @return Harvester audio plugin
       
    68 		*/
       
    69 		static CHarvesterAudioPlaylistPlugin* NewL();
       
    70 
       
    71 		/**
       
    72 		* Destruction
       
    73 		*/
       
    74 		virtual ~CHarvesterAudioPlaylistPlugin();
       
    75 
       
    76     private:
       
    77 		// Default constructor
       
    78 		CHarvesterAudioPlaylistPlugin();
       
    79 		
       
    80 		// 2nd phase constructor
       
    81 		void ConstructL();
       
    82     
       
    83     
       
    84     public: // from CHarvesterPlugin
       
    85     
       
    86 		/**
       
    87 		* Harvesting multiple files
       
    88 		* @param aHarvesterData  CHarvesterData datatype containing needed harvest data
       
    89  		* @return None
       
    90 		*/
       
    91 		void HarvestL( CHarvesterData* aHD );
       
    92 
       
    93 	private:
       
    94 	     
       
    95 		/**
       
    96 		* Harvesting multiple files
       
    97 		* @param aHarvesterData  CHarvesterData datatype containing needed harvest data
       
    98  		* 
       
    99 		*/
       
   100 		void DoHarvestL( CHarvesterData* aHD );
       
   101 
       
   102 		/**
       
   103 		 * Handles creation of new mde objects.
       
   104 		 */
       
   105 		void GetPropertiesL( CHarvesterData* aHarvesterData, TBool aIsAdd );
       
   106 		 		
       
   107 		/**
       
   108 		 * Get placeholder properties (creation time, modify time and file size).
       
   109 		 */
       
   110         void GetPlaceHolderPropertiesL( CHarvesterData* aHD, TBool aIsAdd );
       
   111 		
       
   112 		/**
       
   113 		 * Get media file mime type (eg. "audio/mp3").
       
   114 		 */
       
   115         TBool GetMimeTypePropertyL( CHarvesterData* aHD, TBool aIsAdd );
       
   116 
       
   117 		/**
       
   118 		 * Get song name, artist, album, genre and composer from normal music
       
   119          * file (eg. mp3).
       
   120 		 */
       
   121         void GetMusicPropertiesL( CHarvesterData* aHD, TBool aIsAdd );
       
   122 
       
   123 	private:
       
   124 		CHarvesterAudioPlaylistParser* iPlaylistParser;
       
   125 		HBufC* iMime;
       
   126 		
       
   127 	    CHarvesterAudioPlaylistPluginPropertyDefs* iPropDefs;
       
   128 
       
   129         TInt iError;
       
   130 	};
       
   131 
       
   132 
       
   133 #endif  // __CHARVESTERAUDIOPLAYLISTPLUGIN_H__
       
   134