2 * \file server_monitor.h
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Enrico Forestieri
8 * Full author contact details are available in file CREDITS.
11 #ifndef SERVER_MONITOR_H
12 #define SERVER_MONITOR_H
29 #define snprintf _snprintf
30 #define O_RDONLY _O_RDONLY
31 #define O_WRONLY _O_WRONLY
40 class LyXServerMonitor : public QDialog
44 enum { BUFSIZE = 512 };
53 QString inPipeName() { return pipeNameLE->text() + ".in"; }
55 QString outPipeName() { return pipeNameLE->text() + ".out"; }
61 void showInfo(QString const &);
62 void showNotice(QString const &);
65 void createCmdsGroupBox();
66 void createGridGroupBox();
69 QGroupBox * horizontalGB;
72 QLineEdit * pipeNameLE;
73 QLineEdit * clientNameLE;
74 QLineEdit * commandLE;
75 QLineEdit * argumentLE;
78 QPushButton * openPipesPB;
79 QPushButton * closePipesPB;
80 QPushButton * submitCommandPB;
88 char pipedata[BUFSIZE];
89 ReadPipe * pipethread;
93 class ReadPipe : public QThread
98 ReadPipe(LyXServerMonitor * monitor) : lyxmonitor(monitor) {}
100 void run() { lyxmonitor->readPipe(); }
102 void emitInfo(QString const & msg) { emit info(msg); }
104 void emitNotice(QString const & msg) { emit notice(msg); }
106 void emitClosing() { emit closing(); }
109 void info(QString const &);
110 void notice(QString const &);
114 LyXServerMonitor * lyxmonitor;