MailTransport

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

KDE's Doxygen guidelines are available online.