sensorservices/tiltcompensationssy/inc/tcsendeventtimer.h
changeset 0 4e1aa6a622a0
child 41 c87e5f80c17d
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     1 /*
       
     2 * Copyright (c) 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:  CTCChannel class declaration.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef TCSENDEVENTTIMER_H
       
    21 #define TCSENDEVENTTIMER_H
       
    22 
       
    23 // INCLUDES
       
    24 #include <e32base.h>
       
    25 #include "tcsendeventtimer.h"
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class MSendDataCallBack;
       
    29 
       
    30 // CLASS DECLARATION
       
    31 
       
    32 /**
       
    33 *  This class implements a timer object that is used to create a sequence for
       
    34 *  the tilt channel data send.
       
    35 *
       
    36 *  @lib None.
       
    37 *  @since S60 5.0
       
    38 */
       
    39 NONSHARABLE_CLASS( CTCSendEventTimer ): public CActive
       
    40     {
       
    41     public:
       
    42     
       
    43         // Default C++ destructor
       
    44         ~CTCSendEventTimer();
       
    45     
       
    46     public: // New methods
       
    47     
       
    48         // Default C++ constructor
       
    49         CTCSendEventTimer( MSendDataCallBack& aPrtToCallback );
       
    50         
       
    51         /**
       
    52         * Creates a pointer to the timer
       
    53         *
       
    54         * @param aSetTimerToHzLevel the herz level the timer is set to
       
    55         * @param aPrtToCallback callback function of the caller
       
    56         * @return CTCSendEventTimer
       
    57         */
       
    58         static CTCSendEventTimer* NewL( TInt aSetTimerToHzLevel,
       
    59                                         MSendDataCallBack& aPrtToCallback );
       
    60         
       
    61     protected: // Methods from base classes
       
    62         
       
    63         // Constructor
       
    64         void ConstructL( TInt aSetTimerToHzLevel );
       
    65         
       
    66         // @see CActive
       
    67     	void RunL();
       
    68     	
       
    69     	// @see CActive
       
    70         void DoCancel();
       
    71         
       
    72         // @see CActive
       
    73         TInt RunError( TInt aError );
       
    74         
       
    75     private: // Private data for base channel
       
    76     
       
    77     // The timer object
       
    78     RTimer iTimer;
       
    79     
       
    80     // The timing sequence that is used in herz
       
    81     TInt iTimerToHzLevel;
       
    82     
       
    83     // The call back function that is called when the timer expires
       
    84     MSendDataCallBack& iCallBack;
       
    85     
       
    86     TBool iIsCanceled;
       
    87     
       
    88     };
       
    89 
       
    90 class MSendDataCallBack
       
    91     {
       
    92 public:
       
    93     
       
    94     /**
       
    95     * A callback method for the timer to call. Is implemented by the client.
       
    96     */
       
    97     virtual void SendDataAfterTimer() = 0;
       
    98     
       
    99     };
       
   100 
       
   101 #endif // TCSENDEVENTTIMER_H
       
   102 
       
   103 // End of File