2
Copyright (c) 2003 Cornelius Schumacher <schumacher@kde.org>
3
Copyright (c) 2009 Volker Krause <vkrause@kde.org>
5
This library is free software; you can redistribute it and/or
6
modify it under the terms of the GNU Library General Public
7
License as published by the Free Software Foundation; either
8
version 2 of the License, or (at your option) any later version.
10
This library is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
Library General Public License for more details.
15
You should have received a copy of the GNU Library General Public License
16
along with this library; see the file COPYING.LIB. If not, write to
17
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18
Boston, MA 02110-1301, USA.
21
#ifndef BIRTHDAYSRESOURCE_H
22
#define BIRTHDAYSRESOURCE_H
24
#include <akonadi/resourcebase.h>
32
class BirthdaysResource : public Akonadi::ResourceBase, public Akonadi::AgentBase::Observer
37
BirthdaysResource( const QString &id );
41
virtual void configure( WId windowId );
44
void retrieveCollections();
45
void retrieveItems( const Akonadi::Collection &collection );
46
bool retrieveItem( const Akonadi::Item &item, const QSet<QByteArray> &parts );
49
void addPendingEvent( KCal::Event *event, const QString &remoteId );
51
KCal::Event* createBirthday( const Akonadi::Item &contactItem );
52
KCal::Event* createAnniversary( const Akonadi::Item &contactItem );
53
KCal::Event* createEvent( const QDate &date );
57
void listContacts( const Akonadi::Collection::List &cols );
58
void createEvents( const Akonadi::Item::List &items );
60
void contactChanged( const Akonadi::Item &item );
61
void contactRemoved( const Akonadi::Item &item );
63
void contactRetrieved( KJob *job );
65
Akonadi::Item::List mPendingItems;
66
Akonadi::Item::List mDeletedItems;