Akonadi

agentthread.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 <QThread>
10 
11 namespace Akonadi
12 {
13 /**
14  * @short A class that encapsulates an agent instance inside a thread.
15  */
16 class AgentThread : public QThread
17 {
18  Q_OBJECT
19 
20 public:
21  /**
22  * Creates a new agent thread.
23  *
24  * @param identifier The unique identifier for this agent
25  * @param factory The factory object that creates the agent instance.
26  * @param parent The parent object.
27  */
28  AgentThread(const QString &identifier, QObject *factory, QObject *parent = nullptr);
29 
30  /**
31  * Configures the agent.
32  *
33  * @param windowId The parent window id for the config dialog.
34  */
35  void configure(qlonglong windowId);
36 
37 protected:
38  void run() override;
39 
40 private:
41  const QString m_identifier;
42  QObject *const m_factory;
43  QObject *m_instance = nullptr;
44 };
45 
46 }
Q_OBJECTQ_OBJECT
void configure(qlonglong windowId)
Configures the agent.
Definition: agentthread.cpp:39
AgentThread(const QString &identifier, QObject *factory, QObject *parent=nullptr)
Creates a new agent thread.
Definition: agentthread.cpp:15
A class that encapsulates an agent instance inside a thread.
Definition: agentthread.h:16
QObject * parent() const const
Helper integration between Akonadi and Qt.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Wed Jun 7 2023 03:53:30 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.