homesync/contentmanager/cmserver/cmscheduler/inc/cmcommsdbnotifier.h
branchIOP_Improvements
changeset 40 08b5eae9f9ff
parent 39 6369bfd1b60d
child 41 b4d83ea1d6e2
equal deleted inserted replaced
39:6369bfd1b60d 40:08b5eae9f9ff
     1 /*
       
     2 * Copyright (c) 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:  Comms database notifier class definition
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef _CCMCOMMSDBNOTIFIER_H
       
    20 #define _CCMCOMMSDBNOTIFIER_H
       
    21 
       
    22 //  Include Files
       
    23 #include <d32dbms.h>
       
    24 
       
    25 // FORWARD DECLARATIONS
       
    26 class CCommsDatabase;
       
    27 class CCmScheduler;
       
    28 
       
    29 // CLASS DECLARATION
       
    30 
       
    31 /**
       
    32  *  Comms database notifier class for scheduler
       
    33  *  @lib cmscheduler.lib
       
    34  *  @since S60 5.1
       
    35  */
       
    36 class CCmCommsDbNotifier : public CActive
       
    37     {
       
    38     public: // Constructors and destructor
       
    39 
       
    40         /**
       
    41          * Two-phased constructor.
       
    42          */
       
    43         static CCmCommsDbNotifier* NewL( CCmScheduler& aSheduler );
       
    44 
       
    45         /**
       
    46          * Destructor.
       
    47          */
       
    48         virtual ~CCmCommsDbNotifier();
       
    49 
       
    50         /**
       
    51          * Checks wlan scan state
       
    52          *
       
    53          * @since S60 5.1
       
    54          * @return TBool, ETrue if value changed, EFalse otherwise
       
    55          */
       
    56         TBool HasScanStateChangedL();
       
    57 
       
    58         /**
       
    59          * Gets wlan scan interval setting value
       
    60          *
       
    61          * @since S60 5.1
       
    62          * @return TUint32, scan interval
       
    63          */
       
    64         TUint32 WlanScanStateL();
       
    65 
       
    66     protected: // From CActive
       
    67 	
       
    68         /**
       
    69          * Called when request completes
       
    70          *
       
    71          * @since S60 5.1
       
    72          */
       
    73         void RunL();
       
    74 		
       
    75         /**
       
    76          * Called when request is cancelled
       
    77          *
       
    78          * @since S60 5.1
       
    79          */
       
    80         void DoCancel();
       
    81 		
       
    82         /**
       
    83          * Called when RunL leaves
       
    84          *
       
    85          * @since S60 5.1
       
    86          */
       
    87         TInt RunError(TInt aError);
       
    88 
       
    89     private: // Constructors
       
    90 
       
    91         /**
       
    92          * Default constructor.
       
    93          */
       
    94         CCmCommsDbNotifier( CCmScheduler& aSheduler );
       
    95 		
       
    96         /**
       
    97          * Two-phased constructor.
       
    98          */
       
    99         void ConstructL();
       
   100 
       
   101         /**
       
   102          * Initiates asyncronous notification request to database
       
   103          *
       
   104          * @since S60 5.1
       
   105          */
       
   106         void RequestNotification();
       
   107 
       
   108     private:
       
   109 
       
   110         /**
       
   111          * Database to be monitored
       
   112          */
       
   113         CCommsDatabase*                 iDb;    // owned
       
   114 		
       
   115         /**
       
   116          * Change observer
       
   117          */
       
   118         CCmScheduler*                   iScheduler;  // not owned
       
   119 		
       
   120         /**
       
   121          * Previous scan state
       
   122          */
       
   123         TUint32                         iScanState;
       
   124     };
       
   125 
       
   126 #endif //  _CCMCOMMSDBNOTIFIER_H