Usecases for some common operations with the Libical Calendar Api
(LCA)

Note that the calendar object, of class LCACalendar, is constructed
with a link to an LCAStore object. LCAStore is a generalize storage
for components, such as a flat file, a database, or a CAP server. When
an LCAMessage is stored in a calendar, LCAMessage::FindMatch() will
search for a component that matches the message ( same UID,
RECURRENCE-ID, etc ) in the calendars store.

( Note: After working with these usecases for a while, I think that
there should be an object or class to encapsulate most of these
operations, like LCAProcessor. It would handle removing messages and
events from lists, finding matches, etc. The caller would subclass
from it to add on to its functionality.  )

-- Process incoming request message for a new event.

1) Outside code(Caller) recieves an iTIP message, and identifies
sender and UPN of recipient.

2) Caller creates LCAMessage: LCAMessage()

3) Caller locates appropriate calendar for UPN

4) Caller inserts message: calendar.MessageSet().insert(message);

5) Caller requests message to locate match. Caller supplies storage
set: message.FindMatch(set). Match wil return 0, because there is no
match for a new event.

6) Caller determines type of message: enum LCAMessage::Type type =
message.Type(). Type is NEW_EVENT

The caller should then update the display of all active messages to
the user, by iterating through calendar.MessageSet() ( it is a
multiset) When the user selects a request message to process:

7) Caller displays event to user. 

7a) If user approves, Caller books event: calendar.BookEvent(message).
This removes the message from the message set, changes the method to
CREATED, and puts it into the event set. Then caller makes a reply
with LCAMessage& reply = message.MakeAcceptReply(). Caller sends reply
to organizer.

7b) If user rejects meeting proposal, Caller makes rejection reply
with reply = message.MakeDeclineReply() and adds user's comments with
reply.Event().Comment() = "comment"; Caller sends the event to the
organizer.

-- Process incoming reply message

Steps 1-6 as above. The type of message is ACCEPT_REPLY

7) Caller gets sender of reply with string sender = message.Sender();

8) Caller looks up sender of message as an attendee of the original
proposal: itr = message.Match().AttendeeSet().find(sender)

9) Caller changes the PARTSTAT of the sender: itr->Status() = ACCEPTED.

10) Caller displays sender's acceptance of meeting

11) Caller removes the message from the calendar's message queue. 


-- Process incoming cancel message

Steps 1-6 as above. The type of message is CANCEL. 

7) Caller locates matched event with message.FindMatch()

8) Caller removes matched event and message from the calendar. 

-- Generate new request message


-- Generate new reply message

-- Get all events on a given day

-- Get all alarms for next 30 minutes