Akonadi

notificationmanager.h
1/*
2 SPDX-FileCopyrightText: 2006-2007 Volker Krause <vkrause@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "akthread.h"
10
11#include "private/protocol_p.h"
12
13#include <QPointer>
14class QTimer;
15
16class NotificationManagerTest;
17class QThreadPool;
18
19namespace Akonadi
20{
21namespace Server
22{
23class NotificationSubscriber;
24class AggregatedCollectionFetchScope;
25class AggregatedItemFetchScope;
26class AggregatedTagFetchScope;
27
28class NotificationManager : public AkThread
29{
31
32protected:
33 /**
34 * Use AkThread::create() to create and start a new NotificationManager thread.
35 */
36 explicit NotificationManager(StartMode startMode = AutoStart);
37
38public:
39 ~NotificationManager() override;
40
41 void forgetSubscriber(NotificationSubscriber *subscriber);
42
43 AggregatedCollectionFetchScope *collectionFetchScope() const
44 {
45 return mCollectionFetchScope;
46 }
47 AggregatedItemFetchScope *itemFetchScope() const
48 {
49 return mItemFetchScope;
50 }
51 AggregatedTagFetchScope *tagFetchScope() const
52 {
53 return mTagFetchScope;
54 }
55
56public Q_SLOTS:
57 void registerConnection(quintptr socketDescriptor);
58
59 void emitPendingNotifications();
60
61 void slotNotify(const Akonadi::Protocol::ChangeNotificationList &msgs);
62
63protected:
64 void init() override;
65 void quit() override;
66
67 void emitDebugNotification(const Protocol::ChangeNotificationPtr &ntf, const QList<QByteArray> &listeners);
68
69private:
70 Protocol::ChangeNotificationList mNotifications;
71 QTimer *mTimer = nullptr;
72
73 QThreadPool *mNotifyThreadPool = nullptr;
75 int mDebugNotifications;
76 AggregatedCollectionFetchScope *mCollectionFetchScope = nullptr;
77 AggregatedItemFetchScope *mItemFetchScope = nullptr;
78 AggregatedTagFetchScope *mTagFetchScope = nullptr;
79
80 bool mWaiting = false;
81 bool mQuitting = false;
82
83 friend class NotificationSubscriber;
84 friend class ::NotificationManagerTest;
85};
86
87} // namespace Server
88} // namespace Akonadi
Helper integration between Akonadi and Qt.
Q_OBJECTQ_OBJECT
Q_SLOTSQ_SLOTS
T qobject_cast(QObject *object)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:13:38 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.