📄 phoneobserver.cpp
字号:
/*
* ============================================================================
* Name : Phoneobserver.cpp
* Part of : RecorderExample
* Created : 20.03.2005 by Forum Nokia
* Version : 1.0.0
* Copyright: Nokia Corporation
* ============================================================================
*/
#include "phoneobserver.h"
CCallMonitor *CCallMonitor::NewL(MCallCallBack & aReceiver)
{
CCallMonitor* self = new (ELeave) CCallMonitor(aReceiver);
CleanupStack::PushL(self);
self->ConstructL();
CleanupStack::Pop();
return self;
}
CCallMonitor::CCallMonitor(MCallCallBack& aCallBack)
:CActive(0),iCallBack(aCallBack),iCurrentStatusPckg(iCurrentStatus)
{
}
CCallMonitor::~CCallMonitor()
{
Cancel();
delete iTelephony;
}
void CCallMonitor::ConstructL(void)
{
CActiveScheduler::Add(this);
iTelephony = CTelephony::NewL();
StartListening();
}
void CCallMonitor::CancelOperation(void)
{
Cancel();
}
void CCallMonitor::DoCancel()
{
iTelephony->CancelAsync(CTelephony::EVoiceLineStatusChangeCancel);
}
void CCallMonitor::RunL()
{
iCallBack.CallStatusChangedL(iCurrentStatus.iStatus, iStatus.Int());
StartListening();
}
void CCallMonitor::StartListening()
{
Cancel();
iCurrentStatus.iStatus = CTelephony::EStatusUnknown;
iTelephony->NotifyChange(iStatus,CTelephony::EVoiceLineStatusChange,iCurrentStatusPckg);
SetActive();
}
// End of File
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -