testexecfw/useremul/engine/WSServer/inc/CaptureKeyTimer.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: CaptureKeyTimer.h
       
    18  * 
       
    19  * Created: 13/08/2009
       
    20  * Author(s): Marcell Kiss
       
    21  *   
       
    22  * Description:
       
    23  * Key Timer class
       
    24  *------------------------------------------------------------------
       
    25  -
       
    26  *
       
    27  */
       
    28 #ifndef CAPTUREKEYTIMER_H_
       
    29 #define CAPTUREKEYTIMER_H_
       
    30 
       
    31 // System Includes
       
    32 #include <E32BASE.H>
       
    33  
       
    34 // Class Declaration
       
    35 
       
    36 /**
       
    37  * Key timer interface
       
    38  */ 
       
    39 class MCaptureKeyTimerNotify
       
    40 	{
       
    41 	public:
       
    42 	    /**
       
    43         * Callback function. Called when timer is expired
       
    44         */
       
    45 		virtual void KeyTimerExpired() = 0;
       
    46 		};
       
    47 
       
    48 /**
       
    49  * Timer active object
       
    50  */
       
    51 class CCaptureKeyTimer: public CActive
       
    52 		{
       
    53 	public:
       
    54 	    /**
       
    55         * Static constructor
       
    56         * @param aNotify A reference to the key timer observer.
       
    57         * @return CCaptureKeyTimer* A pointer to the newly allocated CCaptureKeyTimer class.
       
    58         *                      NULL, if the class cannot be created
       
    59         */
       
    60 		static CCaptureKeyTimer* NewL(MCaptureKeyTimerNotify& aNotify);
       
    61 		/**
       
    62         * Destructor
       
    63         */
       
    64 		~CCaptureKeyTimer();
       
    65 	public:
       
    66 	    /**
       
    67         * Start timer
       
    68         * @param aInterval  Microsecs after timer supposed to be expired
       
    69         */
       
    70 		void After(TTimeIntervalMicroSeconds32 aInterval);
       
    71 	protected:
       
    72 	    /**
       
    73         * RunL from CActive class
       
    74         */
       
    75 		void RunL();
       
    76 		/**
       
    77         * DoCancel from CActive class
       
    78         */
       
    79 		void DoCancel();
       
    80 	private:
       
    81 	    /**
       
    82         * Constructor
       
    83         * @param aNotify  A reference to the key timer observer.
       
    84         */
       
    85 		CCaptureKeyTimer(MCaptureKeyTimerNotify& aNotify);
       
    86 		/**
       
    87         * Second phase constructor
       
    88         */
       
    89 		void ConstructL();
       
    90 	private:
       
    91 	    /**
       
    92         * RTimer object member
       
    93         */
       
    94 		RTimer					iTimer;
       
    95 		/**
       
    96         * Reference to key timer observer
       
    97         */
       
    98 		MCaptureKeyTimerNotify&	iNotify;
       
    99 		};
       
   100 
       
   101 #endif // CAPTUREKEYTIMER_H_