MailTransport

transportcombobox.h
1/*
2 SPDX-FileCopyrightText: 2006-2007 Volker Krause <vkrause@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "mailtransport_export.h"
10#include "transport.h"
11#include "transportbase.h"
12
13#include <QComboBox>
14
15#include <memory>
16
17class TransportComboBoxPrivate;
18
19namespace MailTransport
20{
21/**
22 A combo-box for selecting a mail transport.
23 It is updated automatically when transports are added, changed, or removed.
24*/
25class MAILTRANSPORT_EXPORT TransportComboBox : public QComboBox
26{
27 Q_OBJECT
28public:
29 /**
30 Creates a new mail transport selection combo box.
31 @param parent The paren widget.
32 */
33 explicit TransportComboBox(QWidget *parent = nullptr);
34
35 ~TransportComboBox() override;
36
37 /**
38 Returns identifier of the currently selected mail transport.
39 */
40 [[nodiscard]] int currentTransportId() const;
41
42 /**
43 Selects the given transport.
44 @param transportId The transport identifier.
45 @return return true if we success to find transportId
46 */
47 bool setCurrentTransport(int transportId);
48
49 /**
50 Returns the type of the selected transport.
51 */
52 [[nodiscard]] QString transportType() const;
53
54Q_SIGNALS:
55 void transportRemoved(Transport::Id id, const QString &name);
56
57protected:
58 void setTransportList(const QList<int> &transportList);
59
60public Q_SLOTS:
61 /**
62 * @since 4.11
63 */
64 void updateComboboxList();
65
66private:
67 std::unique_ptr<TransportComboBoxPrivate> const d;
68};
69} // namespace MailTransport
A combo-box for selecting a mail transport.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:12:37 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.