Join Now
Quality Rating:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)
This page was last modified 20:00, 13 October 2008.

CS001038 - Calendar Settings API

From Forum Nokia Wiki



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


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


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


The Calendar Setting APIs are used to retrieve the settings information of the calendar, such as Calendar DefaultAlarmTime, DefaultStartView, WeekViewTitle, SoundFile, DefaultSoundFile, and SnoozeTime.

Header files

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

Link against

LIBRARY   centralrepository.lib

Capabilities

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

Commonly used instance variables

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

Example code

Retrieving default alarm time in minutes before event starting time:

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

Setting default alarm time in minutes before event starting time:

iErrCode =iRepository->Set(KCalendarDefaultAlarmTime,30);
    if(iErrCode != KErrNone)
      {
      iDispVal.Num(iErrCode);
      iEikonEnv->AlertWin(_L("error"),iDispVal);
      }

Retrieving default starting view for Calendar:

Possible values:0: Month view (default) 1 = Week view 2 = Day view

iErrCode = iRepository->Get(KCalendarDefaultStartView, iVal);
    if(iErrCode == KErrNone)
      {
      switch(iVal)
        {
        case 0:
          {
          iDispVal.Num(iVal);
          iEikonEnv->AlertWin(_L("monthview"), iDispVal); 
          }
          break;
        case 1:
          {
          iDispVal.Num(iVal);
          iEikonEnv->AlertWin(_L("weekview"), iDispVal); 
          }
          break;              
        default:		    
          { 
          iDispVal.Num(iVal);
          iEikonEnv->AlertWin(_L("dayview"), iDispVal); 
          }
          break;
        }		
      }
    else
      {
      iDispVal.Num(iErrCode);
      iEikonEnv->AlertWin(_L("error"), iDispVal);
      }

Retrieving the Week view title in the Calendar application:

Possible values: 0: Week number (default) 1: Week dates

iErrCode= iRepository->Get(KCalendarWeekViewTitle, iVal);
    if(iErrCode == KErrNone)
      {
      if(iVal == 0)
        {
        iDispVal.Num(iVal);
        iEikonEnv->AlertWin(_L("weeknumbertitle"), iDispVal); 
        }
      else 
        {
        iDispVal.Num(iVal);
        iEikonEnv->AlertWin(_L("weekdays title"), iDispVal); 
        }
      }
    else
      {
      iDispVal.Num(iErrCode);
      iEikonEnv->AlertWin(_L("error"), iDispVal);
      }

Retrieving Calendar alarm sound file:

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

Retrieving Calendar alarm snooze time interval in minutes:

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

Setting Calendar alarm snooze time interval in minutes:

iErrCode = iRepository->Get(KCalendarSnoozeTime, iVal);
     if(iErrCode == KErrNone)
       {
       iRepository->Set(KCalendarSnoozeTime, (iVal+1)); 
       }
     else
       {
       iDispVal.Num(iErrCode) ;
       iEikonEnv->AlertWin(_L("error"), iDispVal);
       }
Related Discussions
Thread Thread Starter Forum Replies Last Post
Series 60 - accessing SIM cards yeksoon General Symbian C++ 1 2003-05-07 13:41
Series 60 - accessing SIM cards yeksoon OMA DM/DS/CP 1 2003-05-07 13:41
Calander - Note: Invalid sena_a General Symbian C++ 0 2002-12-06 13:00
Multiple Calendar db chia_84 Python 1 2008-04-09 19:14
can we upgrade nokia in built Calendar? & To Do List? ipskhurana General Discussion 0 2006-04-01 13:06
 
Powered by MediaWiki
RDF Facets: qfnZtypeQUqfnTypeZCommunityContentQ qfnZtypeQUqfnTypeZWebpageQ qfnZtypeQUqfnTypeZWikiContentQ qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX