Calendar User

CCalUser represents a calendar user, such as a meeting participant. The class provides attributes and methods that are common to all the calendar users, including the user’s email address, sent-by and common name fields.

You can construct a new calendar user with a specified email address, and optionally a sender, using the factory function CCalUser::NewL().

Attendee

An attendee is a specialised calendar user used for attendees of an event. It is used only in group scheduled entries, and not for a single calendar user. The CCalAttendee class, derived from CCalUser, provides additional methods to store and retrieve an attendee's ROLE, PART-STAT, and RSVP fields.

//Create an attendee
_LIT(KAttendee1Address, "[email protected]");
CCalAttendee* attendee1 = CCalAttendee::NewL(KAttendee1Address);
_LIT(KAttendee1CommonName, "Tom");
attendee1->SetCommonNameL(KAttendee1CommonName);//set common name to Tom
attendee1->SetRoleL(CCalAttendee::EReqParticipant);// set the role of the attendee, other roles Chair and Optional participant
attendee1->SetStatusL(CCalAttendee::EAccepted);// set the status value
// setup the entry
entry->CCalEntry::NewL(CCalEntry::EAppt, guid, CCalEntry::EMethodNone, 0);
entry->AddAttendeeL(attendee1);//add the attendee to the entry

You can get a list of attendees using CCalEntry::AttendeesL(), and delete a specified attendee using CCalEntry::DeleteAttendeeL().

Organizer and phone owner

An entry can optionally have one phone owner and one organizer, both of which are of class CCalUser. The organizer may or may not be an attendee of that entry, but the phone owner must be an attendee. An organizer is a required property for a group scheduled entry.

//Set up the Organizer 
_LIT(KOrganizerAddress1, "[email protected]"); 
CCalUser* organiser1 = CCalUser::NewL(KOrganizerAddress1, KOrganizerSentByA); 
entry->SetOrganizerL(organiser1); //set the organizer for the event
_LIT(KOrganiserCommonName, "Harry"); 
organiser1->SetCommonNameL(KOrganizerCommonName); //set the  common name to Harry 
//Set up the Phone owner for the calendar entry 
_LIT(KPhoneOwnerAddress1, "[email protected]"); 
CCalUser* phOwner1 = CCalUser::NewL(KPhoneOwnerAddress1, KOrganizerSentByB); 
entry->SetPhoneOwnerL(phOwner1); 
_LIT(KPhOwnerCommonName, "Dick"); 
organiser1->SetCommonNameL(KPhOwnerCommonName);//set the common name to Dick