×
Namespaces

Variants
Actions

如何在S60第三版设备上设置铃声静音

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata

文章
huwell 在 02 Jul 2007 创建
最后由 hamishwillee 在 15 Dec 2011 编辑
  • 设备, 软件 版本:

S60 3rd Edition,

S60 3rd Edition, FP1


  • 详细描述:

当有来电时,我们可以通过Phone Client Extension API来将铃声设为静音,这是S60第三版中扩展插件的一部分功能。 3rd party Telephony API (CTelephony) 可以用来监测来电事件.

Extensions plug-in package for S60 3rd Edition SDK for Symbian OS, for C++, MR

Extensions plug-in package for S60 3rd Edition SDK for Symbian OS, for C++, supporting FP1


  • 解决方案:

下列代码显示了如何加载PhoneClientExt这个dll,然后构造并使用一个command handler(CPhCltCommandHandler)来使铃声静音。

Required capability: WriteDeviceData
 
/*** Header file ***/
 
#include <RPhCltServer.h> // link against PhoneClient.lib
 
#include <PhCltExt.h> // link against PhoneClientExt.lib
 
...
 
 
 
RPhCltServer iPhoneClientServer;
 
RLibrary iLibrary;
 
CPhCltCommandHandler* iPhCommandHandler;
 
 
 
/*** Source file ***/
 
_LIT(KPhoneCltExDllName, "PhoneClientExt.dll");
 
User::LeaveIfError( iPhoneClientServer.Connect() );
 
User::LeaveIfError( iLibrary.Load(KPhoneCltExDllName) );
 
TInt res = iLibrary.Lookup(1)();
 
CPhCltExtFactory* phCltExtFactory = reinterpret_cast<CPhCltExtFactory*>( res );
 
iPhCommandHandler = phCltExtFactory->CPhCltCommandHandlerLD();
 
User::LeaveIfError( iPhCommandHandler->Open(iPhoneClientServer) );
 
// Mute an ongoing ringing tone. This should be done inside an active object
 
// (a class derived from CActive)
 
iPhCommandHandler->MuteRingingTone( iStatus );
 
SetActive();
This page was last modified on 15 December 2011, at 12:59.
82 page views in the last 30 days.
×