OSDN Git Service

Update license.
[qt-creator-jp/qt-creator-jp.git] / src / plugins / valgrindtoolbase / valgrindengine.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: Nicolas Arnaud-Cormos, KDAB (nicolas.arnaud-cormos@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 VALGRINDENGINE_H
36 #define VALGRINDENGINE_H
37
38 #include "valgrindtoolbase_global.h"
39
40 #include <analyzerbase/ianalyzerengine.h>
41
42 #include <utils/environment.h>
43
44 #include <valgrind/valgrindrunner.h>
45
46 #include <QtCore/QString>
47 #include <QtCore/QByteArray>
48 #include <QtCore/QFutureInterface>
49
50 namespace Analyzer {
51
52 class AnalyzerSettings;
53
54 namespace Internal {
55
56 class VALGRINDTOOLBASE_EXPORT ValgrindEngine : public IAnalyzerEngine
57 {
58     Q_OBJECT
59 public:
60     explicit ValgrindEngine(ProjectExplorer::RunConfiguration *runConfiguration);
61     virtual ~ValgrindEngine();
62
63     void start();
64     void stop();
65
66     QString executable() const;
67
68 protected:
69     virtual QString progressTitle() const = 0;
70     virtual QStringList toolArguments() const = 0;
71     virtual Valgrind::ValgrindRunner *runner() = 0;
72
73     AnalyzerSettings *m_settings;
74     QFutureInterface<void> *m_progress;
75
76 private slots:
77     void runnerFinished();
78
79     void receiveStandardOutput(const QByteArray &);
80     void receiveStandardError(const QByteArray &);
81     void receiveProcessError(const QString &, QProcess::ProcessError);
82
83 private:
84     QString m_workingDirectory;
85     QString m_executable;
86     QString m_commandLineArguments;
87     Utils::Environment m_environment;
88     bool m_isStopping;
89 };
90
91 } // namespace Internal
92 } // namespace Analyzer
93
94 #endif // VALGRINDENGINE_H