×
Namespaces

Variants
Actions
Revision as of 09:57, 13 June 2008 by Forum Nokia KB (Talk | contribs)

Archived:Screensaver Settings Symbian API

From Nokia Developer Wiki
Jump to: navigation, search

Template:KBCS

ID CS001039 Creation date June 13, 2008
Platform S60 3rd Edition, FP2 Tested on devices  
Category Symbian C++ Subcategory  


Keywords (APIs, classes, methods, functions): Screensaver Settings API


Template:NoteS

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

Template:NoteE

The Screensaver Settings API is used to retrieve information about the screen saver. The information which can be retrieved is the name of screen saver plug-in module currently in use, type of screen saver object, and screen saver text.


Header files

  #include <screensaverinternalcrkeys.h>
#include <centralrepository.h> // for CRepository

Link against

  LIBRARY   centralrepository.lib
    CRepository* iRepository = CRepository::NewL( KCRUidScreenSaver);

Commonly used instance variables

    TInt      iErrCode;
TInt iVal;
TBuf<200> iDispVal;

Example code

Retrieving the name of screen saver plug-in currently in use:

Note: The string does not contain path information, only the name of plug-in module. This value applies only if KScreenSaverObject is set to EScreensaverTypePlugin.

    iErrCode = iRepository->Get(KScreenSaverPluginName, iDispVal);
if ( iErrCode == KErrNone )
{
iEikonEnv->AlertWin(_L("pluginname"), iDispVal);
}

Retrieving the type of the screen saver object:

Possible values: 0: text 1: time and date (default value) 3: plugin

    iErrCode = iRepository->Get(KScreenSaverObject ,iVal);
if(iErrCode == KErrNone)
{
iDispVal.Num(iVal);
switch(iVal)
{
case 0: iEikonEnv->AlertWin(_L("SStype text"), iDispVal);
break;
case 1: iEikonEnv->AlertWin(_L("SStype Date"), iDispVal);
break;
case 3: iEikonEnv->AlertWin(_L("SStype plugin"), iDispVal);
break;
default:
break;
}
}
else
{
iDispVal.Num(iErrCode);
iEikonEnv->AlertWin(_L("error"), iDispVal);
}

Retrieving screen saver text:

    iErrCode =iRepository->Get(KScreenSaverText, iDispVal);
if(iErrCode == KErrNone )
{
iEikonEnv->AlertWin(_L("Text is"), iDispVal);
}
else
{
iDispVal.Num(iErrCode);
iEikonEnv->AlertWin(_L("error"), iDispVal);
}
102 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.

×