Profiles Engine API

Reviewer Approved    
Note!
This API is not part of the public SDK. It can be found in the SDK API Plug-in.
非标准API

ProfileEngine API's are mainly used to get the list of available profiles on the mobile, get the information about the active profile,
to get information of the profile change, set a profile and related information about it.

ProfileEngine API主要用来得到可用情景模式列表,得到当前情景模式的信息,得到情景模式变化的信息,设置一个情景模式及相关的信息

Header files
#include <mprofileengine.h>
#include <mprofilesnamesarray.h>
#include <mprofile.h>
#include <mprofilename.h>
#include <mprofiletones.h>

Link against
profileeng.lib

Capabilities required for activating new profile: WriteDeviceData

Use cases
These API's are used to show the Profiles. Also used to retrieve information of the currently Active Profile,its Id, Ringtone, MessageAlertTone.
They can also be used to set a particular Profile active.

这些API用来显示情景模式,而且用来获取当前情景模式的信息,他的ID、铃声、消息提示铃声,他们也可以用来设置一个特定的情景模式。

Example code
Before using the API's first we create an instance of MProfileEngine using "CreateProfileEngineL()" API
在使用这个API之前,我们首先要使用"CreateProfileEngineL创建一个MProfileEngine

MProfileEngine* lProfileEngine = CreateProfileEngineL();

Free the resources using "Release()" API
用Release()资源释放资源

lProfileEngine->Release();

or alternatively first Push it onto CleanupStack and then PopAndDestroy()
或者用清理栈

CleanupReleasePushL( *lProfileEngine );
....
CleanupStack::PopAndDestroy();

The following code snippet is used to get the available profiles on the phone.
下列代码片段得到当前可用的情景模式

MProfilesNamesArray* profilesNamesArray =
                       lProfileEngine->ProfilesNamesArrayLC();
TInt lCount = profilesNamesArray->MdcaCount();
 
for(TInt i=0;i<lCount;i++)
    {
    TBuf<20> lName;
    lName= profilesNamesArray->ProfileName(i)->Name();
    CEikonEnv::Static()->AlertWin(_L("Available Profiles:"),lName);
    lName.Zero();
    }
 
CleanupStack::PopAndDestroy(profilesNamesArray);

The following code snippet is used to list the details of the Active profile and its properties like Profile Name, Id, etc.,
下面的代码片段用来列出当前情景模式和他的属性如:名称、ID、等等

MProfile* lProfile =  lProfileEngine->ActiveProfileL();
CleanupReleasePushL( *lProfile );
 
const MProfileName& lMProfileName = lProfile->ProfileName();
TBuf<10> lProfileName = lMProfileName.Name();
CEikonEnv::Static()->AlertWin(_L("Profile Name:"),lProfileName);
 
TInt lId = lMProfileName.Id();
TBuf<10> lProfileId;
lProfileId.AppendNum(lId);
CEikonEnv::Static()->AlertWin(_L("its Profile Id:"),lProfileId);
 
const MProfileTones& lMProfileTones = lProfile->ProfileTones();
TBuf<255> lProfileTone1 = lMProfileTones.RingingTone1();
CEikonEnv::Static()->AlertWin(_L("Profile Ringtone1:"), lProfileTone1);
 
TBuf<255> lProfileMsgalrt = lMProfileTones.MessageAlertTone();
CEikonEnv::Static()->AlertWin(_L("ProfileMsgAlrtToneName:"),lProfileMsgalrt);
 
CleanupStack::PopAndDestroy();

The following code snippet is used to set the Profile:
We pass the Id of the Profile Name to set the Profile active.

下列代码片段用来设置情景模式,我们传入情景模式的ID来设置为活动的。

lProfileEngine->SetActiveProfileL(0);

The following link is useful in getting notifications of profile change:Profile Change

Example project
ProfileEngine_SampleCode

情景模式引擎 API相关推荐

  1. 【虚幻引擎UE】UE5 三种模式调用API详解(案例基于免费Varest插件)

    [虚幻引擎UE]UE5 三种模式调用API详解(案例基于免费Varest插件) 想通过UE5 调用API实现GET和POST, 可以通过自己编写C++方法, 或基于相关HTTP请求插件, 如Vares ...

  2. 驰骋工作流引擎-API开发接口-重要的部分.

    驰骋工作流引擎-API开发接口-重要的部分. - 多看文档,少走弯路,学会使用ccbpm的api接口,让您的sdk表模式开发无忧. 登录与门户API 首先要进行代码集成与组织机构的集成 其次在自己的系 ...

  3. 安卓情景模式开发-控制GPS/WIFI/蓝牙/飞行模式/控制静音/音量/振动

    http://www.cnblogs.com/wii/archive/2012/03/18/2404947.html 对于android上GPS的控制,官方提供了相关的API Settings.Sec ...

  4. android manager provider模式,安卓情景模式开发(一)-控制GPS/WIFI/蓝牙/飞行模式...

    对于android上GPS的控制,官方提供了相关的API Settings.Secure.setLocationProviderEnabled(getContentResolver(), Locati ...

  5. QIIME 2教程. 24Python命令行模式Artifact API(2021.2)

    Python命令行模式 Artifact API https://docs.qiime2.org/2021.2/interfaces/artifact-api/ 注:本指南假定您已执行"4人 ...

  6. QIIME 2教程. 24Python命令行模式Artifact API(2020.11)

    文章目录 Python命令行模式 译者简介 Reference 猜你喜欢 写在后面 Python命令行模式 Artifact API https://docs.qiime2.org/2020.11/i ...

  7. 报表引擎API开发入门— EJB程序数据源

    2019独角兽企业重金招聘Python工程师标准>>> 我们前面讲了几个数据源,今天我们来讲一下EJB数据源,这篇讲完我们数据源这部分就讲完了.数据连接不需要直接访问数据库,而是使用 ...

  8. JAVA窗帘_HomeControl 智能家具系统,包括灯光,窗帘的控制,设备,房间,情景模式的添加 Java Develop 240万源代码下载- www.pudn.com...

    文件名称: HomeControl下载  收藏√  [ 5  4  3  2  1 ] 开发工具: Java 文件大小: 2574 KB 上传时间: 2015-06-17 下载次数: 0 提 供 者: ...

  9. android定时切换活动,安卓手机如何定时自动切换情景模式 (全文)

    相信很多人都知道手机情景模式这个功能.它可以根据不同场景环境而将手机调为静音或者震动模式.这个功能确确实实方便了许多人,因而也经常被使用.但是很多人希望手机能定时自动切换情景模式.安卓系统本身目前并不 ...

最新文章

  1. 关于BGP的notification错误码的解释
  2. mongodb 对内存的严重占用以及解决方法
  3. 深入理解BS结构应用程序
  4. MAVEN安装和配置
  5. c语言EOF0x99,C语言选择题99道.doc
  6. 谷歌浏览器不能上网_谷歌浏览器插件下载及安装教程!
  7. linux将程序锁死,Linux死锁现象及分析方法(转)
  8. 中国智能卡市场的新机会
  9. js table 生成序号_CSS Counter 以及 CSS content 内容生成技术的实用价值
  10. 鸿蒙安卓生态已经非常完善,鸿蒙前进一小步,生态却完善一大步,解决了替换安卓的第一个问题...
  11. java前端商城_网上java商城系统前端开发基础技能浅谈
  12. 杂记之视频监控基础之IPCAM
  13. android 禁用触摸屏,Touch Protector-安卓禁用手机触摸屏软件
  14. OSS视频上传后直接播放只有声音没有画面
  15. 基于chatgpt开发QQ机器人
  16. libpng库的使用讲解
  17. 【CHATGPT-3.5】如何使用ChatGPT的同时并学习记忆
  18. asyncio call_at,call_soon和call_later用法
  19. ObjecARX实现对圆图极坐标展开获得方图
  20. python爬虫爬取必应每日高清壁纸

热门文章

  1. 黑马Java热门面试题MySQL(五)
  2. L1-038 新世界 (5分)
  3. 我爱你(《豪杰春香》主题曲)
  4. 基于FM175XX的RFID应用(STM32的MDK工程)
  5. 大家好,我是UCMP云管家,这是我的自我介绍
  6. 物联网卡注册NB-iot网络过程
  7. Ubuntu没法联网怎么办[设置教程]
  8. h5H5-doom扩展
  9. 再读 ucosII源码(邵贝贝):内核结构
  10. ❀工信工实验参考——《VHDL实验4—— 多功能秒表》