S60 3.2 Calendar Launcher API Specification Document

DN0739892
CONFIDENTIAL

©Nokia 2007
This material, including documentation and any related computer programs, is protected by copyright controlled by Nokia. All rights are reserved. Copying, including reproducing, storing, adapting or translating, any or all of this material requires the prior written consent of Nokia. This material also contains confidential information, which may not be disclosed to others without the prior written consent of Nokia.

Nokia is a registered trademark of Nokia Corporation. S60 and logo is a trademark of Nokia Corporation. Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. Other company and product names mentioned herein may be trademarks or tradenames of their respective owners.

Change History

Version

Date

Status

Description

1.0

11.04.2007

Approved


Table of Contents

Purpose
API description
Use cases
API class structure
Using Calendar Launcher API
Launching Calendar and edit an entry
Launching Calendar and view an entry
Launching Calendar to a view
Error handling
Glossary
Abbreviations
Definitions
References

 


Purpose

The purpose of Calendar Launcher API is to enable applications to launch the S60 Calendar application.

 


API description

Calendar Launcher API is a part of Calendar API, which provides an interface class to operate on the Calendar. This API allows client applications to launch the S60 Calendar application with different options.

Calendar is opened as a standalone application by default, not as embedded. The Calendar application closes after the user closes the viewer or editor. This happens even if the Calendar application was already running in the background before Calendar Launcher API was called.

 


Use cases

The main use cases of the Calendar Launcher API are the following:

  • Launch the calendar and edit an entry
  • Launch the calendar and view an entry
  • Launch the calendar to a view

 


API class structure

The main class of Calendar Launcher API is shown in Figure 1.

Figure 1: Class diagram of CalenLauncher

The class CalenLauncher is used to launch the Calendar application. The argument aFlags in all methods is kept for future use, and it currently defaults to zero.

 


Using Calendar Launcher API

The most common use cases of Calendar Launcher API are described below.

 


Launching Calendar and edit an entry

The client application can launch Calendar into the entry editor. This entry can be a new entry or an existing entry. If the existing entry is a repeating entry, the application can either display the entire series or a single instance of the series. A single instance can be selected by specifying an instance time.

The example below is to demonstrate how to launch the calendar with the entry editor view.

#include "calenlauncher.h"

//launch the calendar and edit a new appointment entry.
//
CalenLauncher::NewEntryL(CCalEntry::EAppt); 
…

//launch the calendar in the entry editor.
//Assumption: uid holds the local id of the entry to be edited.
//
CalenLauncher::EditEntryL(uid); 
…

//launch the calendar in the entry editor, and open an instance of a repeating entry.
//Assumption: uid holds the id of the local entry to be edited, and time holds the instance time.
//
CalenLauncher::EditEntryL(uid, time); 

In the first case, The input argument of the method CalenLauncher::NewEntryL() has the type CCalEntry::TType, which is defined in the header file calentry.h.

And in the second and third cases, the input argument ‘uid’ has the type TCalLocalUid, which is defined in the header file calcommon.h.

 


Launching Calendar and view an entry

The client application can launch Calendar and view an entry. If the existing entry is a repeating entry, the application can either display the entire series or a single instance of the series. A single instance can be selected by specifying an instance time.

The example below is to demonstrate how to launch Calendar with the entry viewer.

#include "calenlauncher.h"

//launch the calendar in the entry viewer.
//Assumption: uid holds the local id of the entry to be opened.
//
CalenLauncher::ViewEntryL(uid); 
…

//launch the calendar in the entry viewer, and open an instance of a repeating entry.
//Assumption: uid holds the local id of the entry to be opened, and time holds the instance time.
//
CalenLauncher::ViewEntryL(uid, time); 

 


Launching Calendar to a view

The client application can launch Calendar to the default view or some specified view, and focused on the specified time. The views are defined in the header file calenlauncher.h. The meanings of the views are listed below:

Label Meaning
TUid KCalMonthViewUid S60 month view uid
TUid KCalWeekViewUid S60 week view uid
TUid KCalDayViewUid S60 day view uid
TUid KCalTodoViewUid S60 todo view uid
TUid KCalDefaultViewUid S60 default view uid

The default view is set by user in the Calendar settings.

The example below is to launch Calendar to the month view:

#include "calenlauncher.h"

//launch the calendar to the month view.
//
CalenLauncher::LaunchL(KCalMonthViewUid); 
…

// launch the calendar to the month view, and focus to the specified time.
// Assumption: time holds the specified time.
//
CalenLauncher::LaunchL(KCalMonthViewUid, time); 

 


Error handling

All methods may leave, for example when running out of memory. Normal Symbian OS error handling practises should be used, including using cleanup stack and TRAP harness.

If the entry requested by the ’uid’ parameter is not found in the database, the methods do not leave. The Calendar application is silently opened and closed in the background under this circumstance. Also if the Calendar application was already running in the background, it is closed.

If the instance time specified does not correspond to a valid instance of a repeating entry or if the entry is not repeating at all, the time parameter is ignored and the Calendar application is still opened.

 


Glossary

 


Abbreviations

None.

 


Definitions

None.

 


References

None.


Back to top