webengine/wmlengine/src/System/include/CEpoc32Timer.h
changeset 0 dd21522fd290
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/webengine/wmlengine/src/System/include/CEpoc32Timer.h	Mon Mar 30 12:54:55 2009 +0300
@@ -0,0 +1,56 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+#ifndef __EPOC32TIMER_H
+#define __EPOC32TIMER_H
+
+#include <e32base.h>
+
+class CEpoc32Timer : public CTimer
+  {
+  public:
+    static CEpoc32Timer* New( const TUint32 aPeriodInMicroseconds, 
+                              const TBool aRepeatingTimer, 
+                              TCallBack& aCallBackFunc );
+    ~CEpoc32Timer();
+    
+    TUint32 MicrosecondsLeftUntilNextTick() const;
+    void Stop();
+    void Resume();
+      
+  protected:
+    CEpoc32Timer( const TUint32 aPeriodInMicroseconds, 
+                  const TBool aRepeatingTimer, 
+                  TCallBack& aCallBackFunc );
+    void ConstructL();
+    void RunL();
+    void Start();
+      
+    virtual void After( TUint32 aPeriodInMicroseconds );
+      
+  private:
+    TTime       iResumeTime;
+    TCallBack   iCallBackFunc;
+    TUint32     iTimeOutInMicroseconds;
+    // How many microseconds was left until next tick when we were stopped
+    TUint32     iTimeLeftInMicroseconds; 
+    // If the timer period is > MaxTTimeInMicroseconds32, then the extra 
+    // milliseconds are stored here.
+    TUint32     iPeriodInMicrosecondsExceedingRangeOfTInt; 
+    TBool       iIsRepeating;
+  };
+
+#endif