hotspotfw/hsserver/inc/hssnotif.h
changeset 0 56b72877c1cb
equal deleted inserted replaced
-1:000000000000 0:56b72877c1cb
       
     1 /*
       
     2 * Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:   Implementation of HotSpot Server
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef HSSNOTIF_H
       
    20 #define HSSNOTIF_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include "hssinterface.h"
       
    24 #include <wlanmgmtcommon.h>
       
    25 #include <wlanmgmtinterface.h>
       
    26 #include "hotspotsession.h"
       
    27 #include "hotspotclientserver.h"
       
    28 
       
    29 // FORWARD DECLARATIONS
       
    30 class CHotSpotSession;
       
    31 class CSessionNotification;
       
    32 
       
    33 // CLASS DECLARATION
       
    34 /**
       
    35 * HssNotifications, callback implementation of MWlanMgmtNotifications.
       
    36 */
       
    37 class HssNotifications : public MWlanMgmtNotifications
       
    38 	{
       
    39    public:
       
    40 
       
    41     	/**
       
    42     	* Constructor.
       
    43     	*/
       
    44 		HssNotifications(CHotSpotSession& aSession): iSession(aSession){}
       
    45         /**
       
    46         * Connection status has changed.
       
    47         */
       
    48         virtual void ConnectionStateChanged( TWlanConnectionMode /* aNewState */ ) {};
       
    49         
       
    50         /**
       
    51         * BSSID has changed (i.e. AP handover).
       
    52         */
       
    53         virtual void BssidChanged( TWlanBssid& /* aNewBSSID */ ) {};
       
    54 
       
    55         /**
       
    56         * Connection has been lost.
       
    57         */
       
    58         virtual void BssLost() {};
       
    59 
       
    60         /**
       
    61         * Connection has been regained.
       
    62         */
       
    63         virtual void BssRegained() {};
       
    64 
       
    65         /**
       
    66         * New networks have been detected during scan.
       
    67         */
       
    68         virtual void NewNetworksDetected();
       
    69 
       
    70         /**
       
    71         * One or more networks have been lost since the last scan.
       
    72         */
       
    73         virtual void OldNetworksLost();
       
    74 
       
    75         /**
       
    76         * The used transmit power has been changed.
       
    77         * @param aPower The transmit power in mW.
       
    78         */
       
    79         virtual void TransmitPowerChanged( TUint /* aPower */ ) {};
       
    80         
       
    81         /**
       
    82         * Received signal strength level has been changed.
       
    83         * @param aRssClass specifies the current class of the received signal
       
    84         * @param aRss RSS level in absolute dBm values.
       
    85         */
       
    86         virtual void RssChanged(TWlanRssClass /* aRssClass */, TUint /* aRss */ ) {};
       
    87 
       
    88    		private:
       
    89    		
       
    90         /**
       
    91         * Callback interface to Session.
       
    92         */
       
    93    		CHotSpotSession& iSession;
       
    94 
       
    95 	};
       
    96 // CLASS DECLARATION
       
    97 /**
       
    98 * Base class for all notification types.
       
    99 *
       
   100 * Basically this only determines the interface how Server is forwarding 
       
   101 * notifications to Sessions or WAL.
       
   102 */
       
   103 class CNotificationBase : public CBase
       
   104     {
       
   105     public:  // Constructors and destructor
       
   106 
       
   107         /**
       
   108         * Destructor.
       
   109         */
       
   110         virtual ~CNotificationBase() {};
       
   111 
       
   112     public: // New functions
       
   113 
       
   114         /**
       
   115          * AddNotification
       
   116          * @param aNotification identifier
       
   117          * @param aData content of the notification
       
   118          */
       
   119         virtual void AddNotification(
       
   120             TUint aNotification,
       
   121             TDes8& aData ) = 0;            
       
   122     };
       
   123 
       
   124 // CLASS DECLARATION
       
   125 /**
       
   126 * Forwards notifications to a session.
       
   127 */
       
   128 NONSHARABLE_CLASS( CSessionNotification ) : public CNotificationBase
       
   129     {
       
   130     public:  // Constructors and destructor
       
   131 
       
   132         /**
       
   133         * Two-phased constructor.
       
   134         */
       
   135         static CSessionNotification* NewL( CHotSpotSession& aSession );
       
   136 
       
   137         /**
       
   138         * Destructor.
       
   139         */
       
   140         virtual ~CSessionNotification();
       
   141 
       
   142     public: // Functions from base classes
       
   143 
       
   144         /**
       
   145          * AddNotification
       
   146          * @param aNotification identifier
       
   147          * @param aData content of the notification
       
   148          */
       
   149         void AddNotification( TUint aNotification, TDes8& aData );
       
   150 
       
   151     private: // Methods
       
   152 
       
   153         /**
       
   154         * C++ default constructor.
       
   155         */
       
   156         CSessionNotification( CHotSpotSession& aSession );
       
   157 
       
   158     private:    // Data
       
   159 
       
   160         /** Interface to session to forward notifications. */
       
   161         CHotSpotSession& iSession;
       
   162     };
       
   163     
       
   164 
       
   165 #endif // HSSNOTIF_H