Akonadi

agentconfigurationfactorybase.h
1 /*
2  SPDX-FileCopyrightText: 2018 Daniel Vr├ítil <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #pragma once
8 
9 #include "akonadicore_export.h"
10 
11 #include <KSharedConfig>
12 #include <QObject>
13 
14 namespace Akonadi
15 {
16 class AgentConfigurationBase;
17 class AKONADICORE_EXPORT AgentConfigurationFactoryBase : public QObject
18 {
19  Q_OBJECT
20 public:
21  explicit AgentConfigurationFactoryBase(QObject *parent = nullptr);
22  ~AgentConfigurationFactoryBase() override = default;
23 
24  virtual AgentConfigurationBase *create(const KSharedConfigPtr &config, QWidget *parent, const QVariantList &args) const = 0;
25 };
26 
27 }
28 
29 #define AKONADI_AGENTCONFIG_FACTORY(FactoryName, metadata, ClassName) \
30  class FactoryName : public Akonadi::AgentConfigurationFactoryBase \
31  { \
32  Q_OBJECT \
33  Q_PLUGIN_METADATA(IID "org.freedesktop.Akonadi.AgentConfig" FILE metadata) \
34  public: \
35  FactoryName(QObject *parent = nullptr) \
36  : Akonadi::AgentConfigurationFactoryBase(parent) \
37  { \
38  } \
39  Akonadi::AgentConfigurationBase *create(const KSharedConfigPtr &config, QWidget *parent, const QVariantList &args) const override \
40  { \
41  return new ClassName(config, parent, args); \
42  } \
43  };
44 
QAction * create(StandardGameAction id, const QObject *recvr, const char *slot, QObject *parent)
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.