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
30 #define snprintf _snprintf
31 #define O_RDONLY _O_RDONLY
32 #define O_WRONLY _O_WRONLY
41 class LyXServerMonitor : public QDialog
45 enum { BUFSIZE = 512 };
54 QString inPipeName() { return pipeNameLE->text() + ".in"; }
56 QString outPipeName() { return pipeNameLE->text() + ".out"; }
62 void showInfo(QString const &);
63 void showNotice(QString const &);
66 void createCmdsGroupBox();
67 void createGridGroupBox();
70 QGroupBox * horizontalGB;
73 QLineEdit * pipeNameLE;
74 QLineEdit * clientNameLE;
75 QLineEdit * commandLE;
76 QLineEdit * argumentLE;
79 QPushButton * openPipesPB;
80 QPushButton * closePipesPB;
81 QPushButton * submitCommandPB;
89 char pipedata[BUFSIZE];
90 ReadPipe * pipethread;
94 class ReadPipe : public QThread
99 ReadPipe(LyXServerMonitor * monitor) : lyxmonitor(monitor) {}
101 void run() { lyxmonitor->readPipe(); }
103 void emitInfo(QString const & msg) { emit info(msg); }
105 void emitNotice(QString const & msg) { emit notice(msg); }
107 void emitClosing() { emit closing(); }
110 void info(QString const &);
111 void notice(QString const &);
115 LyXServerMonitor * lyxmonitor;