testexecfw/useremul/inc/DelayTimer.h
changeset 0 3e07fef1e154
equal deleted inserted replaced
-1:000000000000 0:3e07fef1e154
       
     1 /*------------------------------------------------------------------
       
     2  -
       
     3  * Software Name : UserEmulator
       
     4  * Version       : v4.2.1309
       
     5  * 
       
     6  * Copyright (c) 2009 France Telecom. All rights reserved.
       
     7  * This software is distributed under the License 
       
     8  * "Eclipse Public License - v 1.0" the text of which is available
       
     9  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
    10  *
       
    11  * Initial Contributors:
       
    12  * France Telecom 
       
    13  *
       
    14  * Contributors:
       
    15  *------------------------------------------------------------------
       
    16  -
       
    17  * File Name: DelayTimer.h
       
    18  * 
       
    19  * Created: 13/08/2009
       
    20  * Author(s): Marcell Kiss, Reshma Sandeep Das
       
    21  *   
       
    22  * Description:
       
    23  * Active object implementation for asynchronous key events handling
       
    24  *------------------------------------------------------------------
       
    25  -
       
    26  *
       
    27  */
       
    28 #ifndef DELAYTIMER_H__
       
    29 #define DELAYTIMER_H__
       
    30 
       
    31 //System includes
       
    32 #include <e32base.h>
       
    33 
       
    34 /**
       
    35  * MActionObserver, an observer to CDelayTimer class.
       
    36  */
       
    37 class MActionObserver 
       
    38 {
       
    39 public:
       
    40 	/**
       
    41 	 * Callback function to invoke the next action element
       
    42 	 */
       
    43     virtual void PerformActionL() = 0;
       
    44 };
       
    45 
       
    46 /**
       
    47  *  CDelayTimer class.
       
    48  */
       
    49 class CDelayTimer : public CTimer
       
    50 {
       
    51     public:
       
    52        /**
       
    53         * Two-phased constructor.
       
    54         * @param aObserver Reference to the observer class
       
    55         */
       
    56         static CDelayTimer* NewL( MActionObserver& aObserver );        
       
    57        /**
       
    58         * C++ default constructor.
       
    59         */
       
    60         CDelayTimer(MActionObserver& aObserver);
       
    61        /**
       
    62         * Destructor
       
    63         */
       
    64         ~CDelayTimer();
       
    65 
       
    66     public:
       
    67        /**
       
    68 		* Function to issue a request for notification of next action 
       
    69 		* @param aInterval Time interval
       
    70 		*/
       
    71         void Wait(TInt aInterval);
       
    72         
       
    73     private:
       
    74        /**
       
    75         * 2nd phase constructor.
       
    76         */
       
    77         void ConstructL();
       
    78 
       
    79     private: // From CActive
       
    80        /**
       
    81         * After completed timer period, execution comes to RunL
       
    82         */
       
    83         void RunL();
       
    84 
       
    85     private:
       
    86     	/**
       
    87     	 * Reference to the observer class
       
    88     	 */
       
    89         MActionObserver& iActionObserver;
       
    90 };
       
    91 
       
    92 #endif // DELAYTIMER_H__
       
    93 
       
    94 // End of File
       
    95