OSDN Git Service

70991889ff7f32a437811489bc0d7cadee29a84f
[qt-creator-jp/qt-creator-jp.git] / src / plugins / debugger / debuggerrunner.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 ** Contact: Nokia Corporation (qt-info@nokia.com)
8 **
9 ** No Commercial Usage
10 **
11 ** This file contains pre-release code and may not be distributed.
12 ** You may use this file in accordance with the terms and conditions
13 ** contained in the Technology Preview License Agreement accompanying
14 ** this package.
15 **
16 ** GNU Lesser General Public License Usage
17 **
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file.  Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Nokia gives you certain additional
26 ** rights.  These rights are described in the Nokia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** If you have questions regarding the use of this file, please contact
30 ** Nokia at qt-info@nokia.com.
31 **
32 **************************************************************************/
33
34 #ifndef DEBUGGERRUNNER_H
35 #define DEBUGGERRUNNER_H
36
37 #include "debugger_global.h"
38 #include "debuggerconstants.h"
39
40 #include <projectexplorer/abi.h>
41 #include <projectexplorer/runconfiguration.h>
42
43 #include <QtCore/QScopedPointer>
44 #include <QtCore/QPair>
45 #include <QtCore/QStringList>
46
47 namespace Utils {
48 class Environment;
49 }
50
51 namespace Debugger {
52 class DebuggerEngine;
53 class DebuggerRunControl;
54 class DebuggerStartParameters;
55
56 namespace Internal {
57 class DebuggerRunControlPrivate;
58 class DebuggerRunControlFactory;
59 } // namespace Internal
60
61
62 class DEBUGGER_EXPORT ConfigurationCheck
63 {
64 public:
65     ConfigurationCheck();
66     operator bool() const;
67     QString errorDetailsString() const;
68
69     QString errorMessage;
70     QStringList errorDetails;
71     QString settingsCategory;
72     QString settingsPage;
73     QPair<DebuggerEngineType, DebuggerEngineType> masterSlaveEngineTypes;
74 };
75
76 DEBUGGER_EXPORT ConfigurationCheck checkDebugConfiguration(const DebuggerStartParameters &sp);
77
78 // This is a job description containing all data "local" to the jobs, including
79 // the models of the individual debugger views.
80 class DEBUGGER_EXPORT DebuggerRunControl
81     : public ProjectExplorer::RunControl
82 {
83     Q_OBJECT
84
85 public:
86     typedef ProjectExplorer::RunConfiguration RunConfiguration;
87     explicit DebuggerRunControl(RunConfiguration *runConfiguration,
88                                 const DebuggerStartParameters &sp,
89                                 const QPair<DebuggerEngineType, DebuggerEngineType> &masterSlaveEngineTypes);
90
91     ~DebuggerRunControl();
92
93     // ProjectExplorer::RunControl
94     void start();
95     bool promptToStop(bool *prompt = 0) const;
96     StopResult stop(); // Called from SnapshotWindow.
97     bool isRunning() const;
98     QString displayName() const;
99
100     void setCustomEnvironment(Utils::Environment env);
101     void startFailed();
102     void debuggingFinished();
103     RunConfiguration *runConfiguration() const;
104     DebuggerEngine *engine(); // FIXME: Remove. Only used by Maemo support.
105
106     void showMessage(const QString &msg, int channel);
107
108 signals:
109     void engineRequestSetup();
110
111 private slots:
112     void handleFinished();
113
114 protected:
115     const DebuggerStartParameters &startParameters() const;
116
117 private:
118     friend class Internal::DebuggerRunControlFactory;
119     QScopedPointer<Internal::DebuggerRunControlPrivate> d;
120 };
121
122 } // namespace Debugger
123
124 #endif // DEBUGGERRUNNER_H