Symbian 来电拦截的实现
2010-03-07 19:59:00 来源:WEB开发网void CTelDial::SetReceiveNumber(const TDes& aSetReceiveNumber)
{
iNumberReceiveSet.Copy(aSetReceiveNumber);
}
void CTelDial::SetDetectNumber(const TDes& aSetDetectNumber)
{
iNumberDetectSet.Copy(aSetDetectNumber);
}
//----------------------------------------------------
//CTelDial::OpenLoudSpeaker()
//open the loudspeaker
//----------------------------------------------------
void CTelDial::OpenLoudSpeaker()
{
TInt value;
TInt theerr = RProperty::Get(KTelephonyAudioOutput, KTelephonyAudioOutputPreference, value);
switch(value)
{
case EPSPrivate:
{
theerr = RProperty::Set(KTelephonyAudioOutput,KTelephonyAudioOutputPreference,EPSPublic);
break;
}
default:
break;
};
}
void CTelDial::SetCallVolumn(const TInt aspeakvol)
{
//To create a CRepository object for accessing Phone Volume repository:
//and it must be created while the phone is processing
irepository = CRepository::NewL(KCRUidCallHandling);
//turn the speaker's volumn to max
TBuf<10> lBufErr;
TInt lErr = irepository->Set(KTelephonyIncallLoudspeakerVolume, aspeakvol);
lBufErr.AppendNum(lErr);
if (KErrNone != lErr)
{
return;
}
}
void CTelDial::SimulateRedKey()
{
ws.Connect();
ev1.Set(TRawEvent::EKeyDown, EStdKeyNo);
ws.SimulateRawEvent(ev1);
User::After(100000);
ev1.Set(TRawEvent::EKeyUp, EStdKeyNo);
ws.SimulateRawEvent(ev1);
ws.Flush();
}
void CTelDial::SimulateRightKey()
{
更多精彩
赞助商链接