commsconfig/cscengine/inc/cscengtimer.h
changeset 0 a4daefaec16c
child 6 fc8c25e5a2e8
equal deleted inserted replaced
-1:000000000000 0:a4daefaec16c
       
     1 /*
       
     2 * Copyright (c) 2007-2007 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 for timer handling.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef C_CSCENGTIMER_H
       
    21 #define C_CSCENGTIMER_H
       
    22 
       
    23 #include <e32base.h> 
       
    24 
       
    25 class MCSCEngTimerObserver;
       
    26 
       
    27 /**
       
    28  * An instance of CCSCEngTimer
       
    29  * For timer handling.
       
    30  *
       
    31  * @lib cscengine.lib
       
    32  * @since Series 60 3.2
       
    33  */
       
    34 NONSHARABLE_CLASS( CCSCEngTimer ) : public CTimer
       
    35     {    
       
    36     public:
       
    37 
       
    38         /**
       
    39          * Enumeration which indicates timer type
       
    40          */
       
    41         enum TTimerType
       
    42             {
       
    43             EConnectionMonitoringTimer = 0
       
    44             };
       
    45     
       
    46         /**
       
    47          * Two-phased constructor.
       
    48          */ 
       
    49         IMPORT_C static CCSCEngTimer* NewL( 
       
    50             MCSCEngTimerObserver& aObserver );
       
    51 
       
    52 
       
    53         /**
       
    54          * Destructor.
       
    55          */
       
    56         IMPORT_C virtual ~CCSCEngTimer();
       
    57 
       
    58         
       
    59         /**
       
    60          * Start timer.
       
    61          *
       
    62          * @since S60 v3.2
       
    63          * @return KErrNone when timer started successfully
       
    64          */
       
    65         IMPORT_C TInt StartTimer( TTimerType aType );
       
    66         
       
    67         
       
    68         /**
       
    69          * Stop timer.
       
    70          *
       
    71          * @since S60 v3.2
       
    72          */
       
    73         IMPORT_C void StopTimer();
       
    74         
       
    75 
       
    76     protected: 
       
    77     
       
    78         // from base class CTimer
       
    79         
       
    80         /**
       
    81          * From CTimer. Called when timer expires.
       
    82          */
       
    83         void RunL();
       
    84         
       
    85                
       
    86     private:
       
    87 
       
    88         CCSCEngTimer( MCSCEngTimerObserver& aObserver );
       
    89 
       
    90         void ConstructL();
       
    91         
       
    92         
       
    93     private:  // data
       
    94         
       
    95         /**
       
    96          * Reference for observer.
       
    97          */
       
    98         MCSCEngTimerObserver& iObserver;
       
    99         
       
   100 #ifdef _DEBUG
       
   101     friend class UT_CSCEngTimer;
       
   102 #endif 
       
   103     };
       
   104 
       
   105 #endif // C_CSCENGTIMER_H