Changeset View
Changeset View
Standalone View
Standalone View
resources/google-groupware/contacthandler.h
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | Copyright (C) 2011, 2012 Dan Vratil <dan@progdan.cz> | ||||
3 | 2020 Igor Poboiko <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 | | ||||
20 | #ifndef CONTACTHANDLER_H | ||||
21 | #define CONTACTHANDLER_H | ||||
22 | | ||||
23 | #include "generichandler.h" | ||||
24 | #include <KGAPI/Types> | ||||
25 | #include <QObject> | ||||
26 | | ||||
27 | | ||||
28 | class ContactHandler : public GenericHandler | ||||
29 | { | ||||
30 | Q_OBJECT | ||||
31 | public: | ||||
32 | using GenericHandler::GenericHandler; | ||||
33 | | ||||
34 | QString mimeType() override; | ||||
35 | bool canPerformTask(const Akonadi::Item &item) override; | ||||
36 | bool canPerformTask(const Akonadi::Item::List &items) override; | ||||
37 | | ||||
38 | void retrieveCollections(const Akonadi::Collection &rootCollection) override; | ||||
39 | void retrieveItems(const Akonadi::Collection &collection) override; | ||||
40 | | ||||
41 | void itemAdded(const Akonadi::Item &item, const Akonadi::Collection &collection) override; | ||||
42 | void itemChanged(const Akonadi::Item &item, const QSet< QByteArray > &partIdentifiers) override; | ||||
43 | void itemsRemoved(const Akonadi::Item::List &items) override; | ||||
44 | void itemsMoved(const Akonadi::Item::List &items, const Akonadi::Collection &collectionSource, const Akonadi::Collection &collectionDestination) override; | ||||
45 | void itemsLinked(const Akonadi::Item::List &items, const Akonadi::Collection &collection) override; | ||||
46 | void itemsUnlinked(const Akonadi::Item::List &items, const Akonadi::Collection &collection) override; | ||||
47 | | ||||
48 | void collectionAdded(const Akonadi::Collection &collection, const Akonadi::Collection &parent) override; | ||||
49 | void collectionChanged(const Akonadi::Collection &collection) override; | ||||
50 | void collectionRemoved(const Akonadi::Collection &collection) override; | ||||
51 | private Q_SLOTS: | ||||
52 | void slotItemsRetrieved(KGAPI2::Job *job); | ||||
53 | void slotUpdatePhotosItemsRetrieved(KJob *job); | ||||
54 | void retrieveContactsPhotos(const QVariant &arguments); | ||||
55 | private: | ||||
56 | QString myContactsRemoteId() const; | ||||
57 | void setupCollection(Akonadi::Collection &collection, const KGAPI2::ContactsGroupPtr &group); | ||||
58 | QMap<QString, Akonadi::Collection> m_collections; | ||||
59 | }; | ||||
60 | | ||||
61 | #endif // CONTACTHANDLER_H |