Akonadi

servermanager.h
1 /*
2  Copyright (c) 2008 Volker Krause <[email protected]>
3 
4  This library is free software; you can redistribute it and/or modify it
5  under the terms of the GNU Library General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or (at your
7  option) any later version.
8 
9  This library is distributed in the hope that it will be useful, but WITHOUT
10  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12  License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to the
16  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17  02110-1301, USA.
18 */
19 
20 #ifndef AKONADI_SERVERMANAGER_H
21 #define AKONADI_SERVERMANAGER_H
22 
23 #include "akonadicore_export.h"
24 
25 #include <QObject>
26 #include <QMetaType>
27 
28 namespace Akonadi
29 {
30 
31 class ServerManagerPrivate;
32 
43 class AKONADICORE_EXPORT ServerManager : public QObject
44 {
45  Q_OBJECT
46 public:
51  enum State {
57  Upgrading
58  };
59 
67  static bool start();
68 
76  static bool stop();
77 
83  static void showSelfTestDialog(QWidget *parent);
84 
90  Q_REQUIRED_RESULT static bool isRunning();
91 
96  Q_REQUIRED_RESULT static State state();
97 
107  Q_REQUIRED_RESULT static QString brokenReason();
108 
115  Q_REQUIRED_RESULT static QString instanceIdentifier();
116 
121  Q_REQUIRED_RESULT static bool hasInstanceIdentifier();
122 
127  enum ServiceType {
128  Server,
129  Control,
130  ControlLock,
131  UpgradeIndicator
132  };
133 
141  static QString serviceName(ServiceType serviceType);
142 
148  Agent,
149  Resource,
150  Preprocessor
151  };
152 
160  Q_REQUIRED_RESULT static QString agentServiceName(ServiceAgentType agentType, const QString &identifier);
161 
168  Q_REQUIRED_RESULT static QString addNamespace(const QString &string);
169 
174  static ServerManager *self();
175 
176  enum OpenMode {
177  ReadOnly,
178  ReadWrite
179  };
184  Q_REQUIRED_RESULT static QString serverConfigFilePath(OpenMode openMode);
185 
190  Q_REQUIRED_RESULT static QString agentConfigFilePath(const QString &identifier);
191 
209  Q_REQUIRED_RESULT static uint generation();
210 
211 Q_SIGNALS:
215  void started();
216 
220  void stopped();
221 
227  void stateChanged(Akonadi::ServerManager::State state);
228 
229 private:
230  //@cond PRIVATE
231  friend class ServerManagerPrivate;
232  ServerManager(ServerManagerPrivate *dd);
233  ServerManagerPrivate *const d;
234  //@endcond
235 };
236 
237 }
238 
239 Q_DECLARE_METATYPE(Akonadi::ServerManager::State)
240 
241 #endif
ServiceAgentType
Known agent types.
Provides methods to control the Akonadi server process.
Definition: control.h:64
Provides methods to control the Akonadi server process.
Definition: servermanager.h:43
Server is shutting down.
Definition: servermanager.h:55
Server is not running, could be no one started it yet or it failed to start.
Definition: servermanager.h:52
Server was started but is not yet running.
Definition: servermanager.h:53
Server is running and operational.
Definition: servermanager.h:54
Helper integration between Akonadi and Qt.
ServiceType
Types of known D-Bus services.
State
Enum for the various states the server can be in.
Definition: servermanager.h:51
Server is not operational and an error has been detected.
Definition: servermanager.h:56
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Thu Jun 4 2020 23:08:43 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.