OSDN Git Service

Update license.
[qt-creator-jp/qt-creator-jp.git] / src / libs / valgrind / valgrindrunner.h
1 /**************************************************************************
2 **
3 ** This file is part of Qt Creator
4 **
5 ** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
6 **
7 ** Author: Milian Wolff, KDAB (milian.wolff@kdab.com)
8 **
9 ** Contact: Nokia Corporation (info@qt.nokia.com)
10 **
11 **
12 ** GNU Lesser General Public License Usage
13 **
14 ** This file may be used under the terms of the GNU Lesser General Public
15 ** License version 2.1 as published by the Free Software Foundation and
16 ** appearing in the file LICENSE.LGPL included in the packaging of this file.
17 ** Please review the following information to ensure the GNU Lesser General
18 ** Public License version 2.1 requirements will be met:
19 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
20 **
21 ** In addition, as a special exception, Nokia gives you certain additional
22 ** rights. These rights are described in the Nokia Qt LGPL Exception
23 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
24 **
25 ** Other Usage
26 **
27 ** Alternatively, this file may be used in accordance with the terms and
28 ** conditions contained in a signed written agreement between you and Nokia.
29 **
30 ** If you have questions regarding the use of this file, please contact
31 ** Nokia at qt-info@nokia.com.
32 **
33 **************************************************************************/
34
35 #ifndef VALGRIND_RUNNER_H
36 #define VALGRIND_RUNNER_H
37
38 #include <QtCore/QProcess>
39
40 #include "valgrind_global.h"
41
42 QT_BEGIN_NAMESPACE
43 class QProcessEnvironment;
44 QT_END_NAMESPACE
45
46 namespace Utils {
47 class Environment;
48 }
49
50 namespace Valgrind {
51
52 class VALGRINDSHARED_EXPORT ValgrindRunner : public QObject
53 {
54     Q_OBJECT
55
56 public:
57     explicit ValgrindRunner(QObject *parent = 0);
58     ~ValgrindRunner();
59
60     QString valgrindExecutable() const;
61     void setValgrindExecutable(const QString &executable);
62     QStringList valgrindArguments() const;
63     void setValgrindArguments(const QStringList &toolArguments);
64     QString debuggeeExecutable() const;
65     void setDebuggeeExecutable(const QString &executable);
66     QString debuggeeArguments() const;
67     void setDebuggeeArguments(const QString &arguments);
68
69     void setWorkingDirectory(const QString &path);
70     QString workingDirectory() const;
71     void setEnvironment(const Utils::Environment &environment);
72     void setProcessChannelMode(QProcess::ProcessChannelMode mode);
73
74     void waitForFinished() const;
75
76     QString errorString() const;
77
78     virtual void start();
79
80     virtual void stop();
81
82 protected:
83     virtual QString tool() const = 0;
84
85     Q_PID lastPid() const;
86
87 signals:
88     void standardOutputReceived(const QByteArray &);
89     void standardErrorReceived(const QByteArray &);
90     void processErrorReceived(const QString &, QProcess::ProcessError);
91     void started();
92     void finished();
93
94 protected slots:
95     virtual void processError(QProcess::ProcessError);
96     virtual void processStarted();
97     virtual void processFinished(int, QProcess::ExitStatus);
98
99 private:
100     Q_DISABLE_COPY(ValgrindRunner);
101     class Private;
102     Private *d;
103 };
104
105 }
106
107 #endif // VALGRIND_RUNNER_H