1 #ifndef QTSERVICE_TERMINAL_H 2 #define QTSERVICE_TERMINAL_H 4 #include <QtCore/qiodevice.h> 5 #include <QtCore/qscopedpointer.h> 7 #include "QtService/qtservice_global.h" 8 #include "QtService/service.h" 12 class TerminalPrivate;
13 class TerminalAwaitablePrivate;
24 Q_PROPERTY(
bool autoDelete READ isAutoDelete WRITE setAutoDelete NOTIFY autoDeleteChanged)
48 void prepare(std::function<
void()> resume);
61 bool isSequential()
const override;
63 void close()
override;
65 bool atEnd()
const override;
67 qint64 bytesAvailable()
const override;
69 qint64 bytesToWrite()
const override;
71 bool canReadLine()
const override;
73 bool waitForReadyRead(
int msecs)
override;
75 bool waitForBytesWritten(
int msecs)
override;
82 bool isAutoDelete()
const;
86 Awaitable awaitChar();
88 Awaitable awaitChars(qint64 num);
90 Awaitable awaitLine();
94 void disconnectTerminal();
99 void requestChars(qint64 num);
104 void writeLine(
const QByteArray &line,
bool flush =
true);
109 void setAutoDelete(
bool autoDelete);
113 void terminalDisconnected();
115 void terminalError(
int errorCode);
118 void autoDeleteChanged(
bool autoDelete);
122 qint64 readData(
char *data, qint64 maxlen)
override;
124 qint64 readLineData(
char *data, qint64 maxlen)
override;
126 qint64 writeData(
const char *data, qint64 len)
override;
131 bool open(OpenMode mode)
override;
136 #endif // QTSERVICE_TERMINAL_H
TerminalMode
The modes a terminal can be in.
The primary namespace of the QtService library.
A helper class to be used with QtCoroutines to await io from a coroutine.
SpecialReads
Special read modes.
Represents a connection to a console terminal connected to the service.