wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/inc/wlanssidlist.h
changeset 0 c40eb8fe8501
equal deleted inserted replaced
-1:000000000000 0:c40eb8fe8501
       
     1 /*
       
     2 * Copyright (c) 2007-2008 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 the License "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:  Class implementing storage for an SSID list.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef WLANSSIDLIST_H
       
    20 #define WLANSSIDLIST_H
       
    21 
       
    22 #include <e32std.h>
       
    23 #include <e32base.h>
       
    24 #include <s32strm.h>
       
    25 #include <wlanmgmtcommon.h>
       
    26 
       
    27 /**
       
    28  * This class implements storage for an SSID list.
       
    29  *
       
    30  * @since S60 v5.1
       
    31  */
       
    32 NONSHARABLE_CLASS( CWlanSsidList ) : public CBase
       
    33     {
       
    34 
       
    35 public:
       
    36 
       
    37     /**
       
    38      * Two-phased constructor.
       
    39      * 
       
    40      * @param aGranularity Granularity to use when allocating memory.
       
    41      */
       
    42     static CWlanSsidList* NewL(
       
    43         TUint aGranularity );
       
    44 
       
    45     /**
       
    46      * Destructor.
       
    47      */
       
    48     virtual ~CWlanSsidList();
       
    49 
       
    50     /**
       
    51      * Add an SSID to the list.
       
    52      * 
       
    53      * @since S60 v5.1
       
    54      * @param aSsid SSID to add.
       
    55      * @return KErrNone on success, an error code otherwise.
       
    56      */
       
    57     TInt AddSsid(
       
    58         const TWlanSsid& aSsid );
       
    59 
       
    60     /**
       
    61      * Check whether the given SSID is in the list.
       
    62      *
       
    63      * @since S60 v5.1
       
    64      * @param aSsid SSID to search for.
       
    65      * @return ETrue if SSID in the list, EFalse otherwise.
       
    66      */
       
    67     TBool IsInList(
       
    68         const TWlanSsid& aSsid ) const;    
       
    69 
       
    70     /**
       
    71      * Return the amount SSIDs in the list.
       
    72      * 
       
    73      * @return The amount SSIDs in the list.
       
    74      */
       
    75     TUint Count() const;
       
    76 
       
    77     /**
       
    78      * Write the contents of the SSID list to the given stream.
       
    79      *
       
    80      * @since S60 v5.1
       
    81      * @param aStream Stream to write to.
       
    82      */
       
    83     void ExternalizeL(
       
    84         RWriteStream& aStream ) const;
       
    85 
       
    86     /**
       
    87      * Read the contents of the SSID list from the given stream.
       
    88      * 
       
    89      * @since S60 v5.1
       
    90      * @param aStream Stream to read from.
       
    91      */
       
    92     void InternalizeL(
       
    93         RReadStream& aStream );    
       
    94 
       
    95 private:
       
    96 
       
    97     /**
       
    98      * Constructor.
       
    99      *
       
   100      * @param aGranularity Granularity to use when allocating memory.
       
   101      */
       
   102     CWlanSsidList(
       
   103         TUint aGranularity );
       
   104 
       
   105     /**
       
   106      * 2nd state constructor.
       
   107      */
       
   108     void ConstructL();
       
   109 
       
   110     /**
       
   111      * Determine the linear order of the two SSIDs.
       
   112      * 
       
   113      * @param aLeft First SSID to compare.
       
   114      * @param aRight Second SSID to compare.
       
   115      * @return Zero if SSIDs are equal, negative if the first one is less,
       
   116      *         posive if the first one is greater.
       
   117      */
       
   118     static TInt LinearOrder(
       
   119         const TWlanSsid& aLeft,
       
   120         const TWlanSsid& aRight );
       
   121 
       
   122 private: // data
       
   123 
       
   124     /**
       
   125      * List of SSIDs.
       
   126      */
       
   127     RArray<TWlanSsid> iSsidList;
       
   128 
       
   129     /**
       
   130      * Function used to determine the order of two SSIDs.
       
   131      */
       
   132     TLinearOrder<TWlanSsid> iLinearOrder; 
       
   133 
       
   134     };
       
   135 
       
   136 #endif // WLANSSIDLIST_H