wlanutilities/wlansniffer/wlaninfosorting/inc/wsfwlaninfoarrayvisitor.h
branchRCL_3
changeset 24 63be7eb3fc78
parent 23 b852595f5cbe
child 25 f28ada11abbf
equal deleted inserted replaced
23:b852595f5cbe 24:63be7eb3fc78
     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 "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 header for CWsfWlanInfoArrayVisitor
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef C_WSFWLANINFOARRAYVISITOR_H
       
    21 #define C_WSFWLANINFOARRAYVISITOR_H
       
    22 
       
    23 
       
    24 //  EXTERNAL INCLUDES
       
    25 #include <e32base.h>
       
    26 #include <d32dbms.h>
       
    27 
       
    28 //  INTERNAL INCLUDES
       
    29 #include "wsfwlaninfoarrayfiltervisitor.h"
       
    30 #include "wsfwlaninfo.h"
       
    31 
       
    32 
       
    33 //  FORWARD DECLARATIONS
       
    34 class CWsfWlanInfoSortingDefault;
       
    35 class CWsfWlanInfoSortingBrand;
       
    36 class CWsfWlanInfoSortingBlackList;
       
    37 class CEikonEnv;
       
    38 class CAknIconArray;
       
    39 class CWsfWlanInfoSortingDbChangeNotifier;
       
    40 
       
    41 /**
       
    42 * This class is the main entry point for wlan list sorting services
       
    43 *
       
    44 * @lib wsfwlaninfosorting.lib
       
    45 * @since S60 5.0
       
    46 */
       
    47 NONSHARABLE_CLASS( CWsfWlanInfoArrayVisitor ): public CBase, 
       
    48                                         public TKeyArrayFix, 
       
    49                                         public MWsfWlanInfoArrayFilterVisitor 
       
    50     {
       
    51     public:     // construction
       
    52         /**
       
    53         * Factory function.
       
    54         * @since S60 5.0
       
    55         * @param aReadOnly If EFalse, database-dependent filters 
       
    56         *                  won't get updated
       
    57         * @return Class instance
       
    58         */
       
    59         IMPORT_C static CWsfWlanInfoArrayVisitor* NewLC( 
       
    60                                                        const TBool aReadOnly );
       
    61 
       
    62         /**
       
    63         * Factory function.
       
    64         * @since S60 5.0
       
    65         * @param aReadOnly If EFalse, database-dependent filters 
       
    66         *                  won't get updated
       
    67         * @return Class instance
       
    68         */
       
    69         IMPORT_C static CWsfWlanInfoArrayVisitor* NewL( 
       
    70                                                       const TBool aReadOnly );
       
    71         
       
    72         IMPORT_C ~CWsfWlanInfoArrayVisitor();
       
    73         
       
    74     private:
       
    75         /**
       
    76         * Constructor.
       
    77         * @since S60 5.0
       
    78         * @param aReadOnly If EFalse, database-dependent filters
       
    79         *                  won't get updated
       
    80         */
       
    81         CWsfWlanInfoArrayVisitor( const TBool aReadOnly );
       
    82         
       
    83         void ConstructL();    
       
    84 
       
    85         
       
    86     public:     // new methods
       
    87         /**
       
    88         * Carries out operations before starting the actual sorting
       
    89         * @since S60 5.0
       
    90         * @param aArrayToBeFiltered The array we are working on.
       
    91         */
       
    92         IMPORT_C void FilterPreSortL( CWsfWlanInfoArray* aArrayToBeFiltered );
       
    93         
       
    94         /**
       
    95         * Carries out operations after having sorted the array
       
    96         * @since S60 5.0
       
    97         * @param aArrayToBeFiltered The array we are working on.
       
    98         */
       
    99         IMPORT_C void FilterPostSortL( CWsfWlanInfoArray* aArrayToBeFiltered );
       
   100         
       
   101         /**        
       
   102         * Return the sorting key handle
       
   103         * @since S60 5.0
       
   104         * @return Reference to the sorting key
       
   105         */        
       
   106         IMPORT_C TKeyArrayFix& SortingKey();        
       
   107 
       
   108 
       
   109     public:     // from TKeyArrayFix
       
   110         /**
       
   111         * Compares elements of the given indices according to the 
       
   112         * sorting criteria.
       
   113         * @since S60 5.0
       
   114         * @param aLeft Index of left element
       
   115         * @param aRight Index of right element
       
   116         * @return Negative if the left element is less than the right, 
       
   117         *         positive if the right element is less than the left, 
       
   118         *         zero if the two elements are equal.         
       
   119         */
       
   120         TInt Compare( TInt aLeft, TInt aRight ) const;
       
   121 
       
   122 
       
   123     public:     // new methods
       
   124     
       
   125         /**
       
   126         * Load definition of each filter
       
   127         * @since S60 5.0
       
   128         */        
       
   129         IMPORT_C void LoadFilterDefinitionsL();
       
   130     
       
   131         /**
       
   132         * Add the icons of the given array to the branding icon list
       
   133         * @since S60 5.0
       
   134         * @param aIconArray The icons to be appended
       
   135         */        
       
   136         IMPORT_C void AppendBrandingIconsL( CAknIconArray& aIconArray );
       
   137 
       
   138         /**
       
   139         * Launches the UI to modify the SSID blacklist (filter out networks)
       
   140         * @since S60 5.0
       
   141         * @param aInfoItemArray The current wlaninfo array
       
   142         */        
       
   143         IMPORT_C void EditBlackListL( CWsfWlanInfoArray& aInfoItemArray );
       
   144         
       
   145         /**
       
   146         * Returns the number of blacklisted SSIDs
       
   147         * @since S60 5.0
       
   148         * @return The count of filtered SSIDs 
       
   149         */        
       
   150         IMPORT_C TInt BlackListItemCount() const;
       
   151         
       
   152 
       
   153     private:    // new methods
       
   154     
       
   155         /**
       
   156         * Opens the shared filter database
       
   157         * @since S60 5.0
       
   158         */        
       
   159         void OpenDataBaseL();
       
   160 
       
   161 
       
   162     private: //data    
       
   163         
       
   164         /**
       
   165         * The wlaninfo array we are currently working on. Not owned.
       
   166         */
       
   167         CWsfWlanInfoArray* iInfoArray;
       
   168     
       
   169         /**
       
   170         * Default sorting filter. Owned.
       
   171         */
       
   172         CWsfWlanInfoSortingDefault* iDefaultSorting;
       
   173 
       
   174         /**
       
   175         * Branded item sorting filter. Owned.
       
   176         */
       
   177         CWsfWlanInfoSortingBrand* iBrandSorting;
       
   178 
       
   179         /**
       
   180         * Blacklisted item sorting filter. Owned.
       
   181         */
       
   182         CWsfWlanInfoSortingBlackList* iBlackListSorting;
       
   183 
       
   184         /**
       
   185         * Notifier of database changes. Owned.
       
   186         */
       
   187         CWsfWlanInfoSortingDbChangeNotifier* iDbChangeNotifier;
       
   188 
       
   189         /**
       
   190         * Reference to the UI environment
       
   191         */
       
   192         CEikonEnv& iCoeEnv;
       
   193     
       
   194         /**
       
   195         * Resource file offset
       
   196         */
       
   197         TInt iResourceFileOffset;
       
   198     
       
   199         /**
       
   200         * Handle to the filter database
       
   201         */
       
   202         RDbNamedDatabase iFilterDb;
       
   203 
       
   204         /**
       
   205         * Handle to the DBMS
       
   206         */
       
   207         RDbs iDbms;
       
   208 
       
   209         /**
       
   210         * Handle to the FS
       
   211         */
       
   212         RFs iFileServer;
       
   213 
       
   214         /**
       
   215         * If EFalse, database-dependent filters won't get updated
       
   216         */
       
   217         TBool iReadOnly;
       
   218     
       
   219     };
       
   220     
       
   221 
       
   222 
       
   223 
       
   224 #endif // C_WSFWLANINFOARRAYVISITOR_H
       
   225