Akonadi

akonadi.h
1 /***************************************************************************
2  * Copyright (C) 2006 by Till Adam <[email protected]> *
3  * *
4  * This program is free software; you can redistribute it and/or modify *
5  * it under the terms of the GNU Library General Public License as *
6  * published by the Free Software Foundation; either version 2 of the *
7  * License, or (at your option) any later version. *
8  * *
9  * This program is distributed in the hope that it will be useful, *
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12  * GNU General Public License for more details. *
13  * *
14  * You should have received a copy of the GNU Library General Public *
15  * License along with this program; if not, write to the *
16  * Free Software Foundation, Inc., *
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
18  ***************************************************************************/
19 
20 #ifndef AKONADISERVER_H
21 #define AKONADISERVER_H
22 
23 #include <QObject>
24 #include <QVector>
25 
26 #include <memory>
27 
28 class QProcess;
30 class QSettings;
31 
32 namespace Akonadi
33 {
34 namespace Server
35 {
36 
37 class Connection;
38 class ItemRetrievalManager;
39 class SearchTaskManager;
40 class SearchManager;
41 class StorageJanitor;
42 class CacheCleaner;
43 class IntervalCheck;
44 class AkLocalServer;
45 class NotificationManager;
46 class ResourceManager;
47 class CollectionStatistics;
48 class PreprocessorManager;
49 class Tracer;
50 class DebugInterface;
51 
52 class AkonadiServer : public QObject
53 {
54  Q_OBJECT
55 
56 public:
57  explicit AkonadiServer();
58  ~AkonadiServer();
59 
63  CacheCleaner *cacheCleaner();
64 
68  IntervalCheck &intervalChecker();
69 
70  ResourceManager &resourceManager();
71 
72  CollectionStatistics &collectionStatistics();
73 
74  PreprocessorManager &preprocessorManager();
75 
76  SearchTaskManager &agentSearchManager();
77 
78  SearchManager &searchManager();
79 
80  ItemRetrievalManager &itemRetrievalManager();
81 
82  Tracer &tracer();
83 
87  QString serverPath() const;
88 
92  NotificationManager *notificationManager();
93 
94 public Q_SLOTS:
98  virtual bool quit();
99 
100  virtual bool init();
101 
102 protected Q_SLOTS:
103  virtual void newCmdConnection(quintptr socketDescriptor);
104 
105 private Q_SLOTS:
106  void doQuit();
107  void connectionDisconnected();
108 
109 private:
110  bool startDatabaseProcess();
111  bool createDatabase();
112  void stopDatabaseProcess();
113  bool createServers(QSettings &settings, QSettings &connectionSettings);
114  bool setupDatabase();
115  uint userId() const;
116 
117 protected:
118  std::unique_ptr<QDBusServiceWatcher> mControlWatcher;
119 
120  std::unique_ptr<AkLocalServer> mCmdServer;
121  std::unique_ptr<AkLocalServer> mNtfServer;
122 
123  std::unique_ptr<ResourceManager> mResourceManager;
124  std::unique_ptr<DebugInterface> mDebugInterface;
125  std::unique_ptr<CollectionStatistics> mCollectionStats;
126  std::unique_ptr<PreprocessorManager> mPreprocessorManager;
127  std::unique_ptr<NotificationManager> mNotificationManager;
128  std::unique_ptr<CacheCleaner> mCacheCleaner;
129  std::unique_ptr<IntervalCheck> mIntervalCheck;
130  std::unique_ptr<StorageJanitor> mStorageJanitor;
131  std::unique_ptr<ItemRetrievalManager> mItemRetrieval;
132  std::unique_ptr<SearchTaskManager> mAgentSearchManager;
133  std::unique_ptr<SearchManager> mSearchManager;
134  std::unique_ptr<Tracer> mTracer;
135 
136  std::vector<std::unique_ptr<Connection>> mConnections;
137  bool mAlreadyShutdown = false;
138 };
139 
140 } // namespace Server
141 } // namespace Akonadi
142 #endif
Q_OBJECTQ_OBJECT
QCA_EXPORT void init()
KDEGAMES_EXPORT QAction * quit(const QObject *recvr, const char *slot, QObject *parent)
Helper integration between Akonadi and Qt.
Q_SLOTSQ_SLOTS
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Fri Jun 5 2020 23:08:53 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.