usbengines/usbotgwatcher/inc/cusbstatehostainitiate.h
branchRCL_3
changeset 65 a44cdf4b4bf0
parent 0 1e05558e2206
child 21 ff9df6630274
--- a/usbengines/usbotgwatcher/inc/cusbstatehostainitiate.h	Fri Feb 19 23:50:32 2010 +0200
+++ b/usbengines/usbotgwatcher/inc/cusbstatehostainitiate.h	Fri Mar 12 15:48:40 2010 +0200
@@ -1,37 +1,39 @@
 /*
-* Copyright (c) 2008-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:  Implementation of the concret state
+ * Copyright (c) 2008-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:  Implementation of the concret state
+ *
+ */
 
 #ifndef C_USBSTATEHOSTAINITIATE_H
 #define C_USBSTATEHOSTAINITIATE_H
 
-#include "cusbotgwatcher.h"
-#include "cusbstatehostainitiatebase.h"
+#include "cusbstatehostabase.h"
+
 #ifndef STIF
 #include "cusbtimer.h"
 #else
 #include "mockcusbtimer.h"
 #endif
 
+class CUsbOtgWatcher;
+
 /**
  *  This class implements behaviour when Id pin just detected (initiating host role, loading drivers)
  *
  */
-NONSHARABLE_CLASS( CUsbStateHostAInitiate ) : public CUsbStateHostAInitiateBase
+NONSHARABLE_CLASS( CUsbStateHostAInitiate ) : public CUsbStateHostABase,
+MUsbTimerObserver
     {
     friend class CtUsbOtgWatcher;
 
@@ -41,7 +43,7 @@
      * Two-phased constructor.
      * @param aWatcher owner
      */
-    static CUsbStateHostAInitiate* NewL(CUsbOtgWatcher* aWatcher);
+    static CUsbStateHostAInitiate* NewL(CUsbOtgWatcher& aWatcher);
 
     /**
      * Destructor.
@@ -50,11 +52,18 @@
 
 private:
 
+    // From MUsbTimerObserver
+    /**
+     * timer expired call back
+     * @param aTimerId timer id
+     */
+    void TimerElapsedL(TUsbTimerId aTimerId);
+
     /**
      * default construction
      * @param aWatcher owner
      */
-    CUsbStateHostAInitiate(CUsbOtgWatcher* aWatcher);
+    CUsbStateHostAInitiate(CUsbOtgWatcher& aWatcher);
 
     /**
      * 2nd phase construction
@@ -75,14 +84,54 @@
      *
      */
     void JustAdvancedToThisStateL();
-    
+
     /**
      * This is called when switched to this state, 
      * because If all conditions for transition to another state exist, nothing will 
      * trigger it and transition will not happen. This forces the transition in such cases.
      *
      */
-    virtual void JustBeforeLeavingThisStateL();
+    void JustBeforeLeavingThisStateL();
+
+    // From VBus observer
+    /**
+     * VBus up
+     */
+    void VBusUpL();
+
+    // From Host Event notification observer
+    /**
+     * Device is attached
+     * @param Device event data
+     */
+    void DeviceAttachedL(TDeviceEventInformation);
+
+    /**
+     * Device is detached
+     * @param Device event data
+     */
+    void DriverLoadSuccessL(TDeviceEventInformation);
+
+    /**
+     * Drivers loaded partially
+     * @param Device event data
+     */
+    void DriverLoadPartialSuccessL(TDeviceEventInformation);
+
+    /**
+     * Drivers loading failed
+     * @param Device event data
+     */
+    void DriverLoadFailureL(TDeviceEventInformation);
+
+private:
+    // data
+
+    /*
+     * attachment timer
+     * own
+     */
+    CUsbTimer* iAttachmentTimer;
 
     };