Profiles Engine Extended API
Article Metadata
Code Example
Article
ProfileEngineExtended API is used to create new profiles and change the settings in existing profile. The Settings which can be set include Name,presence,tones.
Use cases
The usecases may be:
-Creating a New Profile
-Modify existing profile settings
-Delete a profile
Properties of a profile can be changed like its Name, Tones, Extra Tones, etc.,
Example code
Header files
#include <mprofileengineextended.h>
#include <mprofileextended.h>
#include <mprofilesetname.h>
#include <mprofilepresence.h>
#include <mprofilesetpresence.h>
#include <mprofilesetextratones.h>
Link against
LIBRARY profileeng.libCAPABILITY WriteDeviceData ReadDeviceData
The following is a code for creation of a Profile:
MProfileEngineExtended* lProfileEngExt = CreateProfileEngineExtendedL();
MProfileExtended* lNewProfile = lProfileEngExt->CreateProfileL();
MProfileSetName& lProfileName = lNewProfile->ProfileSetName();
TBuf<10> lPrfName(_L("UserProf"));
lProfileName.SetNameL( lPrfName );
The following is the code to set the Profile Presence:
MProfileSetPresence& lProfileSetPresence = lNewProfile->ProfileSetPresence();
TBuf<15> lProfilePrsenceMsg(_L("UsrPfl"));
lProfileSetPresence.SetStatusMessageL(lProfilePrsenceMsg);
The following is the code to retrieve the existing Profile Presence:
const MProfilePresence& lProfilePresence = lNewProfile->ProfilePresence();
TBuf<20> lPrfPrsn;
lPrfPrsn = lProfilePresence.StatusMessage();
CEikonEnv::Static()->AlertWin(_L("ProfileStatus Msg:"), lPrfPrsn);
The following is the code to set the ExtraTones for a Profile:
MProfileSetExtraTones& lProfileSetXtraTones = lNewProfile->ProfileSetExtraTones();
TBuf<50> leMailTonePath(_L("z:\\data\\sounds\\digital\\Tinker.aac"));
lProfileSetXtraTones.SetEmailAlertToneL(leMailTonePath);
Note: Similarly IM message alert tone and Video call ringing tone can be set using SetIMMessageAlertToneL (const TDesC &aIMMessageAlertTone) and SetVideoCallRingingToneL (const TDesC &aRingingTone)
Once the creation or modifcation is done to the profile, CommitChangeL of MProfileEngineExtended should be called to save the Settings.
lProfileEngExt->CommitChangeL(*lNewProfile);


(no comments yet)