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

📄 ansphonecalllog.cpp

📁 s60 接打电话代码,很有学习价值的,可以移植到不同平台
💻 CPP
字号:
/**
*
* @brief Definition of CAnsPhoneCallLog
*
* Copyright (c) EMCC Software Ltd 2003
* @version 1.0
*/

#include "AnsPhoneCallLog.h"

#include <eikenv.h>

CAnsPhoneCallLog::CAnsPhoneCallLog(MAnsPhoneCallLogObserver& aObserver)
:CActive(EPriorityNormal),
 iObserver(aObserver)
	{
	}

CAnsPhoneCallLog::~CAnsPhoneCallLog()
	{
	Cancel();
	delete iRecentView;
	delete iSession;
	}

CAnsPhoneCallLog* CAnsPhoneCallLog::NewL(MAnsPhoneCallLogObserver& aObserver)
	{
	CAnsPhoneCallLog* self = new (ELeave) CAnsPhoneCallLog(aObserver);
	CleanupStack::PushL(self);
	self->ConstructL();
	CleanupStack::Pop(self);
	return self;
	}

void CAnsPhoneCallLog::ConstructL()
	{
	CActiveScheduler::Add(this);

	iSession = CLogClient::NewL(CEikonEnv::Static()->FsSession());
	iRecentView = CLogViewRecent::NewL(*iSession);
	}

///////////////////////////////////////////////////////////////////////////////////////////////////////
// CActive
//
///////////////////////////////////////////////////////////////////////////////////////////////////////

void CAnsPhoneCallLog::RunL()
	{
	const CLogEvent& event = iRecentView->Event();
	iObserver.HandlePhoneNumberL(event.Number());
	}

void CAnsPhoneCallLog::DoCancel()
	{
	iRecentView->Cancel();
	}


void CAnsPhoneCallLog::GetNumberL()
// queues a request to get the most recent event
	{
	if(iRecentView->IsActive())
		iRecentView->Cancel();

	if (iRecentView->SetRecentListL(KLogNullRecentList, iStatus))
    	SetActive();
	}


⌨️ 快捷键说明

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