1/*
2 SPDX-FileCopyrightText: 2012-2013 Jan Grulich <jgrulich@redhat.com>
3
4 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5*/
6
7#ifndef NETWORKMANAGERQT_SERIAL_SETTING_H
8#define NETWORKMANAGERQT_SERIAL_SETTING_H
9
10#include "setting.h"
11#include <networkmanagerqt/networkmanagerqt_export.h>
12
13#include <QString>
14
15namespace NetworkManager
16{
17class SerialSettingPrivate;
18
19/*!
20 * \class NetworkManager::SerialSetting
21 * \inheaderfile NetworkManagerQt/SerialSetting
22 * \inmodule NetworkManagerQt
23 *
24 * \brief Represents serial setting.
25 */
26class NETWORKMANAGERQT_EXPORT SerialSetting : public Setting
27{
28public:
29 /*!
30 * \typedef NetworkManager::SerialSetting::Ptr
31 */
32 typedef QSharedPointer<SerialSetting> Ptr;
33 /*!
34 * \typedef NetworkManager::SerialSetting::List
35 */
36 typedef QList<Ptr> List;
37 /*!
38 *
39 * \value NoParity
40 * \value EvenParity
41 * \value OddParity
42 */
43 enum Parity {
44 NoParity,
45 EvenParity,
46 OddParity,
47 };
48
49 /*!
50 */
51 SerialSetting();
52 /*!
53 */
54 explicit SerialSetting(const Ptr &other);
55 ~SerialSetting() override;
56
57 QString name() const override;
58
59 /*!
60 */
61 void setBaud(quint32 speed);
62 /*!
63 */
64 quint32 baud() const;
65
66 /*!
67 */
68 void setBits(quint32 byteWidth);
69 /*!
70 */
71 quint32 bits() const;
72
73 /*!
74 */
75 void setParity(Parity paritysetting);
76 /*!
77 */
78 Parity parity() const;
79
80 /*!
81 */
82 void setStopbits(quint32 number);
83 /*!
84 */
85 quint32 stopbits() const;
86
87 /*!
88 */
89 void setSendDelay(quint64 delay);
90 /*!
91 */
92 quint64 sendDelay() const;
93
94 void fromMap(const QVariantMap &setting) override;
95
96 QVariantMap toMap() const override;
97
98protected:
99 SerialSettingPrivate *d_ptr;
100
101private:
102 Q_DECLARE_PRIVATE(SerialSetting)
103};
104
105NETWORKMANAGERQT_EXPORT QDebug operator<<(QDebug dbg, const SerialSetting &setting);
106
107}
108
109#endif // NETWORKMANAGERQT_SERIAL_SETTING_H
110

source code of networkmanager-qt/src/settings/serialsetting.h