usbclasses/usbmscpersonality/tsrc/UsbMscPersonalityTest/inc/DismountClient.h
branchRCL_3
changeset 80 e02eb84a14d2
parent 77 5b2a402e96ac
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usbclasses/usbmscpersonality/tsrc/UsbMscPersonalityTest/inc/DismountClient.h	Wed Sep 01 12:20:49 2010 +0100
@@ -0,0 +1,89 @@
+/*
+* Copyright (c) 2010 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:
+*
+*/
+
+#ifndef DISMOUNTCLIENT_H
+#define DISMOUNTCLIENT_H
+
+#include <e32base.h>	// For CActive, link against: euser.lib
+#include <e32std.h>		// For RTimer, link against: euser.lib
+#include <StifLogger.h>
+#include <f32file.h>
+
+enum TAllowDismountOption
+{
+    EAllowDismount,
+    EAllowDismountAfter2Sec,
+    EAllowDismountTooLate,
+    ENotAllowDismount
+};
+
+class CDismountClient : public CActive
+    {
+public:
+    // Cancel and destroy
+    ~CDismountClient();
+
+    // Two-phased constructor.
+    static CDismountClient* NewL(CStifLogger *aLog);
+
+    // Two-phased constructor.
+    static CDismountClient* NewLC(CStifLogger *aLog);
+
+public:
+    // New functions
+    // Function for making the initial request
+    void StartL(TAllowDismountOption aAllowDismountOption);
+
+private:
+    // C++ constructor
+    CDismountClient();
+
+    // Second-phase constructor
+    void ConstructL(CStifLogger *aLog);
+
+private:
+    // From CActive
+    // Handle completion
+    void RunL();
+
+    // How to cancel me
+    void DoCancel();
+
+    // Override to handle leaves from RunL(). Default implementation causes
+    // the active scheduler to panic.
+    TInt RunError(TInt aError);
+
+private:
+    enum TDismountClientState
+        {
+        EWaitForDelay,
+        EDelay,
+        EUninitialized, // Uninitialized
+        EInitialized, // Initalized
+        EError // Error condition
+        };
+  
+private:
+    TInt iState; // State of the active object
+    RFs iFs;
+    CStifLogger *iLog;
+    RTimer iTimer;
+    TAllowDismountOption iAllowDismountOption;
+    
+    };
+
+#endif // DISMOUNTCLIENT_H