wlanutilities/wlansniffer/engine/server/inc/wsfwlansettingsaccessor.h
branchRCL_3
changeset 25 f28ada11abbf
parent 0 56b72877c1cb
equal deleted inserted replaced
24:63be7eb3fc78 25:f28ada11abbf
       
     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 CWsfWlanScanner
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_WSFWLANSETTINGSACCESSOR_H
       
    20 #define C_WSFWLANSETTINGSACCESSOR_H
       
    21 
       
    22 //  EXTERNAL INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <commsdattypesv1_1.h>
       
    25 
       
    26 //  INTERNAL INCLUDES
       
    27 #include "wlanmgmtcommon.h"
       
    28 #include "wlanscaninfo.h"
       
    29 
       
    30 
       
    31 //  FORWARD DECLARATIONS
       
    32 class CCDWlanDeviceSettingsRecord;
       
    33 class MWsfWlanScanIntervalChangeObserver;
       
    34 
       
    35 
       
    36 //  CLASS DEFINITION
       
    37 /**
       
    38  * Class to monitor WLAN background scan interval and Show WLAN availability 
       
    39  * flag value
       
    40  *
       
    41  * @since S60 5.0
       
    42  * @lib wsfserver.exe
       
    43  */
       
    44 NONSHARABLE_CLASS( CWsfWlanSettingsAccessor ): public CActive
       
    45     {
       
    46     public:     // Constructors and destructor
       
    47         /**
       
    48         * Factory function.
       
    49         * @since S60 5.0
       
    50         * @param aDbSession Reference to the database session to use
       
    51         * @return Class instance
       
    52         */
       
    53         static CWsfWlanSettingsAccessor* NewL( 
       
    54                                           CommsDat::CMDBSession& aDbSession );
       
    55 
       
    56         /**
       
    57         * Factory function.
       
    58         * @since S60 5.0
       
    59         * @param aDbSession Reference to the database session to use
       
    60         * @return Class instance
       
    61         */
       
    62         static CWsfWlanSettingsAccessor* NewLC( 
       
    63                                           CommsDat::CMDBSession& aDbSession );
       
    64 
       
    65         /**
       
    66         * Destructor.
       
    67         */
       
    68         ~CWsfWlanSettingsAccessor();
       
    69         
       
    70 
       
    71     private:    // Constructors
       
    72         /**
       
    73         * Constructor
       
    74         * @since S60 5.0
       
    75         * @param aDbSession Reference to the database session to use
       
    76         * @return Class instance
       
    77         */
       
    78         CWsfWlanSettingsAccessor( CommsDat::CMDBSession& aDbSession );
       
    79 
       
    80         /**
       
    81         * Second-phase constructor.
       
    82         * @since S60 5.0
       
    83         */
       
    84         void ConstructL();
       
    85 
       
    86 
       
    87     public: // new methods
       
    88         /**
       
    89         * Returns the value of the scan interval
       
    90         * @since S60 5.0
       
    91         * @return The value of the scan interval in seconds
       
    92         */ 
       
    93         TUint ScanInterval() const;
       
    94 
       
    95         /**
       
    96         * Returns the value of the show WLAN availability flag
       
    97         * @since S60 5.0
       
    98         * @return The value of the flag
       
    99         */ 
       
   100         TBool ShowAvailability() const;
       
   101 
       
   102         /**
       
   103         * Requests notification for when the scan interval changes
       
   104         * @since S60 5.0
       
   105         * @param aObserver The observer object to be notified
       
   106         */
       
   107         void RequestNotificationL( 
       
   108                               MWsfWlanScanIntervalChangeObserver& aObserver );
       
   109             
       
   110         /**
       
   111         * Cancels the change notifications
       
   112         * @since S60 5.0
       
   113         */
       
   114         void CancelNotifications();
       
   115 
       
   116 
       
   117     private:    // New methods
       
   118         /**
       
   119         * Does the actual setting check
       
   120         * @since S60 5.0
       
   121         * @param aBgScanInterval Variable to store the latest background scan 
       
   122         *                        interval value
       
   123         * @param aShowAvailability Variable to store the latest Show WLAN 
       
   124         *                        availability flag value
       
   125         */
       
   126         void DoCheckSettingL( TUint& aBgScanInterval, 
       
   127                               TBool& aShowAvailability);
       
   128 
       
   129         /**
       
   130         * Checks if the current bgscaninterval/availability flag is different 
       
   131         * from the previously retrieved value
       
   132         * @since S60 5.0
       
   133         * @return ETrue if the settings has been changed
       
   134         */
       
   135         TBool CheckIfSettingChangedL();
       
   136 
       
   137         /**
       
   138         * Reissues the request for database notification
       
   139         * @since S60 5.0
       
   140         */
       
   141         void IssueNotificationRequestL();
       
   142 
       
   143 
       
   144     private:  // from CActive
       
   145         /**
       
   146         * Implements cancellation of an outstanding request.
       
   147         * @since S60 5.0
       
   148         */
       
   149         void DoCancel();
       
   150 
       
   151         /**
       
   152         * Handles an active object's request completion event.
       
   153         * @since S60 5.0
       
   154         */
       
   155         void RunL();
       
   156 
       
   157         /**
       
   158         * Handles a leave occurring in RunL().
       
   159         * @since S60 5.0
       
   160         * @param aError Leave code
       
   161         * @return aError
       
   162         */
       
   163         TInt RunError( TInt aError );
       
   164         
       
   165     
       
   166     private:    // Data
       
   167         /**
       
   168         * Handle to the database session (not owned)
       
   169         */
       
   170         CommsDat::CMDBSession* iDbSession;
       
   171         
       
   172         /**
       
   173         * Reference to the observer object (not owned)
       
   174         */
       
   175         MWsfWlanScanIntervalChangeObserver* iChangeObserver;
       
   176         
       
   177         /**
       
   178         * Instance of the WLAN settings record (owned)
       
   179         */
       
   180         CCDWlanDeviceSettingsRecord* iWlanSettingsRecord;
       
   181         
       
   182         /**
       
   183         * The last retrieved bgscaninterval value (in seconds)
       
   184         */
       
   185         TUint iScanInterval;
       
   186         
       
   187         /**
       
   188         * Table ID for the WLAN settings table
       
   189         */
       
   190         CommsDat::TMDBElementId iTableId;
       
   191         
       
   192         /**
       
   193         * Hold-up timer to avoid notification bursts
       
   194         */
       
   195         RTimer iTimer;
       
   196         
       
   197         /**
       
   198         * Indicates whether the processing has been activated but got held up
       
   199         */
       
   200         TBool iBeingHeldUp;
       
   201         
       
   202         /**
       
   203         * Indicates whether show wlan availability flag is on
       
   204         */
       
   205         TBool iShowAvailability;
       
   206     };
       
   207 
       
   208 #endif // C_WSFWLANSETTINGSACCESSOR_H
       
   209