wlanutilities/wlanqtutilities/base/inc/wlanqtutilsap.h
branchRCL_3
changeset 25 f28ada11abbf
parent 24 63be7eb3fc78
equal deleted inserted replaced
24:63be7eb3fc78 25:f28ada11abbf
     1 /*
       
     2 * Copyright (c) 2009-2010 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 * WLAN AP (Access Point, unknown network) class.
       
    16 */
       
    17 
       
    18 #ifndef WLANQTUTILSAP_H
       
    19 #define WLANQTUTILSAP_H
       
    20 
       
    21 // System includes
       
    22 
       
    23 #include <QObject>
       
    24 #include <QMetaType>
       
    25 #include <QVariant>
       
    26 #include <QScopedPointer>
       
    27 
       
    28 // User includes
       
    29 
       
    30 // Forward declarations
       
    31 
       
    32 class WlanQtUtilsApPrivate;
       
    33 
       
    34 // External data types
       
    35 
       
    36 // Constants
       
    37 
       
    38 //! Library interface export macro
       
    39 #ifdef BUILD_WLANQTUTILITIES_DLL
       
    40 #define WLANQTUTILSAP_EXPORT Q_DECL_EXPORT
       
    41 #else
       
    42 #define WLANQTUTILSAP_EXPORT Q_DECL_IMPORT
       
    43 #endif
       
    44 
       
    45 // Class declaration
       
    46 
       
    47 class WLANQTUTILSAP_EXPORT WlanQtUtilsAp
       
    48 {
       
    49     
       
    50 public:
       
    51     
       
    52     // Data types
       
    53     
       
    54     /*!
       
    55         Configuration IDs that can be read and set in this class.
       
    56 
       
    57         ConfID's available for scan results:
       
    58         - ConfIdSsid
       
    59         - ConfIdBssid
       
    60         - ConfIdSignalStrength
       
    61         - ConfIdConnectionMode
       
    62         - ConfIdSecurityMode
       
    63         - ConfIdWpaPskUse
       
    64         - ConfIdWpsSupported
       
    65 
       
    66         ConfID's for IAP creation and updates, these are
       
    67         mandatory for all security modes: 
       
    68         - ConfIdSsid
       
    69         - ConfIdConnectionMode
       
    70         - ConfIdSecurityMode
       
    71         - ConfIdWepKey1     (Empty if not used) 
       
    72         - ConfIdWepKey2     (Empty if not used)
       
    73         - ConfIdWepKey3     (Empty if not used)
       
    74         - ConfIdWepKey4     (Empty if not used)
       
    75         - ConfIdWepDefaultIndex
       
    76         - ConfIdWpaPskUse
       
    77         - ConfIdWpaPsk      (Empty if not used)
       
    78         - ConfIdHidden
       
    79         - ConfIdWlanScanSSID
       
    80     */
       
    81     enum ConfId {
       
    82         //! QString: WLAN Network Name (SSID)
       
    83         ConfIdSsid = 0,
       
    84         //! QByteArray: Basic Service Set Identifier
       
    85         ConfIdBssid = 1,
       
    86         //! int: signal strength in RSSI (dBm)
       
    87         ConfIdSignalStrength = 2,
       
    88         //! int: (CMManagerShim::WlanNetMode)
       
    89         ConfIdConnectionMode = 3,
       
    90         //! int: (CMManagerShim::WlanSecMode)
       
    91         ConfIdSecurityMode = 4,
       
    92         //! bool: true - WPA PSK, false - WPA EAP
       
    93         ConfIdWpaPskUse = 5,
       
    94         //! QString: Pre-Shared Key for WPA
       
    95         //! Length: 8-63 - Ascii key
       
    96         //! Length: 64 - Hex key
       
    97         ConfIdWpaPsk = 6,
       
    98         //! QString: WEP Key for index 1:
       
    99         //! HEX: 
       
   100         //! - 64 bit: allowed key length = 10
       
   101         //! - 128 bit: allowed key length = 26
       
   102         //! 
       
   103         //! ASCII:
       
   104         //! - 64 bit: allowed key length = 5   
       
   105         //! - 128 bit: allowed key length = 13
       
   106         ConfIdWepKey1 = 7,
       
   107         //! QString: WEP Key for index 2
       
   108         ConfIdWepKey2 = 8,
       
   109         //! QString: WEP Key for index 3
       
   110         ConfIdWepKey3 = 9,
       
   111         //! QString: WEP Key for index 4
       
   112         ConfIdWepKey4 = 10,
       
   113         //! int: (CMManagerShim::WlanWepKeyIndex): Default WEP Key index
       
   114         ConfIdWepDefaultIndex = 11,
       
   115         //! bool: Is WLAN hidden (CMManagerShim::CmHidden).
       
   116         ConfIdHidden = 12,
       
   117         //! bool: Does WLAN AP need explicit scanning (CMManagerShim::WlanScanSSID)
       
   118         ConfIdWlanScanSSID = 13,
       
   119         //! bool: true - Wifi Protected setup is supported, false - not
       
   120         ConfIdWpsSupported = 14
       
   121     };
       
   122 
       
   123     /*!
       
   124         Function pointer type for string comparison operation customization.
       
   125         Used for AP comparison in \a compare.
       
   126         
       
   127         @param [in] string1 String #1 to compare.
       
   128         @param [in] string2 String #2 to compare.
       
   129 
       
   130         @return Zero (0), if strings are considered to be same,
       
   131                 Positive (>0) if string1 is considered to be "greater than" string2. 
       
   132                 Negative (<0) if string1 is considered to be "less than" string2. 
       
   133     */
       
   134     typedef int (*StringComparator)( 
       
   135         const QString &string1,
       
   136         const QString &string2);
       
   137     
       
   138     WlanQtUtilsAp();
       
   139 
       
   140     WlanQtUtilsAp(const WlanQtUtilsAp &ref);
       
   141     
       
   142     virtual ~WlanQtUtilsAp();
       
   143     
       
   144     QVariant value(int identifier) const;
       
   145     
       
   146     void setValue(int identifier, QVariant value);
       
   147     
       
   148     static int compare(
       
   149         const WlanQtUtilsAp *ap1,
       
   150         const WlanQtUtilsAp *ap2,
       
   151         StringComparator comparator = 0);
       
   152     
       
   153 signals:
       
   154 
       
   155 public slots:
       
   156 
       
   157 protected:
       
   158 
       
   159 protected slots:
       
   160 
       
   161 private:
       
   162 
       
   163     // Disabling implicit assignment operator
       
   164     WlanQtUtilsAp &operator=(const WlanQtUtilsAp &);
       
   165     
       
   166 private slots:
       
   167 
       
   168 private: // data
       
   169 
       
   170     QScopedPointer<WlanQtUtilsApPrivate> d_ptr; //!< Private implementation
       
   171 
       
   172     // Friend classes
       
   173 };
       
   174 
       
   175 // Metatype support is needed since we use this class with QVariant
       
   176 Q_DECLARE_METATYPE(WlanQtUtilsAp)
       
   177 
       
   178 #endif // WLANQTUTILSAP_H