harvester/monitorplugins/mmcplugin/inc/mmcmounttaskao.h
changeset 0 c53acadfccc6
child 3 b73a2e62868f
equal deleted inserted replaced
-1:000000000000 0:c53acadfccc6
       
     1 /*
       
     2 * Copyright (c) 2006-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:  Handles mount tasks*
       
    15 */
       
    16 
       
    17 #ifndef __MMCMOUNTTASKAO_H__
       
    18 #define __MMCMOUNTTASKAO_H__
       
    19 
       
    20 #include <e32base.h>
       
    21 #include <e32msgqueue.h>
       
    22 #include <f32file.h>
       
    23 
       
    24 #include "monitorplugin.h"
       
    25 #include "mdeharvestersession.h"
       
    26 #include "mmcfilelist.h"
       
    27 #include "harvestereventmanager.h"
       
    28 
       
    29 class CHarvesterPluginFactory;
       
    30 
       
    31 class CMMCMountTaskAO : public CActive
       
    32   	{
       
    33 	public:
       
    34 		enum TRequest
       
    35 			{
       
    36 			ERequestStartTask,
       
    37 			ERequestMount,
       
    38 			ERequestUnmount,
       
    39 			ERequestFormat,
       
    40 			ERequestHandleFileEntry,
       
    41 			ERequestHandleReharvest,
       
    42 			ERequestCleanup,
       
    43 			ERequestIdle
       
    44 			};
       
    45 
       
    46 		static CMMCMountTaskAO* NewL();	
       
    47 		virtual ~CMMCMountTaskAO();
       
    48 		
       
    49 		void StartMount( TMountData& aMountData );
       
    50 		void StartUnmount( TMountData& aMountData );
       
    51 		void SetMonitorObserver( MMonitorPluginObserver& aObserver );
       
    52 		void SetMdeSession( CMdEHarvesterSession* aSession );
       
    53 		void SetHarvesterPluginFactory( CHarvesterPluginFactory* aPluginFactory );
       
    54 		
       
    55 		/**
       
    56 		 * Returns internal hard drive's media id if the device has one. 0 if not or drive is not present
       
    57 		 */
       
    58 		TUint32 GetInternalDriveMediaId();
       
    59 		
       
    60         void SetCachingStatus( TBool aCachingStatus );
       
    61         
       
    62 	protected:
       
    63 
       
    64 		void RunL();
       
    65 		TInt RunError( TInt aError );
       
    66 		void DoCancel();
       
    67 		void SetNextRequest( TRequest aRequest );
       
    68 		
       
    69 		void Initialize();
       
    70 		void Deinitialize();
       
    71 		void SetNotPresentToMDE();
       
    72 		void HandleReharvestL( RPointerArray<CPlaceholderData>& aArray );
       
    73 		void RemoveNotPresentFromMDE();
       
    74 		void StartNotifyL();
       
    75 		void StopNotifyL();
       
    76 		
       
    77 	private:
       
    78 	
       
    79 		CMMCMountTaskAO();		
       
    80 		void ConstructL();
       
    81 				
       
    82 	private:
       
    83 		
       
    84 		RFs iFs;
       
    85 		TRequest iNextRequest;
       
    86 		TMountData* iMountData;
       
    87 		RPointerArray<TMountData> iMountDataQueue;
       
    88 		RPointerArray<CPlaceholderData> iEntryArray;
       
    89 		RPointerArray<CPlaceholderData> iHarvestEntryArray;
       
    90 		MMonitorPluginObserver* iObserver;
       
    91 		CMdEHarvesterSession* iMdeSession;
       
    92 		CHarvesterPluginFactory* iHarvesterPluginFactory;
       
    93 		CMmcFileList* iMmcFileList;
       
    94 		CHarvesterEventManager* iHEM;
       
    95         TBool iCacheEvents;
       
    96 		
       
    97 	};
       
    98 
       
    99 #endif // __MMCMOUNTTASKAO_H__