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{
21class TransportActivitiesAbstract;
22/**
23 A combo-box for selecting a mail transport.
24 It is updated automatically when transports are added, changed, or removed.
25*/
26class MAILTRANSPORT_EXPORT TransportComboBox : public QComboBox
27{
28 Q_OBJECT
29public:
30 /**
31 Creates a new mail transport selection combo box.
32 @param parent The paren widget.
33 */
34 explicit TransportComboBox(QWidget *parent = nullptr);
35
36 ~TransportComboBox() override;
37
38 /**
39 Returns identifier of the currently selected mail transport.
40 */
41 [[nodiscard]] int currentTransportId() const;
42
43 /**
44 Selects the given transport.
45 @param transportId The transport identifier.
46 @return return true if we success to find transportId
47 */
48 bool setCurrentTransport(int transportId);
49
50 /**
51 Returns the type of the selected transport.
52 */
53 [[nodiscard]] QString transportType() const;
54
55 /// @since 6.1
56 [[nodiscard]] MailTransport::TransportActivitiesAbstract *transportActivitiesAbstract() const;
57 /// @since 6.1
58 void setTransportActivitiesAbstract(MailTransport::TransportActivitiesAbstract *activitiesAbstract);
59
60 [[nodiscard]] bool enablePlasmaActivities() const;
61 void setEnablePlasmaActivities(bool newEnablePlasmaActivities);
62
63Q_SIGNALS:
64 void transportRemoved(Transport::Id id, const QString &name);
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 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.