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

📄 vibra.h

📁 symbian 2rd下手机振动的控制和应用
💻 H
字号:
// ***************************************************************
//  Vibra   version:  1.0   ·  date: 04/10/2008
//  -------------------------------------------------------------
//  author:	ioernt
//  -------------------------------------------------------------
//  Copyright (C) 2008 - All Rights Reserved
// ***************************************************************
// 振动提示相关操作的一个封装
// ***************************************************************
#include <vibractrl.h>

//#include <e32base.h> // CBase
//#include <avkon.rsg>
#include <eikon.hrh>
//#define _VIBRA_DEBUG_

class CVibra	:	CTimer, MVibraControlObserver
{
public:
#ifdef _VIBRA_DEBUG_
	static		TInt		Log(const TDesC& aText);
	static		TInt		Log(const TDesC8& aText);
#endif
	static		CVibra*		NewL();
	static		CVibra*		NewLC();
	const static TInt		KStepInterval = 500;	// 500ms
	const static TInt		KSetpCount		= 6;	// 渐强6次 总计时间3秒

	~CVibra();

public:
	// 新函数
	CVibraControl::TVibraModeState  VibraSettings ();

	void VibraGraduallyUp( TInt aMaxIn100 = 80, 
							TInt aStepInterval = KStepInterval,
							TInt aStepCount = KSetpCount);
	void StartVibraL(TUint16 aDuration, TInt aIntensity);

	void StopVibraL();
public:
	// MVibraControlObserver 函数
	virtual void  VibraModeStatus (CVibraControl::TVibraModeState aStatus);

	virtual void  VibraRequestStatus (CVibraControl::TVibraRequestStatus aStatus);
private:
	CVibra();
	void ConstructL();

private:
	void RunL();

	void DoCancel();
private:
	CVibraControl*			iVibraCtrl;

	// 是否可以震动
	TBool					iIsVibraEnabled;

	// 控制震动强度
	TInt					iStrength;
	TInt					iStepInterval;
	TInt					iStepCount;
	TInt					iMaxStrength;
public:
};

⌨️ 快捷键说明

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