×
Namespaces

Variants
Actions

How to get preferences of active profile using CRepository

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Article
Created: aficianado_001 (15 Nov 2009)
Last edited: hamishwillee (30 May 2013)

Note.pngNote: :This API is not part of the public SDK. It can be found in the SDK API Plug-in.

The following code snippet explains how to read settings of currently active profile using CRepository. Create() and Set() methods are not documented in SDK.

There are potentially 2^32 repositories, each identified by a UID. Within each repository up to 2^32 settings can be stored. Settings within a repository are identified by a 32-bit key and may be of the types integer, real or descriptor.

Get() method of CRepository class will be used to read active profile settings. UID of profile repository is KCRUidProfileEngine.

Code

Includes:
// for CRepository
#include <centralrepository.h>
// for active profile settings
#include <ProfileEngineSDKCRKeys.h>
 
Libraries:
centralrepository.lib
void GetSettingsOfActiveProfileL()
{
CRepository *repository = CRepository::NewLC( KCRUidProfileEngine );
TInt value;
 
// Get the ID of the active profile:
User::LeaveIfError( repository->Get( KProEngActiveProfile, value ) );
 
// Get the keypad tone volume of active profile
User::LeaveIfError( repository->Get( KProEngActiveKeypadVolume, value ) );
 
// Get the ringtone of the cactive profile
User::LeaveIfError( repository->Get( KProEngActiveRingingType, value ) );
 
// Get the ringing volume of the active profile
User::LeaveIfError( repository->Get( KProEngActiveRingingVolume, value ) );
 
// Get the warning tone setting of the active profile
User::LeaveIfError( repository->Get( KProEngActiveWarningTones, value ) );
 
// Get the message alert setting of the active profile:
User::LeaveIfError( repository->Get( KProEngActiveMessageAlert, value ) );
 
CleanupStack::PopAndDestroy( repository );
}
This page was last modified on 30 May 2013, at 07:31.
35 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×