情景模式UID API

Profile UID API
Note!
This API is not part of the public SDK. It can be found in the SDK API Plug-in.


The Profiles UID API plugin provides keys using which we can query default ringing tone,message alert tone and Instant Message alert tone.It also has keys which give information about whether self recorded tones and DRM protected MP4 tones can be used as ringing tones or not.
Use cases
These APIs are useful to play default ringtone by your application. These default tones are stored in Z drive.
Example code
Headers files
#include <centralrepository.h>
#include <ProfileEngineInternalCRKeys.h>
Library  centralrepository.lib
// We need to Query Central Repository.
CRepository* cRepository = CRepository::NewLC( KCRUidProfileEngine );
 
TBuf<100> tone;
// Get the default tone.
KProEngDefaultRingingTone is the id of the default ringing tone.
CAknInformationNote* informationNote = new (ELeave) CAknInformationNote;
 User::LeaveIfError( cRepository->Get( KProEngDefaultRingingTone   , tone ) );
 informationNote->ExecuteLD(tone);
KProEngDefaultMessageTone is the id of the default message alert tone.
CAknInformationNote* informationNote = new (ELeave) CAknInformationNote;
 User::LeaveIfError( cRepository->Get( KProEngDefaultMessageTone, tone ) );
 informationNote->ExecuteLD(tone);
KProEngDefaultImTone is the id of the default instant message alert tone.
CAknInformationNote* informationNote = new (ELeave) CAknInformationNote;
 User::LeaveIfError(cRepository->Get( KProEngDefaultImTone ,tone ) );
 informationNote->ExecuteLD(tone);
________________________________________
// To know whether self recorded tones,DRM protected MP4 tones can be used as ringing tones or not
KProEngRecordedRingingTones is the id to check whether self recorded tones can be used as ringing tones or not.
TInt value;
//Get the integer value
 
User::LeaveIfError( cRepository->Get( KProEngRecordedRingingTones  , value ) );
 
// To display message
 
_LIT(message0,"Not Permitted");
_LIT(message1,"Permitted");
 
CAknInformationNote* informationNote = new (ELeave) CAknInformationNote;
 if(value==0)
            {
            informationNote->ExecuteLD(message0); //disabled 
            }
            else
            {
            informationNote->ExecuteLD(message1); //enabled 
            }
KProEngNoDrmMP4RingingTones is the id to check whether self recorded tones can be used as ringing tones or not.
TInt value;
//Get the integer value
User::LeaveIfError( cRepository->Get( KProEngNoDrmMP4RingingTones, value ) );
 
// To display message
 
_LIT(message0,"Not Allowed");
_LIT(message1,"Allowed");
 
CAknInformationNote* informationNote = new (ELeave) CAknInformationNote;
 if(value==0)
            {
            informationNote->ExecuteLD(message1); //allowed, default
            }
            else
            {
            informationNote->ExecuteLD(message0); //Not allowed
            }
Example project
Example application

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值