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

📄 listboxrefreshtimer.cpp

📁 Series_60_DP_1_0_2_0_Thread_And_Active_Objects_Example_v1_0 Symbian os S60线程与活动对象实例
💻 CPP
字号:
/*
* ============================================================================
*  Name     : CListboxRefreshTimer from ListboxRefreshTimer.h
*  Part of  : ThreadAO
*  Created  : 12.1.2005 by Forum Nokia
*  Version  : 1.0
*  Copyright: Nokia Corporation
* ============================================================================
*/

// INCLUDES
#include <e32base.h> 
#include "aknnotewrappers.h"
#include "DeviceListContainer.h"

// Listbox screen update interval
const TInt KSecond = 1000 * 1000;

#include "ListboxRefreshTimer.h"

// ----------------------------------------------------------------------------
// CListboxRefreshTimer::CListboxRefreshTimer(void)
//
// Constructor.
// ----------------------------------------------------------------------------
CListboxRefreshTimer::CListboxRefreshTimer(CDeviceListContainer* aListBox)
	: CTimer(CActive::EPriorityStandard), iListbox(aListBox) 
	{
	}

// ----------------------------------------------------------------------------
// CListboxRefreshTimer::~CListboxRefreshTimer(void)
//
// Destructor.
// ----------------------------------------------------------------------------
CListboxRefreshTimer::~CListboxRefreshTimer(void)
	{
	Cancel();
	}


CListboxRefreshTimer* CListboxRefreshTimer::NewL(CDeviceListContainer* aListBox)
	{
	CListboxRefreshTimer* self = CListboxRefreshTimer::NewLC(aListBox);
	CleanupStack::Pop(self);
	return self;
	}

CListboxRefreshTimer* CListboxRefreshTimer::NewLC(CDeviceListContainer* aListBox)
	{
	CListboxRefreshTimer* self = new (ELeave) CListboxRefreshTimer(aListBox);
	CleanupStack::PushL(self);
	
	self->ConstructL();
	return self;
	}

// Standard Symbian OS 2nd phase constructor
void CListboxRefreshTimer::ConstructL()
	{
	CTimer::ConstructL();
	CActiveScheduler::Add(this);
	}

// ----------------------------------------------------------------------------
// CListboxRefreshTimer::StartL()
//
// Start updating the listbox.
// ----------------------------------------------------------------------------
void CListboxRefreshTimer::StartL()
	{
	After( KSecond );	
	}

// ----------------------------------------------------------------------------
// CListboxRefreshTimer::RunL()
// ----------------------------------------------------------------------------
void CListboxRefreshTimer::RunL()
	{
	// Update the listbox.
	iListbox->HandleChangedL();
	// Wait for a while and run the same function again 
	After( KSecond );
	}

// ----------------------------------------------------------------------------
// CListboxRefreshTimer::DoCancel()
//
// Cancel and stop the timer. 
// ----------------------------------------------------------------------------
void CListboxRefreshTimer::DoCancel()	
	{
	CTimer::DoCancel();
	}

// ----------------------------------------------------------------------------
// CListboxRefreshTimer::RunError(TInt)
// ----------------------------------------------------------------------------
TInt CListboxRefreshTimer::RunError(TInt)
	{
	return KErrNone;
	}

⌨️ 快捷键说明

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