A client can connect to the Calendar server using an already existing CCalSession. The CCalSession
objects can then share the same connection to the server.
You must create a session with the Calendar Server using CCalSession::NewL() before accessing a calendar entry. This provides a handle to the calendar file and connects you to the Calendar Server.
// Create a session with the Calendar Server from an existing session CCalSession* CCalSession::NewL(CCalSession& aSessionShared);
You use the same session handle to create other Calendar API objects, such as entry view, category, data exchange, iterator and observers.
The Calendar Server object lets you perform the following functions:
create a file using CCalSession::CreateCalFileL().
_LIT(KFileName,"D:\\MyCalFile"); session->CreateCalFileL(KFileName); //pass the descriptor which hold the filename D:\MyCalFile
Note: If D:\MyCalFile
already exists, then the function leaves.
open a file using CCalSession::OpenL().
_LIT(KFileName,"D:\\MyCalFile"); session->OpenL(KFileName); //pass the filename D:\MyCalFile to be opened
Note: The session object must be destroyed only after all the objects which were created by referencing it have been destroyed.
list the files in the server using CCalSession::ListCalFilesL().
delete a file using CCalSession::DeleteCalFileL().