LEGAL DISCLAIMER

Use of this software is entirely at your own risk.  There are no warrantees of any
kind implied, and the author shall not be held liable for any damages whatsoever
resulting from its use.


COPYRIGHT

This code is Copyright (C) 2006 by Richard Kagerer.  It may NOT be used in
commercial products without first obtaining a license from the author.

However, feel free to play with it for experimental purposes, or to use it in your
own free product.

If you publish modifications to this code, please include credit to the original
author.

Don't fret if these terms are too restrictive - chances are this code will be
obsolete within the next few months.


DESCRIPTION

Before the official Google Calendar API came out, I was working on a temporary,
unofficial .NET API for internal use.  It works by simulating user input to
the normal Google Calendar web page (a.k.a. "auto-piloting").  The idea was to
use it in the interim, then plug in the real API when it inevitably came out.

However, the folks at Google work faster than me, and within days of launching
their Calendar product, they launched the API.  That made most of the work
contained herein obsolete.

However, there are still a few things you can do with this code that you can't
do with the official API - namely, retrieving a list of calendars for a user,
creating new calendars, etc.  (As of 24-Apr-2006)

Due to a few requests on the google-calendar-help-dataapi group, I'm posting
this code dump code online.  It's really more of a "proof of concept" than
anything else, and isn't even close to being polished.

Theoretically, the plumbing and coding pattern could be adapted to make
a .NET API to programmatically interact with any web site.  Needless to say,
this is a rather fragile approach (since web pages can change at any time),
but occasionally it's just what is needed.


AUTHOR

Richard Kagerer
sales(at)leapbeyond.com

If you find this code useful, I'd consider it a favour if you'd let me know!


STRUCTURE

A generic class called WebPilot contains code required to load and interact
with a web page.  It is essentially a more friendly wrapper for the
System.Windows.Forms.WebBrowser class.

The GFormBase class is the base for all Google Calendar autopilots, and
contains logic that is shared between all views (e.g. SignOut()).

Several other classes inherit from GFormBase, and are intended to be used
when the Google Calendar application is in a specific state.  For example,
the GFormMyCalendarEdit class is used when the application is showing the
Calendar Details form.

As for naming conventions, I often refer to application state as the current
"view" or "form" displayed, and refer to the classes that inherit from
GFormBase as "adapters", "autopilots" or "webpilots".  Sorry about the
inconsistency.

Run the demo (GCalApiTest.vbproj) for an example.
See the class summaries (where they exist) for more documentation.

Be warned that several functions make use of Application.DoEvents(),
and it's up to you to prevent reentry (e.g. by disabling user input controls
on your form when making calls to the API). 

One last note - all the WebPiloting and GForm* stuff was actually going to be
buried under a more user-friendly layer that would expose simple functions
like "GSession.EnumerateCalendars() as GCalendarCollection" and
"GSession.CreateCalendar() as GCalendar", so that the programmer wouldn't
have to worry about things like which view the application is currently in.