tsrc/consoleplayer/common/timercallback.h
changeset 35 b0f0be18af85
equal deleted inserted replaced
32:106971a9964d 35:b0f0be18af85
       
     1 /*
       
     2  * Copyright (c) 2010 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:
       
    15  * Header specifying the timer handling.
       
    16  * 
       
    17  */
       
    18 
       
    19 #ifndef __TIMER_CALLBACK_H__
       
    20 #define __TIMER_CALLBACK_H__
       
    21 
       
    22 #include <e32base.h>
       
    23 
       
    24 class ITimerCallbackClient
       
    25     {
       
    26 public:
       
    27     
       
    28     virtual void TimerCallback() = 0;
       
    29     
       
    30     };
       
    31 
       
    32 class CTimerCallback : public CActive
       
    33     {
       
    34 public:
       
    35     
       
    36     CTimerCallback( ITimerCallbackClient& aClient ); 
       
    37     
       
    38     ~CTimerCallback();
       
    39     
       
    40     void Start( TTimeIntervalMicroSeconds32 aInterval );
       
    41     
       
    42     // inherited from CActive
       
    43     void RunL();
       
    44     void DoCancel();
       
    45     
       
    46 private:
       
    47         
       
    48     RTimer                      iTimer;
       
    49     ITimerCallbackClient&       iClient;
       
    50     TTimeIntervalMicroSeconds32 iInterval;
       
    51     
       
    52     };
       
    53 
       
    54 #endif