File indexing completed on 2024-04-21 04:00:06

0001 /*
0002     SPDX-FileCopyrightText: 2012-2013 Jan Grulich <jgrulich@redhat.com>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005 */
0006 
0007 #ifndef NETWORKMANAGERQT_SERIAL_SETTING_H
0008 #define NETWORKMANAGERQT_SERIAL_SETTING_H
0009 
0010 #include "setting.h"
0011 #include <networkmanagerqt/networkmanagerqt_export.h>
0012 
0013 #include <QString>
0014 
0015 namespace NetworkManager
0016 {
0017 class SerialSettingPrivate;
0018 
0019 /**
0020  * Represents serial setting
0021  */
0022 class NETWORKMANAGERQT_EXPORT SerialSetting : public Setting
0023 {
0024 public:
0025     typedef QSharedPointer<SerialSetting> Ptr;
0026     typedef QList<Ptr> List;
0027     enum Parity {
0028         NoParity,
0029         EvenParity,
0030         OddParity,
0031     };
0032 
0033     SerialSetting();
0034     explicit SerialSetting(const Ptr &other);
0035     ~SerialSetting() override;
0036 
0037     QString name() const override;
0038 
0039     void setBaud(quint32 speed);
0040     quint32 baud() const;
0041 
0042     void setBits(quint32 byteWidth);
0043     quint32 bits() const;
0044 
0045     void setParity(Parity paritysetting);
0046     Parity parity() const;
0047 
0048     void setStopbits(quint32 number);
0049     quint32 stopbits() const;
0050 
0051     void setSendDelay(quint64 delay);
0052     quint64 sendDelay() const;
0053 
0054     void fromMap(const QVariantMap &setting) override;
0055 
0056     QVariantMap toMap() const override;
0057 
0058 protected:
0059     SerialSettingPrivate *d_ptr;
0060 
0061 private:
0062     Q_DECLARE_PRIVATE(SerialSetting)
0063 };
0064 
0065 NETWORKMANAGERQT_EXPORT QDebug operator<<(QDebug dbg, const SerialSetting &setting);
0066 
0067 }
0068 
0069 #endif // NETWORKMANAGERQT_SERIAL_SETTING_H