usbengines/usbotgwatcher/inc/cusbstatehosthandle.h
branchRCL_3
changeset 20 a15c582fbf97
parent 13 7068aba64af5
child 21 ff9df6630274
--- a/usbengines/usbotgwatcher/inc/cusbstatehosthandle.h	Fri Feb 19 23:50:33 2010 +0200
+++ b/usbengines/usbotgwatcher/inc/cusbstatehosthandle.h	Fri Mar 12 15:48:40 2010 +0200
@@ -1,42 +1,32 @@
 /*
-* 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:  Implements concrete 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:  Implements concrete state
+ *
+ */
 
 #ifndef C_USBSTATEHOSTHANDLE_H
 #define C_USBSTATEHOSTHANDLE_H
 
-#include "cusbotgwatcher.h"
-#include "cusbstate.h"
+#include "cusbstatehostabase.h"
 
-#ifndef STIF
-#include "cusbnotifmanager.h"
-#include "cusbtimer.h"
-#else
-#include "mockcusbnotifmanager.h"
-#include "mockcusbtimer.h"
-#endif
+class CUsbOtgWatcher;
 
 /**
- *  This class implements behaviour when some problem needs vbus drop, and mostly, user action.
+ *  problem handling base class
  *
  */
-NONSHARABLE_CLASS( CUsbStateHostHandle ) : public CUsbState,
-        MWaitNotifierObserver 
-// this means only one wait notifier at a time can be shown by this state, might be redesigned
+NONSHARABLE_CLASS( CUsbStateHostHandle ) : public CUsbStateHostABase
     {
     friend class CtUsbOtgWatcher;
     friend class CUsbOtgWatcher;
@@ -44,12 +34,6 @@
 public:
 
     /**
-     * Two-phased constructor.
-     * @param aWatcher owner
-     */
-    static CUsbStateHostHandle* NewL(CUsbOtgWatcher* aWatcher);
-
-    /**
      * Destructor.
      */
     virtual ~CUsbStateHostHandle();
@@ -60,82 +44,7 @@
      */
     void SetWhat(TInt aWhat);
 
-    // from MWaitNotifierObserver
-    /**
-     * Callback when notifier is completed
-     * @param aFeedback how notifier completed
-     */
-    void WaitNotifierCompletedL(TInt aFeedback);
-
-    // From VBus observer
-    /**
-     * VBus down
-     */
-    virtual void VBusUpL();
-    /**
-     * VBus down
-     */
-    virtual void VBusDownL();
-    /**
-     * VBus error happened
-     */
-    virtual void VBusErrorL();
-
-    // From OTG state observer
-    /**
-     * Became to Idle when A
-     */
-    virtual void AIdleL();
-    /**
-     * Became a Host when A
-     */
-    virtual void AHostL();
-    /**
-     * Became a peripheral when A
-     */
-    virtual void APeripheralL();
-    /**
-     * VBus error happen
-     */
-    virtual void AVBusErrorL();
-
-    // From bus activity observer
-    /**
-     * Bus is in idle
-     */
-    virtual void BusIdleL();
-    /**
-     * Bus active
-     */
-    virtual void BusActiveL();
-
-    // From Host Event notification observer
-    /**
-     * Device is attached
-     * @param aInfo Device event data
-     */
-    void DeviceAttachedL(TDeviceEventInformation aInfo);
-    /**
-     * Device is detached
-     * @param aInfo Device event data
-     */
-    void DeviceDetachedL(TDeviceEventInformation aInfo);
-    
-    /**
-      * Drivers successfully loaded
-      * @param aInfo Device event data
-      */
-    virtual void DriverLoadSuccessL(TDeviceEventInformation aInfo);
-     /**
-      * Drivers loaded partially
-      * @param aInfo Device event data
-      */
-    virtual void DriverLoadPartialSuccessL(TDeviceEventInformation aInfo);
-     /**
-      * Drivers loading failed
-      * @param aInfo Device event data
-      */
-    virtual void DriverLoadFailureL(TDeviceEventInformation aInfo);
+protected:
 
     // From message notification observer
     /**
@@ -145,21 +54,10 @@
     virtual void MessageNotificationReceivedL(TInt aMessage);
 
     /**
-     * SRP request received
-     */
-    virtual void SrpReceivedL();
-    /**
      * Session request received
      */
     virtual void SessionRequestedL();
 
-    //from CUsbState
-    /**
-     * State id
-     * @return state id
-     */
-    virtual TUsbStateIds Id();
-
     /**
      * This is called when switched to this state, 
      * because If all conditions for transition to another state exist, nothing will 
@@ -169,30 +67,21 @@
     virtual void JustAdvancedToThisStateL();
 
     /**
-     * This is called when leaving this state, 
-     *
-     */
-    virtual void JustBeforeLeavingThisStateL();
-
-    /**
      * handles issue
      */
-    virtual void DoHandleL();
-
-protected:
+    virtual void DoHandleL() = 0;
 
     /**
      * Default constructor
      * @param aWatcher owner
      */
-    CUsbStateHostHandle(CUsbOtgWatcher* aWatcher);
+    CUsbStateHostHandle(CUsbOtgWatcher& aWatcher);
 
     /**
      * 2nd phase construction
      */
     void ConstructL();
 
-protected:
     // data
 
     /**
@@ -200,6 +89,7 @@
      */
     TInt iWhat;
 
+private:
     };
 
 #endif //  C_USBSTATEHOSTHANDLE_H