diff options
Diffstat (limited to 'src/serialportinfo.h')
-rw-r--r-- | src/serialportinfo.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/src/serialportinfo.h b/src/serialportinfo.h new file mode 100644 index 00000000..02b93595 --- /dev/null +++ b/src/serialportinfo.h @@ -0,0 +1,53 @@ +/* + License... +*/ + +#ifndef SERIALPORTINFO_H +#define SERIALPORTINFO_H + +#include <QtCore/qlist.h> +#include <QtCore/qscopedpointer.h> + +#include "serialport-global.h" + +QT_BEGIN_NAMESPACE_SERIALPORT + +class SerialPort; +class SerialPortInfoPrivate; +class SerialInfoPrivateDeleter; + +class Q_ADDON_SERIALPORT_EXPORT SerialPortInfo +{ + Q_DECLARE_PRIVATE(SerialPortInfo) +public: + SerialPortInfo(); + SerialPortInfo(const SerialPortInfo &other); + SerialPortInfo(const SerialPort &port); + SerialPortInfo(const QString &name); + ~SerialPortInfo(); + + SerialPortInfo& operator=(const SerialPortInfo &other); + void swap(SerialPortInfo &other); + + QString portName() const; + QString systemLocation() const; + QString description() const; + QString manufacturer() const; + + bool isNull() const; + bool isBusy() const; + bool isValid() const; + + QList<qint32> standardRates() const; + static QList<SerialPortInfo> availablePorts(); + +private: + QScopedPointer<SerialPortInfoPrivate, SerialInfoPrivateDeleter> d_ptr; +}; + +inline bool SerialPortInfo::isNull() const +{ return !d_ptr; } + +QT_END_NAMESPACE_SERIALPORT + +#endif // SERIALPORTINFO_H |