usbengines/usbotgwatcher/inc/cusbstatehosthandledropping.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Fri, 12 Mar 2010 15:48:40 +0200
branchRCL_3
changeset 65 a44cdf4b4bf0
child 21 ff9df6630274
permissions -rw-r--r--
Revision: 201007 Kit: 201008

/*
 * 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_USBSTATEHOSTHANDLEDROPPING_H
#define C_USBSTATEHOSTHANDLEDROPPING_H

#include "cusbstatehosthandle.h"

#ifndef STIF
#include "cusbnotifmanager.h"
#else
#include "mockcusbnotifmanager.h"
#endif

class CUsbOtgWatcher;

/**
 *  problem handling class, dropping vbus
 *
 */
NONSHARABLE_CLASS( CUsbStateHostHandleDropping ) : public CUsbStateHostHandle,
MWaitNotifierObserver
// this means only one wait notifier at a time can be shown by this state, might be redesigned

    {
    friend class CtUsbOtgWatcher;
    friend class CUsbOtgWatcher;

public:

    /**
     * Two-phased constructor.
     * @param aWatcher owner
     */
    static CUsbStateHostHandleDropping* NewL(CUsbOtgWatcher& aWatcher);

    /**
     * Destructor.
     */
    virtual ~CUsbStateHostHandleDropping();

private:

    // from MWaitNotifierObserver
    /**
     * Callback when notifier is completed
     * @param aFeedback how notifier completed
     */
    void WaitNotifierCompletedL(TInt aFeedback);

    // From VBus observer
    /**
     * VBus up
     */
    void VBusUpL();

    /**
     * VBus down
     */
    void VBusDownL();

    // 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
     */
    void DriverLoadSuccessL(TDeviceEventInformation aInfo);

    /**
     * Drivers loaded partially
     * @param aInfo Device event data
     */
    void DriverLoadPartialSuccessL(TDeviceEventInformation aInfo);

    /**
     * Drivers loading failed
     * @param aInfo Device event data
     */
    void DriverLoadFailureL(TDeviceEventInformation aInfo);

    // From message notification observer
    /**
     * Message received
     * @param aMessage message id
     */
    void MessageNotificationReceivedL(TInt aMessage);

    //from CUsbState
    /**
     * State id
     * @return state id
     */
    virtual TUsbStateIds Id();

    /**
     * This is called when leaving this state, 
     *
     */
    void JustBeforeLeavingThisStateL();

    /**
     * handles issue
     */
    void DoHandleL();

    /**
     * Default constructor
     * @param aWatcher owner
     */
    CUsbStateHostHandleDropping(CUsbOtgWatcher& aWatcher);

    /**
     * 2nd phase construction
     */
    void ConstructL();

    };

#endif //  C_USBSTATEHOSTDROPPINGHANDLE_H