backlightswitch.h

来自「基于Symbian平台下随心所欲控制屏幕的灯亮熄.在观看视频和发短信时这一点非常」· C头文件 代码 · 共 96 行

H
96
字号
// CLASS DECLARATION
/**
*
* CBacklightSwitch BackLightSwitch.h
* This is a class to control the switching on and off of the backlight.
*
* Copyright (c) 2004 Nokia Corporation
* version 2.0
*/

#ifndef __BACKLIGHTSWITCH_H__
#define __BACKLIGHTSWITCH_H__

// INCLUDES

// System includes
#include <e32base.h>


class CBackLightSwitch : public CActive
	{
public:	// Construction and destruction.
    /**
     * Function:    NewL
     *
     * Description: Creates instance of CBackLight object
     *
     */
	static CBackLightSwitch* NewL();

    /**
     * Function:    ~CBackLightSwitch
     *
     * Description: Destroys the object
     *
     */	
	~CBackLightSwitch();

public:	// Methods.
    /**
     * Function:    ChangeState
     *
     * Description: This method will switch the requirement to keep the backlight on.
     *
     */	
	void ChangeStateL();
	void ChangeTolongLight();
	void ChangeToNormal();

private:	// Construction.
    /**
     * Function:    CBackLightSwitch
     *
     * Description: Constructor
     *
     */	
	CBackLightSwitch();

    /**
     * Function:    ConstructL
     *
     * Description: 2nd Phase Constructor
     *
     */	
	void ConstructL();

private:	// From CActive.
    /**
     * Function:    RunL
     *
     * Description: Handles request completion - called by the Active Scheduler
	 *              If it is required that the backlight should be kept on, this method
	 *              will reset the inactivity time of the device and set another timer
	 *				to expire before the light would be de-activated again
     *
     */	
	void RunL();

    /**
     * Function:    DoCancel
     *
     * Description: Cancels any outstanding timer request - called by Cancel
     *
     */	
	void DoCancel();

private:	// Data.
	RTimer	iTimer;
	TBool	iBackLightOn;
	};

#endif	// __BACKLIGHTSWITCH_H__

// End of File

⌨️ 快捷键说明

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