OSDN Git Service

debugger: fix spelling of synchronous
[qt-creator-jp/qt-creator-jp.git] / src / plugins / debugger / qml / qmlengine.h
1 /**************************************************************************
2 **
3 ** This file is part of Qt Creator
4 **
5 ** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
6 **
7 ** Contact: Nokia Corporation (qt-info@nokia.com)
8 **
9 ** Commercial Usage
10 **
11 ** Licensees holding valid Qt Commercial licenses may use this file in
12 ** accordance with the Qt Commercial License Agreement provided with the
13 ** Software or, alternatively, in accordance with the terms contained in
14 ** a written agreement between you and Nokia.
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 ** If you are unsure which license is appropriate for your use, please
26 ** contact the sales department at http://qt.nokia.com/contact.
27 **
28 **************************************************************************/
29
30 #ifndef DEBUGGER_QMLENGINE_H
31 #define DEBUGGER_QMLENGINE_H
32
33 #include "debuggerengine.h"
34
35 #include <QtCore/QByteArray>
36 #include <QtCore/QHash>
37 #include <QtCore/QObject>
38 #include <QtCore/QPoint>
39 #include <QtCore/QProcess>
40 #include <QtCore/QQueue>
41 #include <QtCore/QTimer>
42 #include <QtCore/QVariant>
43
44 #include <QtNetwork/QAbstractSocket>
45 #include <QtNetwork/QTcpSocket>
46
47 #include <projectexplorer/applicationlauncher.h>
48
49 namespace Debugger {
50 namespace Internal {
51
52 class ScriptAgent;
53 class WatchData;
54 class QmlAdapter;
55 class QmlResponse;
56 class QmlDebuggerClient;
57
58 class DEBUGGER_EXPORT QmlEngine : public DebuggerEngine
59 {
60     Q_OBJECT
61
62 public:
63     explicit QmlEngine(const DebuggerStartParameters &startParameters);
64     ~QmlEngine();
65
66     void setAttachToRunningExternalApp(bool value);
67     void shutdownInferiorAsSlave();
68     void shutdownEngineAsSlave();
69     void pauseConnection();
70
71 public slots:
72     void messageReceived(const QByteArray &message);
73     void disconnected();
74
75 private:
76     // DebuggerEngine implementation
77     bool isSynchronous() const { return false; }
78     void executeStep();
79     void executeStepOut();
80     void executeNext();
81     void executeStepI();
82     void executeNextI();
83
84     void setupEngine();
85     void setupInferior();
86     void runEngine();
87     void shutdownInferior();
88     void shutdownEngine();
89
90     void setToolTipExpression(const QPoint &mousePos, TextEditor::ITextEditor *editor, int cursorPos);
91
92     void continueInferior();
93     void interruptInferior();
94
95     void executeRunToLine(const QString &fileName, int lineNumber);
96     void executeRunToFunction(const QString &functionName);
97     void executeJumpToLine(const QString &fileName, int lineNumber);
98
99     void activateFrame(int index);
100     void selectThread(int index);
101
102     void attemptBreakpointSynchronization();
103
104     void assignValueInDebugger(const QString &expr, const QString &value);
105     void loadSymbols(const QString &moduleName);
106     void loadAllSymbols();
107     void requestModuleSymbols(const QString &moduleName);
108     void reloadModules();
109     void reloadRegisters() {}
110     void reloadSourceFiles() {}
111     void reloadFullStack() {}
112
113     bool supportsThreads() const { return false; }
114     void updateWatchData(const WatchData &data);
115     void executeDebuggerCommand(const QString& command);
116
117     unsigned int debuggerCapabilities() const;
118
119 signals:
120     void sendMessage(const QByteArray &msg);
121
122 private slots:
123     void connectionEstablished();
124     void connectionStartupFailed();
125     void connectionError(QAbstractSocket::SocketError error);
126
127     void slotMessage(QString, bool);
128     void slotAddToOutputWindow(QString, bool);
129 private:
130     void expandObject(const QByteArray &iname, quint64 objectId);
131     void sendPing();
132
133 private:
134     friend class QmlCppEngine;
135
136     int m_ping;
137     QmlAdapter *m_adapter;
138     ProjectExplorer::ApplicationLauncher m_applicationLauncher;
139     bool m_addedAdapterToObjectPool;
140     bool m_attachToRunningExternalApp;
141     bool m_hasShutdown;
142 };
143
144 } // namespace Internal
145 } // namespace Debugger
146
147 #endif // DEBUGGER_QMLENGINE_H