]> git.lyx.org Git - lyx.git/blob - src/support/SystemcallPrivate.h
add onoff support for "inset-modify changetype xxx" in include inset
[lyx.git] / src / support / SystemcallPrivate.h
1 // -*- C++ -*-
2 /**
3  * \file SystemcallPrivate.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Enrico Forestieri
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef SYSTEMCALLPRIVATE_H
13 #define SYSTEMCALLPRIVATE_H
14
15 #include <QObject>
16
17 class QProcess;
18
19 namespace lyx {
20 namespace support {
21
22 /**
23  * Outputs to the console terminal the line buffered standard output and
24  * error of a spawned process when there is a controlling terminal and 
25  * stdout/stderr have not been redirected.
26  */
27 class ConOut : public QObject
28 {
29         Q_OBJECT
30 public:
31         ConOut(QProcess * proc);
32         ~ConOut();
33
34         /// Should the standard output be displayed?
35         void showout() { showout_ = true; }
36
37         /// Should the standard error be displayed?
38         void showerr() { showerr_ = true; }
39
40 private:
41         /// Pointer to the process to monitor.
42         QProcess * proc_;
43         /// Index to the standard output buffer.
44         size_t outindex_;
45         /// Index to the standard error buffer.
46         size_t errindex_;
47         /// Size of buffers.
48         static size_t const bufsize_ = 200;
49         /// Standard output buffer.
50         char outdata_[bufsize_];
51         /// Standard error buffer.
52         char errdata_[bufsize_];
53         /// 
54         bool showout_;
55         /// 
56         bool showerr_;
57
58 public Q_SLOTS:
59         void stdOut();
60         void stdErr();
61 };
62
63 } // namespace support
64 } // namespace lyx
65
66 #endif // SYSTEMCALLPRIVATE_H