2
Copyright (c) 2009 Tobias Koenig <tokoe@kde.org>
4
This library is free software; you can redistribute it and/or modify it
5
under the terms of the GNU Library General Public License as published by
6
the Free Software Foundation; either version 2 of the License, or (at your
7
option) any later version.
9
This library is distributed in the hope that it will be useful, but WITHOUT
10
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12
License for more details.
14
You should have received a copy of the GNU Library General Public License
15
along with this library; see the file COPYING.LIB. If not, write to the
16
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20
#ifndef CONTACTSRESOURCE_H
21
#define CONTACTSRESOURCE_H
23
#include <akonadi/resourcebase.h>
25
#include <kabc/addressee.h>
26
#include <kabc/contactgroup.h>
27
#include <kabc/contactgrouptool.h>
28
#include <kabc/vcardconverter.h>
32
class ContactsResource : public Akonadi::ResourceBase, public Akonadi::AgentBase::Observer
37
ContactsResource( const QString &id );
41
virtual void configure( WId windowId );
42
virtual void aboutToQuit();
45
void retrieveCollections();
46
void retrieveItems( const Akonadi::Collection &collection );
47
bool retrieveItem( const Akonadi::Item &item, const QSet<QByteArray> &parts );
50
virtual void itemAdded( const Akonadi::Item &item, const Akonadi::Collection &collection );
51
virtual void itemChanged( const Akonadi::Item &item, const QSet<QByteArray> &parts );
52
virtual void itemRemoved( const Akonadi::Item &item );
54
virtual void collectionAdded( const Akonadi::Collection &collection, const Akonadi::Collection &parent );
55
virtual void collectionChanged( const Akonadi::Collection &collection );
56
virtual void collectionRemoved( const Akonadi::Collection &collection );
59
Akonadi::Collection::List createCollectionsForDirectory( const QDir &parentDirectory,
60
const Akonadi::Collection &parentCollection ) const;
61
QString baseDirectoryPath() const;
62
void initializeDirectory( const QString &path ) const;
63
Akonadi::Collection::Rights supportedRights() const;
64
QString directoryForCollection( const Akonadi::Collection& collection ) const;
67
QStringList mSupportedMimeTypes;