wlanutilities/wlanqtutilities/wrapper/inc/wlanqtutilsconmonwrapper_s60_p.h
branchGCC_SURGE
changeset 47 b3d8f88532b7
parent 34 30a5f517c615
parent 46 2fbd1d709fe7
equal deleted inserted replaced
34:30a5f517c615 47:b3d8f88532b7
     1 /*
       
     2  * Copyright (c) 2009 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:
       
    15  * This is a header file for following classes:
       
    16  * ConnMonScanWlanAps.
       
    17  */
       
    18 
       
    19 #ifndef WLANQTUTILSCONMONWRAPPER_S60_P_H_
       
    20 #define WLANQTUTILSCONMONWRAPPER_S60_P_H_
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <rconnmon.h>
       
    25 #include "wlanqtutilscommon.h"
       
    26 
       
    27 class ConMonWrapper;
       
    28 
       
    29 QT_BEGIN_NAMESPACE
       
    30 
       
    31 // CLASS DECLARATION
       
    32 
       
    33 /**
       
    34  * ConnMonScanWlanAps class.
       
    35  */
       
    36 class ConnMonScanWlanAps : public CActive
       
    37     {
       
    38 
       
    39 public:
       
    40     // Constructor and destructor
       
    41 
       
    42     /**
       
    43      * Default constructor
       
    44      */
       
    45     ConnMonScanWlanAps(ConMonWrapper *wrapper);
       
    46 
       
    47     /**
       
    48      * Destructor
       
    49      */
       
    50     ~ConnMonScanWlanAps();
       
    51 
       
    52 public:
       
    53     // New functions    
       
    54 
       
    55     /**
       
    56      * scanAvailableWlanAPs
       
    57      * scans all available WLAN APs
       
    58      * @return error code
       
    59      */
       
    60     int scanAvailableWlanAPs();
       
    61 
       
    62 private:
       
    63     // From CActive
       
    64 
       
    65     /**
       
    66      * Implements cancellation of an outstanding request.
       
    67      */
       
    68     void DoCancel();
       
    69 
       
    70     /**
       
    71      * Handles an active object's request completion event.
       
    72      */
       
    73     void RunL();
       
    74 
       
    75     /**
       
    76      * conMon2WlanQtUtilsSecModeMap
       
    77      * Maps Connection monitor's WLAN security mode value into WlanQtUtilsWlanSecMode.
       
    78      * @aSecMode: security mode, ConnMon style,
       
    79      * @return: security mode, Wlan Qt Utilities style.
       
    80      */
       
    81     WlanQtUtilsWlanSecMode conMon2WlanQtUtilsSecModeMap(TUint aSecMode);
       
    82 
       
    83 private:
       
    84     // Data
       
    85 
       
    86     /**
       
    87      * q_ptr pointer to ConMonWrapper
       
    88      * Owned by ConnMonScanWlanAps object, instantiated in
       
    89      * constructor.
       
    90      */
       
    91     ConMonWrapper *q_ptr;
       
    92 
       
    93     /**
       
    94      * Handle to Connection Monitor Server
       
    95      */
       
    96     RConnectionMonitor iMonitor;
       
    97 
       
    98     /**
       
    99      * Scan package used with Connection Monitor Server scan request
       
   100      * Owned by ConnMonScanWlanAps object.
       
   101      */
       
   102     CConnMonWlanNetworksPtrArrayPckg* wlanBuf;
       
   103 
       
   104     /**
       
   105      * wlan pointer variable used with Connection Monitor Server scan request
       
   106      */
       
   107     TPtr wlanPtr;
       
   108     };
       
   109 
       
   110 // CLASS DECLARATION
       
   111 
       
   112 /**
       
   113  * ConnMonConnInfo class.
       
   114  */
       
   115 class ConnMonConnInfo : public MConnectionMonitorObserver
       
   116     {
       
   117 public:
       
   118     // Constructor and destructor
       
   119 
       
   120     /**
       
   121      * Default constructor
       
   122      */
       
   123     ConnMonConnInfo(ConMonWrapper *wrapper);
       
   124 
       
   125     /**
       
   126      * Destructor
       
   127      */
       
   128     ~ConnMonConnInfo();
       
   129 
       
   130 public:
       
   131     // New functions    
       
   132 
       
   133     /**
       
   134      * Return active connection information.
       
   135      * 
       
   136      * @return Information of active connection, if one exists.
       
   137      */ 
       
   138     WlanQtUtilsActiveConn *activeConnection();
       
   139 
       
   140     /**
       
   141      * Returns information of a connection with the given connection ID.
       
   142      * 
       
   143      * @param[in] connectionId Connection ID.
       
   144      * @return Information of the given connection, if one exists.
       
   145      */ 
       
   146     WlanQtUtilsActiveConn *connectionInfo(uint connectionId);
       
   147 
       
   148     /**
       
   149      * Updates information of a given active connection. Missing information will be filled in
       
   150      * and information that is dynamic in nature will be updated.
       
   151      * 
       
   152      * @param[in] activeConn Current data of an active connection which will be updated.
       
   153      *                       Connection ID and bearer type have to be valid.
       
   154      */
       
   155     void activeConnInfoUpdate( WlanQtUtilsActiveConn *activeConn );
       
   156 
       
   157 private:
       
   158     // New private functions
       
   159 
       
   160     /** 
       
   161      * Starts monitoring observer events
       
   162      */
       
   163     void StartMonitoringL();
       
   164 
       
   165     /** 
       
   166      * Stops monitoring observer events
       
   167      */
       
   168     void StopMonitoring();
       
   169 
       
   170     /**
       
   171      * Event method is called every time an event occures
       
   172      */
       
   173     void EventL(const CConnMonEventBase& aConnMonEvent);
       
   174 
       
   175     /**
       
   176      * Maps Connection Monitor's WLAN connection mode value into
       
   177      * WlanQtUtilsWlanConnMode.
       
   178      *
       
   179      * @param aConnMode Connection mode in Connection Monitor's style.
       
   180      * @return Connection mode in Wlan Qt Utilities style.
       
   181      */
       
   182     static WlanQtUtilsWlanConnMode connMon2WlanQtUtilsConnModeMap(TInt aConnMode);
       
   183 
       
   184     /**
       
   185      * Maps Connection Monitor's connection status value into WlanQtUtilsConnectionStatus.
       
   186      *
       
   187      * @param aConnectionStatus Connection status as used by Connection Monitor server.
       
   188      *                          These status are defined in nifvar.h.
       
   189      * @return Connection status in Wlan Qt Utilities style.
       
   190      */
       
   191     static WlanQtUtilsConnectionStatus connMon2WlanQtUtilsConnectionStatusMap(TInt aConnectionStatus);
       
   192 
       
   193     /**
       
   194      * Maps Connection Monitor's bearer type value into WlanQtUtilsBearerType.
       
   195      *
       
   196      * @param aBearerType Bearer type as used by Connection Monitor server.
       
   197      * @return Bearer type in Wlan Qt Utilities style.
       
   198      */
       
   199     static WlanQtUtilsBearerType connMon2WlanQtUtilsBearerTypeMap(TInt aBearerType);
       
   200 
       
   201 private:
       
   202     // Data
       
   203 
       
   204     /**
       
   205      * q_ptr pointer to ConMonWrapper
       
   206      * Owned by ConMonWrapperPrivate object, instantiated in
       
   207      * constructor.
       
   208      */
       
   209     ConMonWrapper *q_ptr;
       
   210 
       
   211     /** Handle to Connection Monitor Server. */
       
   212     RConnectionMonitor iMonitor;
       
   213 
       
   214     /** Request status. */
       
   215     TRequestStatus iStatus;
       
   216 
       
   217     /** Indicates whether connection monitoring is ON. */
       
   218     TBool iMonitoring;
       
   219     
       
   220 private: // Friend classes
       
   221 
       
   222     // TestWlanQtUtils is defined as a friend class in order to be able to
       
   223     // call event handlers of wrappers.
       
   224     friend class TestWlanQtUtils;
       
   225     };
       
   226 
       
   227 // CLASS DECLARATION
       
   228 
       
   229 /**
       
   230  * ConnMonConnDisconnect class.
       
   231  */
       
   232 class ConnMonConnDisconnect : public CActive
       
   233     {
       
   234 
       
   235 public:
       
   236     // Constructor and destructor
       
   237 
       
   238     /**
       
   239      * Default constructor
       
   240      */
       
   241     ConnMonConnDisconnect(ConMonWrapper *wrapper);
       
   242 
       
   243     /**
       
   244      * Destructor
       
   245      */
       
   246     ~ConnMonConnDisconnect();
       
   247 
       
   248 public:
       
   249     // New functions    
       
   250 
       
   251     /**
       
   252      * disconnectConnection
       
   253      * Stop connection
       
   254      */
       
   255     void disconnectConnection(int iapId);
       
   256 
       
   257 private:
       
   258     // From CActive
       
   259 
       
   260     /**
       
   261      * Implements cancellation of an outstanding request.
       
   262      */
       
   263     void DoCancel();
       
   264 
       
   265     /**
       
   266      * Handles an active object's request completion event.
       
   267      */
       
   268     void RunL();
       
   269 
       
   270 private:
       
   271     // Data
       
   272 
       
   273     /**
       
   274      * q_ptr pointer to ConMonWrapper
       
   275      * Owned by ConMonWrapperPrivate object, instantiated in
       
   276      * constructor.
       
   277      */
       
   278     ConMonWrapper *q_ptr;
       
   279 
       
   280     /**
       
   281      * Handle to Connection Monitor Server
       
   282      */
       
   283     RConnectionMonitor iMonitor;
       
   284     };
       
   285 
       
   286 QT_END_NAMESPACE
       
   287 
       
   288 #endif /* WLANQTUTILSCONMONWRAPPER_S60_P_H_ */
       
   289 
       
   290 // End of file
       
   291