Changeset View
Changeset View
Standalone View
Standalone View
resources/google-groupware/calendarhandler.h
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | Copyright (C) 2011-2013 Daniel Vrátil <dvratil@redhat.com> | ||||
3 | 2020 Igor Pobiko <igor.poboiko@gmail.com> | ||||
4 | | ||||
5 | This program is free software: you can redistribute it and/or modify | ||||
6 | it under the terms of the GNU General Public License as published by | ||||
7 | the Free Software Foundation, either version 3 of the License, or | ||||
8 | (at your option) any later version. | ||||
9 | | ||||
10 | This program 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 | ||||
13 | GNU General Public License for more details. | ||||
14 | | ||||
15 | You should have received a copy of the GNU General Public License | ||||
16 | along with this program. If not, see <https://www.gnu.org/licenses/>. | ||||
17 | */ | ||||
18 | | ||||
19 | #ifndef CALENDARHANDLER_H | ||||
20 | #define CALENDARHANDLER_H | ||||
21 | | ||||
22 | #include "generichandler.h" | ||||
23 | #include <QObject> | ||||
24 | #include <QSharedPointer> | ||||
25 | | ||||
26 | class CalendarHandler : public GenericHandler | ||||
27 | { | ||||
28 | Q_OBJECT | ||||
29 | public: | ||||
30 | typedef QSharedPointer<CalendarHandler> Ptr; | ||||
31 | | ||||
32 | using GenericHandler::GenericHandler; | ||||
33 | | ||||
34 | QString mimetype() override; | ||||
35 | bool canPerformTask(const Akonadi::Item &item) override; | ||||
36 | | ||||
37 | void retrieveCollections() override; | ||||
38 | void retrieveItems(const Akonadi::Collection &collection) override; | ||||
39 | | ||||
40 | void itemAdded(const Akonadi::Item &item, const Akonadi::Collection &collection) override; | ||||
41 | void itemChanged(const Akonadi::Item &item, const QSet< QByteArray > &partIdentifiers) override; | ||||
42 | void itemsRemoved(const Akonadi::Item::List &items) override; | ||||
43 | void itemsMoved(const Akonadi::Item::List &items, const Akonadi::Collection &collectionSource, const Akonadi::Collection &collectionDestination) override; | ||||
44 | | ||||
45 | void collectionAdded(const Akonadi::Collection &collection, const Akonadi::Collection &parent) override; | ||||
46 | void collectionChanged(const Akonadi::Collection &collection) override; | ||||
47 | void collectionRemoved(const Akonadi::Collection &collection) override; | ||||
48 | // FreeBusy | ||||
49 | QDateTime lastCacheUpdate() const; | ||||
50 | void canHandleFreeBusy(const QString &email) const; | ||||
51 | void retrieveFreeBusy(const QString &email, const QDateTime &start, const QDateTime &end); | ||||
52 | private Q_SLOTS: | ||||
53 | void slotCollectionsRetrieved(KGAPI2::Job *job); | ||||
54 | void slotItemsRetrieved(KGAPI2::Job *job); | ||||
55 | private: | ||||
56 | void setupCollection(Akonadi::Collection &collection, const KGAPI2::CalendarPtr &group); | ||||
57 | }; | ||||
58 | | ||||
59 | #endif // CALENDARHANDLER_H |