Namespaces
Variants
Actions

Archived:Clock Settings Symbian API

Jump to: navigation, search
Archived.png
Archived: 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

Article
Keywords: Clock Settings API
Created: User:Technical writer 1 (13 Jun 2008)
Last edited: lpvalente (23 Jan 2013)


Note.png
Note: :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 16:06.
612 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved