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