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

📄 cameratimer.cpp

📁 最新官方例子,图形,描述副,基本控件,通讯协议,等等,
💻 CPP
字号:
/**
* 
* @brief Definition of CCameraTimer
*
* Copyright (c) EMCC Software Ltd 2003
* @version 1.0
*/

// INCLUDE FILES

// Class include
#include "CameraTimer.h"

// System includes

// User includes
#include "CameraObserver.h"

// Constants

// ================= MEMBER FUNCTIONS =======================

/**
* Symbian OS 2 phase constructor.
* Constructs the CCameraManger using the NewLC method, popping
* the constructed object from the CleanupStack before returning it.
* 
* @param aObserver the observer of the cameramanager
* @return The newly constructed CCameraTimer
*/
CCameraTimer* CCameraTimer::NewL(MCameraTimerObserver& aTimerObserver)
	{
	CCameraTimer* self = NewLC(aTimerObserver);
	CleanupStack::Pop(self);
	return self;
	}

/**
* Symbian OS 2 phase constructor.
* Constructs the CCameraTimer using the constructor and ConstructL 
* method, leaving the constructed object on the CleanupStack before returning it.
* 
* @param aObserver the observer of the cameratimer
* @return The newly constructed CCameraTimer
*/
CCameraTimer* CCameraTimer::NewLC(MCameraTimerObserver& aTimerObserver)
	{
	CCameraTimer* self = new (ELeave) CCameraTimer(aTimerObserver);
	CleanupStack::PushL(self);
	self->ConstructL();
	return self;
	}

/**
* Constructs the cameratimer
*
* @param aObserver the observer of the cameratimer
*/
CCameraTimer::CCameraTimer(MCameraTimerObserver& aTimerObserver)
	: CTimer(CActive::EPriorityStandard), iTimerObserver(aTimerObserver) 
	  // Construct  zero-priority active object
	{
	}

/** 
* Destructor.  Cancels the timer
*/
CCameraTimer::~CCameraTimer()
	{
	// Make sure we're cancelled
	Cancel();
	}

/**
* Symbian OS 2nd phase constructor. Calls the 
* base constructer and adds to the ActiveScheduler
* 
*/	
void CCameraTimer::ConstructL()
	{
   	iTimerInterval = KDefaultDelay;

	  // Base class second-phase construction.
	CTimer::ConstructL();

	  // Add active object to active scheduler
	CActiveScheduler::Add(this); 
	}

/**
* Called from CActive::Cancel() is called, allowing this object 
* to provide specific cleanup activity.
*
* 
*/	
void CCameraTimer::DoCancel()
	{
	  // Base class
	CTimer::DoCancel(); 
	}

/**
* Sets the time delay  
* 
*/
void CCameraTimer::SetDelay(TInt aTimerInterval)
	{
	iTimerInterval = aTimerInterval;
	}

/**
* requests an event after a time interval 
* 
*/
void CCameraTimer::StartTimer()
	{
	// Request a wait
	CTimer::After( iTimerInterval);
	}

/**
* Called when the an asyncronous request completes, i.e. when the 
* time requested has elapsed.
* 
*/
void CCameraTimer::RunL()
	{
	iTimerObserver.TimerCompleted();
	}

/**
* Called if RunL leaves
*/
TInt CCameraTimer::RunError(TInt /*aError*/)
	{
	// This function will never be called as CCameraTimer::RunL()
	// contains contains no functions that can leave. 
	return KErrNone;
	}

// End of file.

⌨️ 快捷键说明

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