Categories: S60 | Symbian C++ | UI | Code Examples
This page was last modified 14:55, 24 June 2008.
Personalisation Skins Settings API
From Forum Nokia Wiki
| Note! |
|---|
|
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
| Related Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Applets on 7710 | zmandic | General Browsing | 6 | 2005-04-12 17:34 |
| OMA-CP INTERNET setting and GSM-USSD parameter | davegjones1 | OMA DM/DS/CP | 3 | 2004-06-04 14:11 |
| 短信不能读了,求助! | caiwd | Symbian | 7 | 2008-07-14 14:58 |
| why i always recieve null return? | tanweish | General Messaging | 4 | 2003-05-02 13:12 |
| 3650 settings | cjitianu3 | Graphics & Video & Streaming | 3 | 2003-04-15 12:06 |
