connectionmonitoring/connmon/connectionmonitor/inc/ConnMonHsdpaNotifier.h
author Simon Howkins <simonh@symbian.org>
Thu, 18 Nov 2010 15:05:52 +0000
branchRCL_3
changeset 76 40780c2f3a6b
parent 0 5a93021fdf25
permissions -rw-r--r--
Adjusted to avoid exports, etc, from a top-level bld.inf

/*
* Copyright (c) 2008 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:  Active object to listen for HSxPA notifications.
*
*/

#ifndef CONNMONHSDPANOTIFIER_H
#define CONNMONHSDPANOTIFIER_H

#include <es_sock.h>
#include <in_sock.h>
#include <es_enum.h>

// Forward declarations
class CConnMonServer;

/**
 * CHsxpaAvailabilityNotifier
 */
NONSHARABLE_CLASS( CConnMonHsdpaNotifier ) : public CActive
    {
public:
    static CConnMonHsdpaNotifier* NewL(
            CConnMonBearerNotifier* aObserver,
            CConnMonServer* aServer,
            RMobilePhone& aMobilePhone );
    virtual ~CConnMonHsdpaNotifier();

public:
    /**
     * Requests a new event (bearer (PSD) availability changed) from ETel.
     * @param aKickOff If aKickOff is ETrue initial bearer status will be obtained from ETel.
     */
    void Receive();

    /**
     * Get the current activity status of HSDPA
     * @return Returns ETrue if HSDPA is active and EFalse if not.
     */
    TBool HsdpaActive();

    /**
     * Get the current activity status of HSUPA
     * @since MCL 9.1
     * @return Returns ETrue if HSUPA is active and EFalse if not.
     */
    TBool HsupaActive();

    /**
     * Returns the current HSxPA status.
     * @since MCL 9.1
     * @return EBearerInfoWCDMA if no high speed features in use, or
     * EBearerInfoHSDPA / EBearerInfoHSUPA / EBearerInfoHSxPA.
     */
    TInt HsxpaStatus();

private:
    /**
     * From CActive Cancels the asyncronous request
     */
    void DoCancel();

    /**
     * From CActive Handles the the event that has arrived from ETel.
     */
    void RunL();

private:
    CConnMonHsdpaNotifier(
            CConnMonBearerNotifier* aObserver,
            CConnMonServer* aServer,
            RMobilePhone& aMobilePhone );
    void Construct();


private: // Data
    CConnMonBearerNotifier* iObserver;
    CConnMonServer* iServer;
    RMobilePhone& iMobilePhone;
    RPacketService iPacketService;
    RPacketService::TDynamicCapsFlags iDynCaps;
    TUint8 iPacketServLoaded; // 1 = packet services are loaded, 0 = not loaded
    TBool iHsdpaActive;
    TBool iHsupaActive;
    TInt iHsxpaStatus;
    TInt iPreviousHsxpaStatus;
    };

#endif // CONNMONHSDPANOTIFIER_H

// End-of-file