MailTransport

transportcombobox.cpp
1/*
2 SPDX-FileCopyrightText: 2006-2007 Volker Krause <vkrause@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#include "transportcombobox.h"
8#include "transportmanager.h"
9
10using namespace MailTransport;
11
12/**
13 * Private class that helps to provide binary compatibility between releases.
14 * @internal
15 */
16class TransportComboBoxPrivate
17{
18public:
19 QList<int> transports;
20};
21
30
31TransportComboBox::~TransportComboBox() = default;
32
34{
35 if (currentIndex() >= 0 && currentIndex() < d->transports.count()) {
36 return d->transports.at(currentIndex());
37 }
38 return -1;
39}
40
42{
43 const int i = d->transports.indexOf(transportId);
44 if (i >= 0 && i < count()) {
46 return true;
47 }
48 return false;
49}
50
55
76
77void TransportComboBox::setTransportList(const QList<int> &transportList)
78{
79 d->transports = transportList;
80}
81
82#include "moc_transportcombobox.cpp"
TransportComboBox(QWidget *parent=nullptr)
Creates a new mail transport selection combo box.
bool setCurrentTransport(int transportId)
Selects the given transport.
int currentTransportId() const
Returns identifier of the currently selected mail transport.
QString transportType() const
Returns the type of the selected transport.
Q_SCRIPTABLE QStringList transportNames() const
Returns a list of transport names.
void transportRemoved(int id, const QString &name)
Emitted when a transport is deleted.
Transport * transportById(Transport::Id id, bool def=true) const
Returns the Transport object with the given id.
Q_SCRIPTABLE void transportsChanged()
Emitted when transport settings have changed (by this or any other TransportManager instance).
static TransportManager * self()
Returns the TransportManager instance.
Q_SCRIPTABLE int defaultTransportId() const
Returns the default transport identifier.
Q_SCRIPTABLE QList< int > transportIds() const
Returns a list of transport identifiers.
void addItems(const QStringList &texts)
void clear()
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
T qobject_cast(QObject *object)
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.