Akonadi

agentserver.h
1 /*
2  SPDX-FileCopyrightText: 2010 Volker Krause <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #pragma once
8 
9 #include "agentpluginloader.h"
10 
11 #include <QHash>
12 #include <QObject>
13 #include <QQueue>
14 
15 namespace Akonadi
16 {
17 class AgentThread;
18 
19 class AgentServer : public QObject
20 {
21  Q_OBJECT
22  Q_CLASSINFO("D-Bus Interface", "org.freedesktop.Akonadi.AgentServer")
23 
24  using ConfigureInfo = QPair<QString, qlonglong>;
25 
26 public:
27  explicit AgentServer(QObject *parent = nullptr);
28  ~AgentServer() override;
29 
30 public Q_SLOTS:
31  Q_SCRIPTABLE void agentInstanceConfigure(const QString &identifier, qlonglong windowId);
32  Q_SCRIPTABLE bool started(const QString &identifier) const;
33  Q_SCRIPTABLE void startAgent(const QString &identifier, const QString &typeIdentifier, const QString &fileName);
34  Q_SCRIPTABLE void stopAgent(const QString &identifier);
35  Q_SCRIPTABLE void quit();
36 
37 private Q_SLOTS:
38  void processConfigureRequest();
39 
40 private:
41  QHash<QString, AgentThread *> m_agents;
42  QQueue<ConfigureInfo> m_configureQueue;
43  AgentPluginLoader m_agentLoader;
44  bool m_processingConfigureRequests = false;
45  bool m_quiting = false;
46 };
47 
48 }
49 
Q_OBJECTQ_OBJECT
Q_CLASSINFO(Name, Value)
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.