Akonadi

notificationmanager.h
1 /*
2  SPDX-FileCopyrightText: 2006-2007 Volker Krause <[email protected]>
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>
14 class QTimer;
15 
16 class NotificationManagerTest;
17 class QThreadPool;
18 
19 namespace Akonadi
20 {
21 namespace Server
22 {
23 class NotificationSubscriber;
24 class AggregatedCollectionFetchScope;
25 class AggregatedItemFetchScope;
26 class AggregatedTagFetchScope;
27 
28 class NotificationManager : public AkThread
29 {
30  Q_OBJECT
31 
32 public:
33  explicit NotificationManager(StartMode startMode = AutoStart);
34  ~NotificationManager() override;
35 
36  void forgetSubscriber(NotificationSubscriber *subscriber);
37 
38  AggregatedCollectionFetchScope *collectionFetchScope() const
39  {
40  return mCollectionFetchScope;
41  }
42  AggregatedItemFetchScope *itemFetchScope() const
43  {
44  return mItemFetchScope;
45  }
46  AggregatedTagFetchScope *tagFetchScope() const
47  {
48  return mTagFetchScope;
49  }
50 
51 public Q_SLOTS:
52  void registerConnection(quintptr socketDescriptor);
53 
54  void emitPendingNotifications();
55 
56  void slotNotify(const Akonadi::Protocol::ChangeNotificationList &msgs);
57 
58 protected:
59  void init() override;
60  void quit() override;
61 
62  void emitDebugNotification(const Protocol::ChangeNotificationPtr &ntf, const QVector<QByteArray> &listeners);
63 
64 private:
65  Protocol::ChangeNotificationList mNotifications;
66  QTimer *mTimer = nullptr;
67 
68  QThreadPool *mNotifyThreadPool = nullptr;
70  int mDebugNotifications;
71  AggregatedCollectionFetchScope *mCollectionFetchScope = nullptr;
72  AggregatedItemFetchScope *mItemFetchScope = nullptr;
73  AggregatedTagFetchScope *mTagFetchScope = nullptr;
74 
75  bool mWaiting = false;
76  bool mQuitting = false;
77 
78  friend class NotificationSubscriber;
79  friend class ::NotificationManagerTest;
80 };
81 
82 } // namespace Server
83 } // namespace Akonadi
84 
Q_OBJECTQ_OBJECT
Q_SLOTSQ_SLOTS
QCA_EXPORT void init()
const QList< QKeySequence > & quit()
Helper integration between Akonadi and Qt.
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sat Jul 2 2022 06:41:48 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.