OSDN Git Service

It's 2011 now.
[qt-creator-jp/qt-creator-jp.git] / src / plugins / debugger / debuggerdialogs.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 DEBUGGER_DIALOGS_H
35 #define DEBUGGER_DIALOGS_H
36
37 #include <QtGui/QDialog>
38
39 QT_BEGIN_NAMESPACE
40
41 class QModelIndex;
42 class QPushButton;
43 class QLineEdit;
44 class QDialogButtonBox;
45
46 namespace Ui {
47 class AttachCoreDialog;
48 class AttachExternalDialog;
49 class AttachTcfDialog;
50 class StartExternalDialog;
51 class StartRemoteDialog;
52 class StartRemoteEngineDialog;
53 } // namespace Ui
54
55 QT_END_NAMESPACE
56
57
58 namespace Debugger {
59 namespace Internal {
60
61 class ProcessListFilterModel;
62
63 struct ProcData
64 {
65     QString ppid;
66     QString name;
67     QString image;
68     QString state;
69 };
70
71 class AttachCoreDialog : public QDialog
72 {
73     Q_OBJECT
74
75 public:
76     explicit AttachCoreDialog(QWidget *parent);
77     ~AttachCoreDialog();
78
79     void setExecutableFile(const QString &executable);
80     void setCoreFile(const QString &core);
81
82     QString executableFile() const;
83     QString coreFile() const;
84
85 private:
86     Ui::AttachCoreDialog *m_ui;
87 };
88
89 class AttachExternalDialog : public QDialog
90 {
91     Q_OBJECT
92
93 public:
94     explicit AttachExternalDialog(QWidget *parent);
95     ~AttachExternalDialog();
96
97     qint64 attachPID() const;
98     QString executable() const;
99
100     virtual void accept();
101
102 private slots:
103     void rebuildProcessList();
104     void procSelected(const QModelIndex &index);
105     void procClicked(const QModelIndex &index);
106     void pidChanged(const QString &index);
107     void setFilterString(const QString &filter);
108
109 private:
110     inline QPushButton *okButton() const;
111     inline QString attachPIDText() const;
112
113     const QString m_selfPid;
114     Ui::AttachExternalDialog *m_ui;
115     ProcessListFilterModel *m_model;
116 };
117
118 class AttachTcfDialog : public QDialog
119 {
120     Q_OBJECT
121
122 public:
123     explicit AttachTcfDialog(QWidget *parent);
124     ~AttachTcfDialog();
125
126     QString remoteChannel() const;
127     void setRemoteChannel(const QString &host);
128
129     QString remoteArchitecture() const;
130     void setRemoteArchitecture(const QString &arch);
131     void setRemoteArchitectures(const QStringList &arches);
132
133     QString serverStartScript() const;
134     bool useServerStartScript() const;
135     void setUseServerStartScript(bool on);
136     void setServerStartScript(const QString &scriptName);
137
138 private slots:
139     void updateState();
140
141 private:
142     Ui::AttachTcfDialog *m_ui;
143 };
144
145 class StartExternalDialog : public QDialog
146 {
147     Q_OBJECT
148
149 public:
150     explicit StartExternalDialog(QWidget *parent);
151     ~StartExternalDialog();
152
153     QString executableFile() const;
154     void setExecutableFile(const QString &executable);
155
156     QString executableArguments() const;
157     void setExecutableArguments(const QString &args);
158
159     QString workingDirectory() const;
160     void setWorkingDirectory(const QString &str);
161
162     bool breakAtMain() const;
163
164 private:
165     Ui::StartExternalDialog *m_ui;
166 };
167
168 class StartRemoteDialog : public QDialog
169 {
170     Q_OBJECT
171
172 public:
173     explicit StartRemoteDialog(QWidget *parent);
174     ~StartRemoteDialog();
175
176     QString localExecutable() const;
177     void setLocalExecutable(const QString &executable);
178
179     QString remoteChannel() const;
180     void setRemoteChannel(const QString &host);
181
182     QString remoteArchitecture() const;
183     void setRemoteArchitecture(const QString &arch);
184     void setRemoteArchitectures(const QStringList &arches);
185
186     QString gnuTarget() const;
187     void setGnuTarget(const QString &gnuTarget);
188     void setGnuTargets(const QStringList &gnuTargets);
189
190     bool useServerStartScript() const;
191     void setUseServerStartScript(bool on);
192     QString serverStartScript() const;
193     void setServerStartScript(const QString &scriptName);
194
195     QString sysRoot() const;
196     void setSysRoot(const QString &sysRoot);
197
198     QString debugger() const;
199     void setDebugger(const QString &debugger);
200
201 private slots:
202     void updateState();
203
204 private:
205     Ui::StartRemoteDialog *m_ui;
206 };
207
208 class StartRemoteCdbDialog : public QDialog
209 {
210     Q_OBJECT
211
212 public:
213     explicit StartRemoteCdbDialog(QWidget *parent);
214     ~StartRemoteCdbDialog();
215
216     QString connection() const;
217     void setConnection(const QString &);
218
219     virtual void accept();
220
221 private slots:
222     void textChanged(const QString &);
223
224 private:
225     QPushButton *m_okButton;
226     QLineEdit *m_lineEdit;
227 };
228
229 class AddressDialog : public QDialog {
230     Q_OBJECT
231 public:
232      explicit AddressDialog(QWidget *parent = 0);
233      quint64 address() const;
234
235      virtual void accept();
236
237 private slots:
238      void textChanged();
239
240 private:
241      void setOkButtonEnabled(bool v);
242      bool isOkButtonEnabled() const;
243
244      bool isValid() const;
245
246      QLineEdit *m_lineEdit;
247      QDialogButtonBox *m_box;
248 };
249
250 class StartRemoteEngineDialog : public QDialog
251 {
252     Q_OBJECT
253
254 public:
255     explicit StartRemoteEngineDialog(QWidget *parent);
256     ~StartRemoteEngineDialog();
257     QString username() const;
258     QString host() const;
259     QString password() const;
260     QString enginePath() const;
261     QString inferiorPath() const;
262
263 private:
264     Ui::StartRemoteEngineDialog *m_ui;
265 };
266
267 } // namespace Debugger
268 } // namespace Internal
269
270 #endif // DEBUGGER_DIALOGS_H