Akonadi

intervalcheck.h
1/*
2 SPDX-FileCopyrightText: 2008 Volker Krause <vkrause@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "collectionscheduler.h"
10
11#include <QDateTime>
12#include <QHash>
13
14namespace Akonadi
15{
16namespace Server
17{
18class ItemRetrievalManager;
19
20/**
21 Interval checking thread.
22*/
23class IntervalCheck : public CollectionScheduler
24{
26
27protected:
28 /**
29 * Use AkThread::create() to create and start a new IntervalCheck thread.
30 */
31 explicit IntervalCheck(ItemRetrievalManager &itemRetrievalManager);
32
33public:
34 ~IntervalCheck() override;
35
36 /**
37 * Requests the given collection to be synced.
38 * Executed from any thread, forwards to triggerCollectionXSync() in the
39 * retrieval thread.
40 * A minimum time interval between two sync requests is ensured.
41 */
42 void requestCollectionSync(const Collection &collection);
43
44protected:
45 int collectionScheduleInterval(const Collection &collection) override;
46 bool hasChanged(const Collection &collection, const Collection &changed) override;
47 bool shouldScheduleCollection(const Collection &collection) override;
48
49 void collectionExpired(const Collection &collection) override;
50
51private:
52 QHash<int, QDateTime> mLastChecks;
53 QHash<QString, QDateTime> mLastCollectionTreeSyncs;
54 ItemRetrievalManager &mItemRetrievalManager;
55};
56
57} // namespace Server
58} // namespace Akonadi
Represents a collection of PIM items.
Definition collection.h:62
Interval checking thread.
IntervalCheck(ItemRetrievalManager &itemRetrievalManager)
Use AkThread::create() to create and start a new IntervalCheck thread.
void requestCollectionSync(const Collection &collection)
Requests the given collection to be synced.
Manages and processes item retrieval requests.
Helper integration between Akonadi and Qt.
Q_OBJECTQ_OBJECT
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:31:59 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.