Akonadi

akonadi.h
1 /***************************************************************************
2  * SPDX-FileCopyrightText: 2006 Till Adam <[email protected]> *
3  * *
4  * SPDX-License-Identifier: LGPL-2.0-or-later *
5  ***************************************************************************/
6 
7 #pragma once
8 
9 #include <QObject>
10 #include <QVector>
11 
12 #include <memory>
13 
15 class QSettings;
16 
17 namespace Akonadi
18 {
19 namespace Server
20 {
21 class Connection;
22 class ItemRetrievalManager;
23 class SearchTaskManager;
24 class SearchManager;
25 class StorageJanitor;
26 class CacheCleaner;
27 class IntervalCheck;
28 class AkLocalServer;
30 class ResourceManager;
31 class CollectionStatistics;
32 class PreprocessorManager;
33 class Tracer;
34 class DebugInterface;
35 
36 class AkonadiServer : public QObject
37 {
38  Q_OBJECT
39 
40 public:
41  explicit AkonadiServer();
42  ~AkonadiServer() override;
43 
44  /**
45  * Can return a nullptr
46  */
47  CacheCleaner *cacheCleaner();
48 
49  /**
50  * Returns the IntervalCheck instance. Never nullptr.
51  */
52  IntervalCheck &intervalChecker();
53 
54  ResourceManager &resourceManager();
55 
56  CollectionStatistics &collectionStatistics();
57 
58  PreprocessorManager &preprocessorManager();
59 
60  SearchTaskManager &agentSearchManager();
61 
62  SearchManager &searchManager();
63 
64  ItemRetrievalManager &itemRetrievalManager();
65 
66  Tracer &tracer();
67 
68  /**
69  * Instance-aware server .config directory
70  */
71  QString serverPath() const;
72 
73  /**
74  * Can return a nullptr
75  */
76  NotificationManager *notificationManager();
77 
78 public Q_SLOTS:
79  /**
80  * Triggers a clean server shutdown.
81  */
82  virtual bool quit();
83 
84  virtual bool init();
85 
86 protected Q_SLOTS:
87  virtual void newCmdConnection(quintptr socketDescriptor);
88 
89 private Q_SLOTS:
90  void doQuit();
91  void connectionDisconnected();
92 
93 private:
94  bool startDatabaseProcess();
95  bool createDatabase();
96  void stopDatabaseProcess();
97  bool createServers(QSettings &settings, QSettings &connectionSettings);
98  bool setupDatabase();
99 
100 protected:
101  std::unique_ptr<QDBusServiceWatcher> mControlWatcher;
102 
103  std::unique_ptr<AkLocalServer> mCmdServer;
104  std::unique_ptr<AkLocalServer> mNtfServer;
105 
106  std::unique_ptr<ResourceManager> mResourceManager;
107  std::unique_ptr<DebugInterface> mDebugInterface;
108  std::unique_ptr<CollectionStatistics> mCollectionStats;
109  std::unique_ptr<PreprocessorManager> mPreprocessorManager;
110  std::unique_ptr<NotificationManager> mNotificationManager;
111  std::unique_ptr<CacheCleaner> mCacheCleaner;
112  std::unique_ptr<IntervalCheck> mIntervalCheck;
113  std::unique_ptr<StorageJanitor> mStorageJanitor;
114  std::unique_ptr<ItemRetrievalManager> mItemRetrieval;
115  std::unique_ptr<SearchTaskManager> mAgentSearchManager;
116  std::unique_ptr<SearchManager> mSearchManager;
117  std::unique_ptr<Tracer> mTracer;
118 
119  std::vector<std::unique_ptr<Connection>> mConnections;
120  bool mAlreadyShutdown = false;
121 };
122 
123 } // namespace Server
124 } // namespace Akonadi
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:46 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.