Akonadi

akonadi.h
1/***************************************************************************
2 * SPDX-FileCopyrightText: 2006 Till Adam <adam@kde.org> *
3 * *
4 * SPDX-License-Identifier: LGPL-2.0-or-later *
5 ***************************************************************************/
6
7#pragma once
8
9#include <QList>
10#include <QObject>
11
12#include <memory>
13
15class QSettings;
16
17namespace Akonadi
18{
19namespace Server
20{
21class Connection;
22class ItemRetrievalManager;
23class SearchTaskManager;
24class SearchManager;
25class StorageJanitor;
26class CacheCleaner;
27class IntervalCheck;
28class AkLocalServer;
30class ResourceManager;
31class CollectionStatistics;
32class PreprocessorManager;
33class Tracer;
34class DebugInterface;
35
36class AkonadiServer : public QObject
37{
39
40public:
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 [[nodiscard]] QString serverPath() const;
72
73 /**
74 * Can return a nullptr
75 */
76 NotificationManager *notificationManager();
77
78public Q_SLOTS:
79 /**
80 * Triggers a clean server shutdown.
81 */
82 virtual bool quit();
83
84 virtual bool init();
85
86protected Q_SLOTS:
87 virtual void newCmdConnection(quintptr socketDescriptor);
88
89private Q_SLOTS:
90 void doQuit();
91 void connectionDisconnected();
92
93private:
94 [[nodiscard]] bool startDatabaseProcess();
95 [[nodiscard]] bool createDatabase();
96 void stopDatabaseProcess();
97 bool createServers(QSettings &settings, QSettings &connectionSettings);
98 [[nodiscard]] bool setupDatabase();
99
100protected:
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
Helper integration between Akonadi and Qt.
Q_OBJECTQ_OBJECT
Q_SLOTSQ_SLOTS
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:01:42 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.