Akonadi

agentconfigurationfactorybase.h
1/*
2 SPDX-FileCopyrightText: 2018 Daniel Vrátil <dvratil@kde.org>
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
14namespace Akonadi
15{
16class AgentConfigurationBase;
17class AKONADICORE_EXPORT AgentConfigurationFactoryBase : public QObject
18{
19 Q_OBJECT
20public:
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 };
Helper integration between Akonadi and Qt.
QAction * create(StandardAction id, const Receiver *recvr, Func slot, QObject *parent, std::optional< Qt::ConnectionType > connectionType=std::nullopt)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:08:29 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.