~ubuntu-branches/ubuntu/karmic/kdepim/karmic-backports

« back to all changes in this revision

Viewing changes to akonadi/resources/birthdays/birthdaysresource.h

  • Committer: Bazaar Package Importer
  • Author(s): Christian Mangold
  • Date: 2009-07-10 06:34:50 UTC
  • mfrom: (1.1.40 upstream)
  • Revision ID: james.westby@ubuntu.com-20090710063450-neojgew2fh0n3y0u
Tags: 4:4.2.96-0ubuntu1
* New upstream release
* Bump kde build-deps to 4.2.96

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
    Copyright (c) 2003 Cornelius Schumacher <schumacher@kde.org>
3
 
    Copyright (c) 2009 Volker Krause <vkrause@kde.org>
4
 
 
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.
9
 
 
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.
14
 
 
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.
19
 
*/
20
 
 
21
 
#ifndef BIRTHDAYSRESOURCE_H
22
 
#define BIRTHDAYSRESOURCE_H
23
 
 
24
 
#include <akonadi/resourcebase.h>
25
 
 
26
 
namespace KCal {
27
 
class Event;
28
 
}
29
 
 
30
 
class QDate;
31
 
 
32
 
class BirthdaysResource : public Akonadi::ResourceBase, public Akonadi::AgentBase::Observer
33
 
{
34
 
  Q_OBJECT
35
 
 
36
 
  public:
37
 
    BirthdaysResource( const QString &id );
38
 
    ~BirthdaysResource();
39
 
 
40
 
  public Q_SLOTS:
41
 
    virtual void configure( WId windowId );
42
 
 
43
 
  protected:
44
 
    void retrieveCollections();
45
 
    void retrieveItems( const Akonadi::Collection &collection );
46
 
    bool retrieveItem( const Akonadi::Item &item, const QSet<QByteArray> &parts );
47
 
 
48
 
  private:
49
 
    void addPendingEvent( KCal::Event *event, const QString &remoteId );
50
 
 
51
 
    KCal::Event* createBirthday( const Akonadi::Item &contactItem );
52
 
    KCal::Event* createAnniversary( const Akonadi::Item &contactItem );
53
 
    KCal::Event* createEvent( const QDate &date );
54
 
 
55
 
  private slots:
56
 
    void doFullSearch();
57
 
    void listContacts( const Akonadi::Collection::List &cols );
58
 
    void createEvents( const Akonadi::Item::List &items );
59
 
 
60
 
    void contactChanged( const Akonadi::Item &item );
61
 
    void contactRemoved( const Akonadi::Item &item );
62
 
 
63
 
    void contactRetrieved( KJob *job );
64
 
  private:
65
 
    Akonadi::Item::List mPendingItems;
66
 
    Akonadi::Item::List mDeletedItems;
67
 
};
68
 
 
69
 
#endif