diff options
author | Mike McQuaid <mike@mikemcquaid.com> | 2011-03-04 12:15:18 +0100 |
---|---|---|
committer | hjk <qtc-committer@nokia.com> | 2011-03-04 12:33:37 +0100 |
commit | 0cc448f77806e82e697def89ee7a05fbe9e80c4c (patch) | |
tree | 70c168088aa762b68c5891c64fed7ab7db6fdce1 /src/plugins/analyzerbase/analyzerruncontrol.h | |
parent | 3b703588faacbf4ff2e963f6cb6839ece94a90b3 (diff) | |
download | qt-creator-0cc448f77806e82e697def89ee7a05fbe9e80c4c.tar.gz |
Add analyzer base plugin.
Merge-request: 260
Reviewed-by: hjk <qtc-committer@nokia.com>
Diffstat (limited to 'src/plugins/analyzerbase/analyzerruncontrol.h')
-rw-r--r-- | src/plugins/analyzerbase/analyzerruncontrol.h | 113 |
1 files changed, 113 insertions, 0 deletions
diff --git a/src/plugins/analyzerbase/analyzerruncontrol.h b/src/plugins/analyzerbase/analyzerruncontrol.h new file mode 100644 index 0000000000..b3948f6103 --- /dev/null +++ b/src/plugins/analyzerbase/analyzerruncontrol.h @@ -0,0 +1,113 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies). +** +** Author: Andreas Hartmetz, KDAB (andreas.hartmetz@kdab.com) +** +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** No Commercial Usage +** +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +**************************************************************************/ + +#ifndef ANALYZERRUNCONTROL_H +#define ANALYZERRUNCONTROL_H + +#include "analyzerconstants.h" + +#include <valgrind/xmlprotocol/parser.h> + +#include <projectexplorer/runconfiguration.h> +#include <projectexplorer/task.h> + +#include <QtCore/QScopedPointer> + +namespace Analyzer { + +class IAnalyzerEngine; + +namespace Internal { + +class AnalyzerRunControl; + +class AnalyzerRunControlFactory: public ProjectExplorer::IRunControlFactory +{ + Q_OBJECT + +public: + AnalyzerRunControlFactory(QObject *parent = 0); + + typedef ProjectExplorer::RunConfiguration RunConfiguration; + typedef ProjectExplorer::RunControl RunControl; + + // virtuals from IRunControlFactory + bool canRun(RunConfiguration *runConfiguration, const QString &mode) const; + RunControl *create(RunConfiguration *runConfiguration, const QString &mode); + QString displayName() const; + + ProjectExplorer::IRunConfigurationAspect *createRunConfigurationAspect(); + ProjectExplorer::RunConfigWidget *createConfigurationWidget(RunConfiguration *runConfiguration); + +signals: + void runControlCreated(AnalyzerRunControl *); +}; + + +class AnalyzerRunControl: public ProjectExplorer::RunControl +{ + Q_OBJECT + +public: + typedef ProjectExplorer::RunConfiguration RunConfiguration; + // the constructor is likely to gain more arguments later + explicit AnalyzerRunControl(RunConfiguration *runConfiguration); + ~AnalyzerRunControl(); + + // pure virtuals from ProjectExplorer::RunControl + void start(); + StopResult stop(); + bool isRunning() const; + QString displayName() const; + +private slots: + void receiveStandardOutput(const QString &); + void receiveStandardError(const QString &); + + void addTask(ProjectExplorer::Task::TaskType type, const QString &description, + const QString &file, int line); + + void engineFinished(); + +private: + bool m_isRunning; + IAnalyzerEngine *m_engine; +}; + + +} // namespace Internal +} // namespace Analyzer + +#endif // ANALYZERRUNCONTROL_H |