MailTransport

transportconfigwidget.h
1/*
2 SPDX-FileCopyrightText: 2009 Constantin Berzan <exit3219@gmail.com>
3
4 Based on MailTransport code by:
5 SPDX-FileCopyrightText: 2006-2007 Volker Krause <vkrause@kde.org>
6
7 Based on KMail code by:
8 SPDX-FileCopyrightText: 2001-2002 Michael Haeckel <haeckel@kde.org>
9
10 SPDX-License-Identifier: LGPL-2.0-or-later
11*/
12
13#pragma once
14
15#include "mailtransport_export.h"
16#include <QWidget>
17
18#include <memory>
19
21
22namespace MailTransport
23{
24class Transport;
25class TransportConfigWidgetPrivate;
26
27/**
28 @internal
29
30 Abstract configuration widget for a mail transport. It makes sure that
31 the configured transport has a unique name, and takes care of writing its
32 settings to the config file. If it is a new transport, the caller must
33 still call TransportManager::addTransport() to register the transport.
34
35 Concrete configuration is done in subclasses SMTPConfigWidget.
36
37 To configure a transport from applications, use
38 TransportManager::configureTransport(). You still need to call
39 TransportManager::addTransport() if this is a new transport, not registered
40 with TransportManager.
41
42 @author Constantin Berzan <exit3219@gmail.com>
43 @since 4.4
44*/
45class MAILTRANSPORT_EXPORT TransportConfigWidget : public QWidget
46{
47 Q_OBJECT
48
49public:
50 /**
51 Creates a new mail transport configuration widget for the given
52 Transport object.
53 @param transport The Transport object to configure.
54 @param parent The parent widget.
55 */
56 explicit TransportConfigWidget(Transport *transport, QWidget *parent = nullptr);
57
58 /**
59 Destroys the widget.
60 */
62
63 /**
64 @internal
65 Get the KConfigDialogManager for this widget.
66 */
67 KConfigDialogManager *configManager() const;
68
69public Q_SLOTS:
70 /**
71 Saves the transport's settings.
72
73 The base implementation writes the settings to the config file and makes
74 sure the transport has a unique name. Reimplement in derived classes to
75 save your custom settings, and call the base implementation.
76 */
77 // TODO: do we also want to check for invalid settings?
78 virtual void apply();
79
80protected:
81 std::unique_ptr<TransportConfigWidgetPrivate> const d_ptr;
82 TransportConfigWidget(TransportConfigWidgetPrivate &dd, Transport *transport, QWidget *parent);
83
84private:
85 Q_DECLARE_PRIVATE(TransportConfigWidget)
86
87 void init(Transport *transport);
88};
89} // namespace MailTransport
~TransportConfigWidget() override
Destroys the widget.
Represents the settings of a specific mail transport.
Definition transport.h:33
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:07:33 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.