MailTransport

smtpmailtransportplugin.cpp
1/*
2 SPDX-FileCopyrightText: 2017-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#include "smtpmailtransportplugin.h"
8#include "smtpconfigdialog.h"
9#include "smtpjob.h"
10#include <KLocalizedString>
11#include <KPluginFactory>
12#include <QPointer>
13
14K_PLUGIN_CLASS_WITH_JSON(SMTPMailTransportPlugin, "smtpmailtransport.json")
15
16SMTPMailTransportPlugin::SMTPMailTransportPlugin(QObject *parent, const QList<QVariant> &)
17 : MailTransport::TransportAbstractPlugin(parent)
18{
19}
20
21SMTPMailTransportPlugin::~SMTPMailTransportPlugin() = default;
22
23QList<MailTransport::TransportAbstractPluginInfo> SMTPMailTransportPlugin::names() const
24{
26
27 info.name = i18nc("@option SMTP transport", "SMTP");
28 info.description = i18n("An SMTP server on the Internet");
29 info.identifier = QStringLiteral("SMTP");
30 info.isAkonadi = false;
32}
33
34bool SMTPMailTransportPlugin::configureTransport(const QString &identifier, MailTransport::Transport *transport, QWidget *parent)
35{
36 Q_UNUSED(identifier)
37 QPointer<MailTransport::SmtpConfigDialog> transportConfigDialog = new MailTransport::SmtpConfigDialog(transport, parent);
38 transportConfigDialog->setWindowTitle(i18nc("@title:window", "Configure account"));
39 bool okClicked = (transportConfigDialog->exec() == QDialog::Accepted);
40 delete transportConfigDialog;
41 return okClicked;
42}
43
44MailTransport::TransportJob *SMTPMailTransportPlugin::createTransportJob(MailTransport::Transport *t, const QString &identifier)
45{
46 Q_UNUSED(identifier)
47 return new MailTransport::SmtpJob(t, this);
48}
49
50#include "smtpmailtransportplugin.moc"
51
52#include "moc_smtpmailtransportplugin.cpp"
#define K_PLUGIN_CLASS_WITH_JSON(classname, jsonFile)
Mail transport job for SMTP.
Definition smtpjob.h:43
Abstract base class for all mail transport jobs.
Represents the settings of a specific mail transport.
Definition transport.h:33
QString i18nc(const char *context, const char *text, const TYPE &arg...)
QString i18n(const char *text, const TYPE &arg...)
QObject * parent() const const
The TransportAbstractPluginInfo struct.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:07:17 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.