resourcemgmt/vibractrl/inc/vibratimer.h
changeset 0 4e1aa6a622a0
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     1 /*
       
     2 * Copyright (c) 2003 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:  Timer class for supervising vibrating time.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef VIBRATIMER_H
       
    20 #define VIBRATIMER_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32base.h>
       
    24 
       
    25 /**
       
    26 *  An interface for handling timer expiration events.
       
    27 */
       
    28 class MVibraTimerCallback
       
    29     {
       
    30     public:
       
    31         /** 
       
    32         * Called when the timer fires
       
    33         */
       
    34         virtual void TimerFired() = 0;
       
    35     };
       
    36 
       
    37 /**
       
    38 *  Timer class for supervising vibrating time.
       
    39 */
       
    40 NONSHARABLE_CLASS(CVibraTimer) : public CTimer
       
    41     {
       
    42     public:  // Constructors and destructor
       
    43 
       
    44         /**
       
    45         * Two-phased constructor.
       
    46         */
       
    47         static CVibraTimer* NewL(MVibraTimerCallback* aCallback, TInt aMaxVibTime);
       
    48                 
       
    49         /**
       
    50         * Destructor.
       
    51         */
       
    52         ~CVibraTimer();
       
    53         
       
    54         /**
       
    55         * Set the timer
       
    56         * @param aIntervalInMilliSecs timer will expire after this duration.
       
    57         */
       
    58         TInt Set(TInt aIntervalInMilliSecs);
       
    59         
       
    60         // From CTimer
       
    61         void RunL();
       
    62         
       
    63     protected:
       
    64         CVibraTimer(MVibraTimerCallback* aCallback, TInt aMaxVibTime);
       
    65         
       
    66     private: //Data
       
    67         MVibraTimerCallback* iCallback;
       
    68         TInt                 iMaximumVibraTimeMs;//Maximum vibrating time from SharedData or CenRep
       
    69     };
       
    70 
       
    71 #endif// VIBRATIMER_H   
       
    72             
       
    73 // End of File