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.

Archived:Clock Settings Symbian API

From Wiki
Jump to: navigation, search

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

Article Metadata
Compatibility
Platform(s): S60 3rd Edition, FP2
S60 3rd Edition FP2
Article
Keywords: Clock Settings API
Created: User:Technical writer 1 (13 Jun 2008)
Last edited: lpvalente (23 Jan 2013)


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

The Clock Setting APIs are used to retrieve and set the settings information of the Clock Application, such as Clock alarm sound file and Clock alarm snooze time.

Contents

Header files

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

Link against

    LIBRARY centralrepository.lib

Capabilities

    WriteUserData WriteDeviceData
    // We need to Query Central Repository
CRepository* iRepository = CRepository::NewL( KCRUidClockApp );

Commonly used instance variables

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


Code examples

Retrieving the clock alarm sound file:

     iErrCode = iRepository->Get(KClockAppSoundFile ,iDispVal);
if(iErrCode == KErrNone)
{
iEikonEnv->AlertWin(_L("soundfile"),iDispVal);
}
else
{
iDispVal.Num(iErrCode) ;
iEikonEnv->AlertWin(_L("error"),iDispVal);
}

Retrieving clock alarm snooze time:

     iErrCode =iRepository->Get(KClockAppSnoozeTime ,iVal);
if(iErrCode == KErrNone)
{
iDispVal.Num(iVal) ;
iEikonEnv->AlertWin(_L("snoozetime"),iDispVal);
}
else
{
iDispVal.Num(iErrCode) ;
iEikonEnv->AlertWin(_L("error"),iDispVal);
}

Setting Clock alarm snooze time:

     iErrCode = iRepository->Get(KClockAppSnoozeTime ,iVal);
if(iErrCode == KErrNone)
{
iRepository->Set(KClockAppSnoozeTime,(iVal+1));
}
else
{
iDispVal.Num(iErrCode) ;
iEikonEnv->AlertWin(_L("error"),iDispVal);
}
This page was last modified on 23 January 2013, at 13:06.
77 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.

×