2
Copyright (c) 2007 Brad Hards <bradh@frogmouth.net>
4
Significant amounts of this code adapted from the openchange client utility,
5
which is Copyright (C) Julien Kerihuel 2007 <j.kerihuel@openchange.org>.
7
This program is free software; you can redistribute it and/or modify it
8
under the terms of the GNU General Public License as published by
9
the Free Software Foundation; either version 2 of the License, or (at your
10
option) any later version.
12
This program is distributed in the hope that it will be useful, but WITHOUT
13
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
15
License for more details.
17
You should have received a copy of the GNU General Public License
18
along with this program; if not, write to the Free Software
19
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
26
#include <akonadi/resourcebase.h>
28
#include <libmapi++/libmapi++.h>
30
class OCResource : public Akonadi::ResourceBase, public Akonadi::AgentBase::Observer
35
OCResource( const QString &id );
39
virtual void configure( WId windowId );
42
void retrieveCollections();
43
void retrieveItems( const Akonadi::Collection &col );
44
bool retrieveItem( const Akonadi::Item &item, const QSet<QByteArray> &parts );
47
virtual void aboutToQuit();
49
virtual void itemAdded( const Akonadi::Item &item, const Akonadi::Collection &collection );
50
virtual void itemChanged( const Akonadi::Item &item, const QSet<QByteArray> &parts );
51
virtual void itemRemoved( const Akonadi::Item &item );
55
void appendMessageToItem( libmapipp::message & mapi_message, Akonadi::Item & item );
56
void appendContactToItem( libmapipp::message & mapi_message, Akonadi::Item & item );
57
void appendJournalToItem( libmapipp::message & mapi_message, Akonadi::Item & item );
58
void appendEventToItem( libmapipp::message & mapi_message, Akonadi::Item & item );
59
void appendTodoToItem( libmapipp::message & mapi_message, Akonadi::Item & item );
60
QString resolveMapiName(const char* username);
62
QString mimeTypeForFolderType( const char *folderTypeValue ) const;
64
// this method may recurse into itself.
65
void getChildFolders( libmapipp::folder& parentFolder,
66
const Akonadi::Collection &parentCollection,
67
Akonadi::Collection::List &collections);
69
libmapipp::session m_session;
70
QString m_profileDatabase; // TODO: maybe this should be a constructor arg?
72
friend class ProfileDialog;