Namespaces

Variants
Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

Personalisation Skins Settings API

From Wiki
Jump to: navigation, search
Article Metadata
Code ExampleArticle
Created: ltomuta (16 Jun 2007)
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 Personalisation And skin Setting API's are used to retrieve the information regarding the location of the active skin,its Uid, available colour schemes, active colour shceme, its Uid, bitmap index of background image in idle state, favourites, Uid's of the background image in idle state,screen saver path name of the active background image in idle state, system default screen saver.

Example code

Header files

#include <aknskinsinternalcrkeys.h>
#include <centralrepository.h> // Headers Used for CRepository

Link against:

LIBRARY centralrepository.lib
// We need to Query Central Repository
CRepository* iRepository = CRepository::NewL( KCRUidPersonalisation );

Commonly used instance variables:

TInt iIndex;
TInt iId;
TInt iErrCode;
 
TBuf<100> iBufInfo;
TBuf<5> iBufErrCode;
 
TUid iUid;
 
TLex iIntConv;

The following is the code snippet for retrieving the Location of the active skin, integer value:

Possible values: 0: Phone (drives C:\ and Z:\) 2: MMC (E:\)

iErrCode = iRepository->Get(KPslnActiveSkinLocation, iId);
iBufErrCode.AppendNum(iErrCode);
if ( iErrCode == KErrNone )
{
switch(iId)
{
case 0:
{
iBufInfo.Copy(_L("C or Z drive"));
}
break;
case 2:
{
iBufInfo.Copy(_L("E drive"));
}
break;
default:
{
iBufInfo.Copy(_L("Err"));
}
break;
}
CEikonEnv::InfoWinL(_L("Loc of active skin"), iBufInfo);
}
else
{
CEikonEnv::InfoWinL(_L("Err in getting active skinloc"),iBufErrCode);
}
iBufErrCode.Zero();
iBufInfo.Zero();

The following is the code snippet for retrieving the Active Skin Uid

iErrCode = iRepository->Get(KPslnActiveSkinUid, iBufInfo);
iBufErrCode.AppendNum(iErrCode);
if ( iErrCode == KErrNone )
{
iIntConv.Assign(iBufInfo);
iIntConv.Val(iUid.iUid);
iBufInfo.Copy(iUid.Name());
 
CEikonEnv::InfoWinL(_L("Uid of active skin"), iBufInfo);
}
else
{
CEikonEnv::InfoWinL(_L("Err in getting active skin
uid"
),iBufErrCode);
}
iBufErrCode.Zero();
iBufInfo.Zero();
iUid = TUid::Null();

The following is the code snippet for retrieving Active color palette Uid:

iErrCode = iRepository->Get(KPslnColorPaletteUid, iBufInfo);
iBufErrCode.AppendNum(iErrCode);
if ( iErrCode == KErrNone )
{
iIntConv.Assign(iBufInfo);
iIntConv.Val(iUid.iUid);
iBufInfo.Copy(iUid.Name());
 
CEikonEnv::InfoWinL(_L("Uid of Colour Palette is:")
, iBufInfo);
}
else
{
CEikonEnv::InfoWinL(_L("Err in getting Colour Palette Uid:"),
iBufErrCode);
}
iBufErrCode.Zero();
iBufInfo.Zero();
iUid = TUid::Null();

The following is the code snippet for retrieving the colour scheme:

Possible values: 0: Nokia "Classic" blue 1: Nokia green 2: Nokia purple 3: red 4: pink 5: orange

iErrCode = iRepository->Get(KPslnColorPalette, iId);
iBufErrCode.AppendNum(iErrCode);
 
if ( iErrCode == KErrNone )
{
switch( iId )
{
case 0:
{
iBufInfo.Copy(_L("blue"));
}
break;
case 1:
{
iBufInfo.Copy(_L("green"));
}
break;
case 2:
{
iBufInfo.Copy(_L("purple"));
}
break;
case 3:
{
iBufInfo.Copy(_L("red"));
}
break;
case 4:
{
iBufInfo.Copy(_L("pink"));
}
break;
case 5:
{
iBufInfo.Copy(_L("orange"));
}
break;
default:
{
iBufInfo.Copy(_L("err"));
}
break;
}
CEikonEnv::InfoWinL(_L("Color scheme"), iBufInfo);
}
else
{
CEikonEnv::InfoWinL(_L("Err in getting Colour "),iBufErrCode);
}
iBufErrCode.Zero();
iBufInfo.Zero();

The following is the code snippet for retrieving the Bitmap index of the active dimmed background image in the idle state:

iErrCode = iRepository->Get(KPslnDimmedIdleBackgroundImageIndex, iId);
iBufErrCode.AppendNum(iErrCode);
if ( iErrCode == KErrNone )
{
iBufInfo.AppendNum(iId);
CEikonEnv::InfoWinL(_L("Bitmap index of the active dimmed
background image in the idle state:"
), iBufInfo);
}
else
{
CEikonEnv::InfoWinL(_L("Err in getting Bitmap Image Index:")
, iBufErrCode);
}
iBufErrCode.Zero();
iBufInfo.Zero();

The following is the code snippet for retrieving Bitmap index of the active background image in the favourites:

iErrCode = iRepository->Get(KPslnFavouritesBackgroundImageIndex, iId);
iBufErrCode.AppendNum(iErrCode);
if ( iErrCode == KErrNone )
{
iBufInfo.AppendNum(iId);
CEikonEnv::InfoWinL(_L("Favourites Background Image Index:"),
iBufInfo);
}
else
{
CEikonEnv::InfoWinL(_L("Err in getting Bitmap Image Index:"),
iBufErrCode);
}
iBufErrCode.Zero();
iBufInfo.Zero();

The following is the code snippet for retrieving the Bitmap index of the active background image in the idle state:

iErrCode = iRepository->Get(KPslnIdleBackgroundImageIndex, iId);
iBufErrCode.AppendNum(iErrCode);
if ( iErrCode == KErrNone )
{
iBufInfo.AppendNum(iId);
CEikonEnv::InfoWinL(_L("Idle Background Image Index:"), iBufInfo);
}
else
{
CEikonEnv::InfoWinL(_L("Err in getting Bitmap Image Index:"),
iBufErrCode);
}
iBufErrCode.Zero();
iBufInfo.Zero();

The following is the code snippet for retrieving the Path name of the active background image file in the idle state:

iErrCode = iRepository->Get(KPslnIdleBackgroundImagePath, iBufInfo);
iBufErrCode.AppendNum(iErrCode);
if ( iErrCode == KErrNone )
{
CEikonEnv::InfoWinL(_L("Path of BgImg in Idle state:"), iBufInfo);
}
else
{
CEikonEnv::InfoWinL(_L("Err in getting Path"), iBufErrCode);
}
iBufErrCode.Zero();
iBufInfo.Zero();

The following is the code snippet for retrieving the Path name of the active background image file in favourites:

iErrCode = iRepository->Get(KPslnFavouritesBackgroundImagePath, iBufInfo);
iBufErrCode.AppendNum(iErrCode);
if ( iErrCode == KErrNone )
{
CEikonEnv::InfoWinL(_L("Path of BgImg in Favourites:"), iBufInfo);
}
else
{
CEikonEnv::InfoWinL(_L("Err in getting Path"), iBufErrCode);
}
iBufErrCode.Zero();
iBufInfo.Zero();

The following is the code snippet for retrieving the Active icon set Uid

iErrCode = iRepository->Get(KPslnIconSetUid, iBufInfo);
iBufErrCode.AppendNum(iErrCode);
if ( iErrCode == KErrNone )
{
iIntConv.Assign(iBufInfo);
iIntConv.Val(iUid.iUid);
iBufInfo.Copy(iUid.Name());
 
CEikonEnv::InfoWinL(_L("Uid Active icon set:"), iBufInfo);
}
else
{
CEikonEnv::InfoWinL(_L("Err in getting active icon uid"),
iBufErrCode);
}
iBufErrCode.Zero();
iBufInfo.Zero();
iUid = TUid::Null();

The following is the code snippet for retrieving the Active screen savers Uid:

iErrCode = iRepository->Get(KPslnScreenSaverUid, iId);
iBufErrCode.AppendNum(iErrCode);
 
if ( iErrCode == KErrNone )
{
iUid = TUid::Uid(iId);
CEikonEnv::InfoWinL(_L("Active screen savers Uid:"),iUid.Name());
}
else
{
CEikonEnv::InfoWinL(_L("Err in getting Active screen savers Uid."),
iBufErrCode);
}
iBufErrCode.Zero();
iBufInfo.Zero();
iUid = TUid::Null();

The following is the code snippet for retrieving the System default screen saver.(Read only):

iErrCode = iRepository->Get(KPslnSystemDefaultScreenSaver, iBufInfo);
iBufErrCode.AppendNum(iErrCode);
 
if ( iErrCode == KErrNone )
{
iIntConv.Assign(iBufInfo);
iIntConv.Val(iUid.iUid);
iBufInfo.Copy(iUid.Name());
 
CEikonEnv::InfoWinL(_L("Default screen saver:"),iBufInfo);
}
else
{
CEikonEnv::InfoWinL(_L("Err in getting Default screen saver"),
iBufErrCode);
}
iBufErrCode.Zero();
iBufInfo.Zero();
iUid = TUid::Null();

The following is the code snippet for retrieving the Active background image in the idle state Uid:

iErrCode = iRepository->Get(KPslnIdleBackgroundImageUid, iBufInfo);
iBufErrCode.AppendNum(iErrCode);
 
if ( iErrCode == KErrNone )
{
iIntConv.Assign(iBufInfo);
iIntConv.Val(iUid.iUid);
iBufInfo.Copy(iUid.Name());
 
CEikonEnv::InfoWinL(_L("Idle Background Image Uid"),iBufInfo);
}
else
{
CEikonEnv::InfoWinL(_L("Err in getting IdleBackgroundImage Uid."),
iBufErrCode);
}
iBufErrCode.Zero();
iBufInfo.Zero();
iUid = TUid::Null();

The following is the code snippet for retrieving the Active background image in the favourites Uid.:

iErrCode = iRepository->Get(KPslnFavouritesBackgroundImageUid, iBufInfo);
iBufErrCode.AppendNum(iErrCode);
 
if ( iErrCode == KErrNone )
{
iIntConv.Assign(iBufInfo);
iIntConv.Val(iUid.iUid);
iBufInfo.Copy(iUid.Name());
 
CEikonEnv::InfoWinL(_L("Favourites Background Image Uid:"),
iBufInfo);
}
else
{
CEikonEnv::InfoWinL(_L("Err in getting Favourites Background Image
Uid"
), iBufErrCode);
}
iBufErrCode.Zero();
iBufInfo.Zero();
iUid = TUid::Null();

The following is the code snippet for retriving the list of the supported color schemes:

iErrCode = iRepository->Get(KPslnAvailableColorPalettes, iBufInfo);
iBufErrCode.AppendNum(iErrCode);
 
if ( iErrCode == KErrNone )
{
CEikonEnv::InfoWinL(_L("AvailableColorPalettes numbered [0 so
on]:"
),iBufInfo);
}
else
{
CEikonEnv::InfoWinL(_L("Err in getting AvailableColorPalettes"),
iBufErrCode);
}
iBufErrCode.Zero();
iBufInfo.Zero();


Example Project

File:PrsnAndSkinSettings.zip

This page was last modified on 30 May 2013, at 04:39.
50 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.

×