voicerecorder/RecViewSrc/CVRRecViewModel.cpp
branchRCL_3
changeset 10 bb90e4148332
parent 8 49233e24b2ab
child 13 4e5b531d23cb
--- a/voicerecorder/RecViewSrc/CVRRecViewModel.cpp	Wed Mar 31 21:35:17 2010 +0300
+++ b/voicerecorder/RecViewSrc/CVRRecViewModel.cpp	Wed Apr 14 16:00:13 2010 +0300
@@ -54,6 +54,7 @@
 #include "VRConsts.h"
 #include "CVRSystemEventHandler.h"
 #include "CVRUSBEventHandler.h"
+#include "CVRMediaRemovalMonitor.h"
 #include "VRUtils.h"
 #include "CVRRecViewModel.h"
 #include <csxhelp/vorec.hlp.hrh>
@@ -115,6 +116,8 @@
 
 	delete iCurrentUSBHandler;
 	
+	delete iCurrentMMCEjectHandler;
+	
 	}
 
 
@@ -135,6 +138,8 @@
 	iCurrentUSBHandler->Listen( KPSUidUsbWatcher, KUsbWatcherSelectedPersonality,
 								 this );
 
+	//listen MMC eject
+	iCurrentMMCEjectHandler = CVRMediaRemovalMonitor::NewL(EDriveF, CEikonEnv::Static()->FsSession(), this);
 
 	if ( FeatureManager::FeatureSupported( KFeatureIdKeypadNoVoiceKey ) &&
 		FeatureManager::FeatureSupported( 
@@ -2445,3 +2450,29 @@
 
 
 // End of file
+
+
+// ---------------------------------------------------------------------------
+// CVRRecViewModel::HandleMMCEjectEventL
+// 
+// ---------------------------------------------------------------------------
+//
+void CVRRecViewModel::HandleMMCEjectEventL()
+	{
+	
+	// Actions to take when recording
+	TInt storageDrive = VRUtils::MemoDriveL();   	 
+    if ( storageDrive == EDriveF)
+		{
+        //exit for mmc dismount	
+        TWsEvent event;
+        event.SetType( EAknSoftkeyExit );
+        event.SetTimeNow();
+        event.SetHandle( CCoeEnv::Static()->WsSession().WsHandle() );
+        CCoeEnv::Static()->WsSession().SendEventToWindowGroup( CEikonEnv::Static()->RootWin().Identifier(), event );
+        return;       
+		}
+	}
+
+
+// End of file