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 | |
15 | namespace NetworkManager |
16 | { |
17 | class SerialSettingPrivate; |
18 | |
19 | /** |
20 | * Represents serial setting |
21 | */ |
22 | class NETWORKMANAGERQT_EXPORT SerialSetting : public Setting |
23 | { |
24 | public: |
25 | typedef QSharedPointer<SerialSetting> Ptr; |
26 | typedef QList<Ptr> List; |
27 | enum Parity { |
28 | NoParity, |
29 | EvenParity, |
30 | OddParity, |
31 | }; |
32 | |
33 | SerialSetting(); |
34 | explicit SerialSetting(const Ptr &other); |
35 | ~SerialSetting() override; |
36 | |
37 | QString name() const override; |
38 | |
39 | void setBaud(quint32 speed); |
40 | quint32 baud() const; |
41 | |
42 | void setBits(quint32 byteWidth); |
43 | quint32 bits() const; |
44 | |
45 | void setParity(Parity paritysetting); |
46 | Parity parity() const; |
47 | |
48 | void setStopbits(quint32 number); |
49 | quint32 stopbits() const; |
50 | |
51 | void setSendDelay(quint64 delay); |
52 | quint64 sendDelay() const; |
53 | |
54 | void fromMap(const QVariantMap &setting) override; |
55 | |
56 | QVariantMap toMap() const override; |
57 | |
58 | protected: |
59 | SerialSettingPrivate *d_ptr; |
60 | |
61 | private: |
62 | Q_DECLARE_PRIVATE(SerialSetting) |
63 | }; |
64 | |
65 | NETWORKMANAGERQT_EXPORT QDebug operator<<(QDebug dbg, const SerialSetting &setting); |
66 | |
67 | } |
68 | |
69 | #endif // NETWORKMANAGERQT_SERIAL_SETTING_H |
70 | |