This is an attempt to unify existing Calendar&Tasks and Contacts resources into
a single Groupware resource. At some point, hopefully, GMail support could be also
added here (see task T646: [Google] Native Gmail resource / Google Groupware and T9422: Automatic setup of Gmail + Google Calendar/Contacts).
Various "subresources" (Calendar, Tasks and Contacts) are implemented as subclasses of GenericHandler,
which is a basic Akonadi::ResourceBase interface. The resource decides which Handler it should call
by looking at mimetypes. Handlers are friends of GoogleResource, so they can call its callbacks
(like itemsRetrieved()) as needed. This was done primarily to separate logic of different subresources;
this might be not the best solution, I'm open to suggestions.
This patch also reworks the settings dialog & relevant code.
The dialog is now using .ui file. The "account picker" is gone, as it's no longer needed;
instead, a single "Configure..." button is added which invokes the auth process.
It also implements "last sync token" API (T647: [KGAPI] Investigate the new "last sync token" in Google API) for calendar incremental updates. Without this API,
event moving between calendars were not handled properly (i.e. event was not removed from the "source" calendar).
Work to be done:
- KAccounts integration. Need to be able to disable various subresources on demand, and determine auth scopes based on that.
- GMail integration. Need to somehow adopt ImapResourceBase / ResourceState scheme, and merge it with current Handlers scheme.
- Add Akonadi::Tag support for Contacts. Tags seem to be more appropriate than having bunch of virtual collections, but this might require some changes inside KAddressBook.