QtBackgroundProcess  1.5.2
A Library to create background applications with simple, automated foreground control
globalterminal.h
1 #ifndef QTBACKGROUNDPROCESS_GLOBALTERMINAL_H
2 #define QTBACKGROUNDPROCESS_GLOBALTERMINAL_H
3 
4 #include "QtBackgroundProcess/qtbackgroundprocess_global.h"
5 
6 #include <QtCore/qiodevice.h>
7 #include <QtCore/qpointer.h>
8 
9 namespace QtBackgroundProcess {
10 
11 class App;
12 class Terminal;
13 class GlobalTerminalPrivate;
15 class Q_BACKGROUNDPROCESS_EXPORT GlobalTerminal : public QIODevice
16 {
17  Q_OBJECT
18 
19 public:
21  explicit GlobalTerminal(QObject *parent = nullptr, bool enableBootBuffer = false);
23  ~GlobalTerminal();
24 
26  bool isSequential() const override;
28  bool canReadLine() const override;
29 
30 public Q_SLOTS:
32  void writeLine(const QByteArray &line, bool doFlush = true);
34  void flush();
35 
36 protected:
38  qint64 readData(char *data, qint64 maxlen) override;
40  qint64 writeData(const char *data, qint64 len) override;
41 
42 private Q_SLOTS:
43  bool tryPushBuffer(QList<Terminal*> terms);
44 
45 private:
47 
48  bool open(OpenMode mode) override;
49  void close() override;
50 
51  void pushBuffer(QList<Terminal*> terms);
52  void discardBuffer();
53 };
54 
55 }
56 
57 #endif // QTBACKGROUNDPROCESS_GLOBALTERMINAL_H
A virtual terminal that forwards input to all connected terminals.
The Namespace containing all classes of the QtBackgroundProcess module.
Definition: app.h:13