⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 inactivitytimer.h

📁 基于Symbian OS的手机开发与应用实践第12章代码。主要讲各种时钟
💻 H
字号:
/*
* ============================================================================
*  Name     : CInactivityTimer from InactivityTimer.h
*  Part of  : Autolock
*  Created  : 05.02.2006 by ToBeReplacedByAuthor
*  Description:
*     Declares document for application.
*  Version  :
*  Copyright: ToBeReplacedByCopyright
* ============================================================================
*/

#ifndef INACTIVITYTIMER_H
#define INACTIVITYTIMER_H

// INCLUDES
#include <e32base.h> // for CTimer
   
// CONSTANTS

// FORWARD DECLARATIONS


// CLASS DECLARATION

/**
*  CInactivityTimer application class.
*/
class CInactivityTimer : public CTimer
    {
    public: // interface
        /**
         *  The object which wants to receive timer event will implements 
         *  this interface
         */
        class MObserver
        {
            public:
                /**
                 *  Called when timer request completed
                 *  @param aInactivity ETure if an inactivity is detected.
                 *                     EFalse if an activity is detected.
                 */
                virtual void OnTimerL(TBool aInactivity) = 0;
        };

    public: // Constructors and destructor
        /**
        * Two-phased constructor.
        */
        static CInactivityTimer* NewL(MObserver& aObserver);

        /**
        * Destructor.
        */
        virtual ~CInactivityTimer();

    public: // New functions
        void Start(TTimeIntervalSeconds aTimeout);
        void Stop();

    private:  // Functions from base classes
        /**
         *  Used to trigger timer event
         */
        void RunL();

    private:
        /**
        * EPOC default constructor.
        */
        CInactivityTimer(MObserver& aObserver);
        void ConstructL();

    private:
        MObserver& iObserver;
        TTimeIntervalSeconds iTimeout; // The inactivity time
        TBool iInactivity; // ETrue if we are waiting for an inactivity
    };

#endif

// End of File

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -