commsconfig/cscengine/inc/cscengtimer.h
changeset 0 a4daefaec16c
child 6 fc8c25e5a2e8
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/commsconfig/cscengine/inc/cscengtimer.h	Mon Jan 18 20:12:36 2010 +0200
@@ -0,0 +1,105 @@
+/*
+* Copyright (c) 2007-2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:  Class for timer handling.
+*
+*/
+
+
+
+#ifndef C_CSCENGTIMER_H
+#define C_CSCENGTIMER_H
+
+#include <e32base.h> 
+
+class MCSCEngTimerObserver;
+
+/**
+ * An instance of CCSCEngTimer
+ * For timer handling.
+ *
+ * @lib cscengine.lib
+ * @since Series 60 3.2
+ */
+NONSHARABLE_CLASS( CCSCEngTimer ) : public CTimer
+    {    
+    public:
+
+        /**
+         * Enumeration which indicates timer type
+         */
+        enum TTimerType
+            {
+            EConnectionMonitoringTimer = 0
+            };
+    
+        /**
+         * Two-phased constructor.
+         */ 
+        IMPORT_C static CCSCEngTimer* NewL( 
+            MCSCEngTimerObserver& aObserver );
+
+
+        /**
+         * Destructor.
+         */
+        IMPORT_C virtual ~CCSCEngTimer();
+
+        
+        /**
+         * Start timer.
+         *
+         * @since S60 v3.2
+         * @return KErrNone when timer started successfully
+         */
+        IMPORT_C TInt StartTimer( TTimerType aType );
+        
+        
+        /**
+         * Stop timer.
+         *
+         * @since S60 v3.2
+         */
+        IMPORT_C void StopTimer();
+        
+
+    protected: 
+    
+        // from base class CTimer
+        
+        /**
+         * From CTimer. Called when timer expires.
+         */
+        void RunL();
+        
+               
+    private:
+
+        CCSCEngTimer( MCSCEngTimerObserver& aObserver );
+
+        void ConstructL();
+        
+        
+    private:  // data
+        
+        /**
+         * Reference for observer.
+         */
+        MCSCEngTimerObserver& iObserver;
+        
+#ifdef _DEBUG
+    friend class UT_CSCEngTimer;
+#endif 
+    };
+
+#endif // C_CSCENGTIMER_H