×
Namespaces

Variants
Actions

Managing Multiple Calendars in Symbian^3

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Tested with
Devices(s): Tested on Nokia N8
Compatibility
Platform(s): Symbian^3
Article
Keywords: CCalSession, CCalCalendarInfo, CCalEntryView, CCalEntry
Created: User:Kbwiki (20 Oct 2010)
Last edited: hamishwillee (14 Jun 2012)

Contents

Description

With the CCalSession class, multiple calendars can be created on the Symbian^3 Platform. Each calendar can have its own metadata (colour, description, name). Calendar events (appointments, to-dos, reminders) can be managed per each individual calendar file.

Required capabilities

 CAPABILITY	    ReadUserData WriteUserData

Includes

 #include <calsession.h>
#include <calcalendarinfo.h>
#include <CalenInterimUtils2.h>

Solution

 _LIT(KCalDesc,"My Test Calendar");
_LIT(KCalName,"My Calendar");
 
void CCalendar::AddCalendarL()
{
// Create a session to the Calendar Server
CCalSession* calSession = CCalSession::NewL();
CleanupStack::PushL(calSession);
 
// Create an instance of a calendar info class and add some metadata
CCalCalendarInfo* calinfo = CCalCalendarInfo::NewL();
CleanupStack::PushL(calinfo);
 
calinfo->SetEnabled(ETrue);
calinfo->SetColor(KRgbWhite); // Use white color
calinfo->SetDescriptionL(KCalDesc);
calinfo->SetNameL(KCalName);
 
// Create the new calendar file with user defined metadata
TRAPD(errCode,calSession->CreateCalFileL(KCalName,*calinfo));
if (errCode != KErrNone && errCode != KErrAlreadyExists)
{
User::Leave(errCode);
}
 
// Cleanup
CleanupStack::PopAndDestroy(2); // calinfo, calSession
}

See also

Refer to the CalInterim API for instructions on how to create calendar entries.

This page was last modified on 14 June 2012, at 10:54.
45 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.

×