[KLF Backend][KLF Tools][KLF Home]
KLatexFormula Project
klfblockprocess.h
Go to the documentation of this file.
1/***************************************************************************
2 * file klfblockprocess.h
3 * This file is part of the KLatexFormula Project.
4 * Copyright (C) 2011 by Philippe Faist
5 * philippe.faist@bluewin.ch
6 * *
7 * This program is free software; you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation; either version 2 of the License, or *
10 * (at your option) any later version. *
11 * *
12 * This program is distributed in the hope that it will be useful, *
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15 * GNU General Public License for more details. *
16 * *
17 * You should have received a copy of the GNU General Public License *
18 * along with this program; if not, write to the *
19 * Free Software Foundation, Inc., *
20 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
21 ***************************************************************************/
22/* $Id$ */
23
24#ifndef KLFBLOCKPROCESS_H
25#define KLFBLOCKPROCESS_H
26
28
30
31
32#include <klfdefs.h>
33
34#include <QProcess>
35#include <QString>
36#include <QByteArray>
37
38
40
57{
58 Q_OBJECT
59public:
64
68 inline void setProcessAppEvents(bool processAppEvents) { mProcessAppEvents = processAppEvents; }
69
75
81
83 bool processNormalExit() const {
84 return QProcess::exitStatus() == NormalExit;
85 }
86
88 int processExitStatus() const {
89 return exitCode();
90 }
91
92 // detect python, shell, etc. interpreters using some standard paths
93 static QString detectInterpreterPath(const QString& interp,
94 const QStringList & addpaths = QStringList());
95
96
108 virtual QString getInterpreterPath(const QString& ext);
109
110public slots:
120 bool startProcess(QStringList cmd, QByteArray stdindata, QStringList env = QStringList());
121
125 bool startProcess(QStringList cmd, QStringList env = QStringList());
126
131
135
136
137private slots:
138 void ourProcExited();
139 void ourProcGotOurStdinData();
140
141private:
142 int _runstatus;
143 bool mProcessAppEvents;
144};
145
146
147
148#endif
QString readStdoutString()
void setProcessAppEvents(bool processAppEvents)
QString readStderrString()
bool processNormalExit() const
int processExitStatus() const
KLFBlockProcess(QObject *parent=0)
QByteArray getAllStderr()
QByteArray getAllStdout()
#define KLF_EXPORT
QObject(QObject *parent)
QObject * parent() const
QProcess(QObject *parent)
int exitCode() const
QProcess::ExitStatus exitStatus() const
QByteArray readAllStandardError()
QByteArray readAllStandardOutput()
QString fromLocal8Bit(const char *str, int size)

Generated by doxygen 1.14.0