Skip to content
Snippets Groups Projects
debuggerrunner.h 3.14 KiB
Newer Older
/**************************************************************************
con's avatar
con committed
**
** This file is part of Qt Creator
**
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
con's avatar
con committed
**
** Contact: Nokia Corporation (qt-info@nokia.com)
con's avatar
con committed
**
** Commercial Usage
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
** 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.
** If you are unsure which license is appropriate for your use, please
hjk's avatar
hjk committed
** contact the sales department at http://qt.nokia.com/contact.
con's avatar
con committed
**
**************************************************************************/
hjk's avatar
hjk committed

con's avatar
con committed
#ifndef DEBUGGERRUNNER_H
#define DEBUGGERRUNNER_H

con's avatar
con committed
#include <projectexplorer/runconfiguration.h>
dt's avatar
dt committed
#include <projectexplorer/applicationrunconfiguration.h>
con's avatar
con committed

namespace Debugger {
class DebuggerManager;
con's avatar
con committed
class StartData;

class DebuggerRunControlFactory
    : public ProjectExplorer::IRunControlFactory
con's avatar
con committed
{
    Q_OBJECT

public:
    explicit DebuggerRunControlFactory(DebuggerManager *manager);
con's avatar
con committed

    // ProjectExplorer::IRunControlFactory
    bool canRun(ProjectExplorer::RunConfiguration *runConfiguration, const QString &mode) const;
    virtual ProjectExplorer::RunControl *create(ProjectExplorer::RunConfiguration *runConfiguration,
con's avatar
con committed
    virtual QString displayName() const;
    virtual QWidget *configurationWidget(ProjectExplorer::RunConfiguration *runConfiguration);
con's avatar
con committed


    ProjectExplorer::RunControl *create(const DebuggerStartParametersPtr &sp);
con's avatar
con committed
private:
hjk's avatar
hjk committed
    DebuggerStartParametersPtr m_startParameters;
con's avatar
con committed
    DebuggerManager *m_manager;
};

// This is a job description
hjk's avatar
hjk committed
class DebuggerRunControl
    : public ProjectExplorer::RunControl
con's avatar
con committed
{
    Q_OBJECT

public:
hjk's avatar
hjk committed
    DebuggerRunControl(DebuggerManager *manager,
                       ProjectExplorer::LocalApplicationRunConfiguration *runConfiguration);
    DebuggerRunControl(DebuggerManager *manager, const DebuggerStartParametersPtr &startParameters);
    // ProjectExplorer::RunControl
con's avatar
con committed
    virtual void start();
    virtual void stop();
    virtual bool isRunning() const;

    Q_SLOT void debuggingFinished();
hjk's avatar
hjk committed
    DebuggerStartParametersPtr startParameters() { return m_startParameters; }
hjk's avatar
hjk committed
signals:
    void stopRequested();

con's avatar
con committed
private slots:
    void slotAddToOutputWindowInline(const QString &output);
con's avatar
con committed

private:
hjk's avatar
hjk committed
    DebuggerStartParametersPtr m_startParameters;
con's avatar
con committed
    DebuggerManager *m_manager;
    bool m_running;
};

} // namespace Internal
} // namespace Debugger

#endif // DEBUGGERRUNNER_H