~ubuntu-branches/ubuntu/saucy/plasma-mobile/saucy

« back to all changes in this revision

Viewing changes to dataengines/alarms/alarmsengine.h

  • Committer: Package Import Robot
  • Author(s): Rohan Garg
  • Date: 2012-12-22 01:58:11 UTC
  • mfrom: (1.1.7)
  • Revision ID: package-import@ubuntu.com-20121222015811-zqq9spgc9e0gin07
Tags: 3.0-0ubuntu1
* New upstream release
* Update install files
* Run wrap-and-sort
* Add plasma-mobile-dev
* Drop plasma-active-keyboardcontainer

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
    Copyright 2012 Marco Martin <mart@kde.org>
 
3
 
 
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.
 
8
 
 
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.
 
13
 
 
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
 
17
    02110-1301, USA.
 
18
*/
 
19
 
 
20
 
 
21
#ifndef ALARMSENGINE_H
 
22
#define ALARMSENGINE_H
 
23
 
 
24
#include <plasma/dataengine.h>
 
25
#include <plasma/service.h>
 
26
 
 
27
#include <Akonadi/Collection>
 
28
#include <Akonadi/Item>
 
29
 
 
30
#include <kalarmcal/kaevent.h>
 
31
 
 
32
class CalendarCreator;
 
33
 
 
34
class KJob;
 
35
 
 
36
class AlarmsEngine : public Plasma::DataEngine
 
37
{
 
38
    Q_OBJECT
 
39
 
 
40
public:
 
41
    AlarmsEngine(QObject* parent, const QVariantList& args);
 
42
    ~AlarmsEngine();
 
43
 
 
44
    Plasma::Service *serviceForSource(const QString &source);
 
45
 
 
46
protected:
 
47
    void createContainer(const KAlarmCal::KAEvent &event);
 
48
 
 
49
protected Q_SLOTS:
 
50
    void calendarCreated(CalendarCreator *creator);
 
51
    void collectionChanged(Akonadi::Collection,QSet<QByteArray>);
 
52
    void collectionRemoved(Akonadi::Collection);
 
53
    void itemAdded(Akonadi::Item, Akonadi::Collection);
 
54
    void itemChanged(Akonadi::Item item,QSet<QByteArray>);
 
55
    void itemRemoved(Akonadi::Item item);
 
56
    void fetchAlarmsCollectionsDone(KJob* job);
 
57
    void fetchAlarmsCollectionDone(KJob* job);
 
58
 
 
59
private:
 
60
    Akonadi::Collection m_collection;
 
61
    QWeakPointer<Plasma::Service> m_service;
 
62
    int m_collectionJobs;
 
63
};
 
64
 
 
65
#endif