1 /**************************************************************************
3 ** This file is part of Qt Creator
5 ** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
7 ** Contact: Nokia Corporation (qt-info@nokia.com)
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
16 ** GNU Lesser General Public License Usage
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.
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.
29 ** If you have questions regarding the use of this file, please contact
30 ** Nokia at qt-info@nokia.com.
32 **************************************************************************/
34 #ifndef DEBUGGER_QMLENGINE_H
35 #define DEBUGGER_QMLENGINE_H
37 #include "debuggerengine.h"
39 #include <QtCore/QScopedPointer>
40 #include <QtNetwork/QAbstractSocket>
45 class QmlEnginePrivate;
47 class QmlEngine : public DebuggerEngine
52 explicit QmlEngine(const DebuggerStartParameters &startParameters);
55 void handleRemoteSetupDone(int port);
56 void handleRemoteSetupFailed(const QString &message);
58 void gotoLocation(const Location &location);
59 void pauseConnection();
62 void messageReceived(const QByteArray &message);
66 void remoteStartupRequested();
69 // DebuggerEngine implementation.
70 bool isSynchronous() const { return false; }
72 void executeStepOut();
80 void shutdownInferior();
81 void shutdownEngine();
83 void setToolTipExpression(const QPoint &mousePos,
84 TextEditor::ITextEditor *editor, int cursorPos);
86 void continueInferior();
87 void interruptInferior();
89 void executeRunToLine(const QString &fileName, int lineNumber);
90 void executeRunToFunction(const QString &functionName);
91 void executeJumpToLine(const QString &fileName, int lineNumber);
93 void activateFrame(int index);
94 void selectThread(int index);
96 void attemptBreakpointSynchronization();
97 bool acceptsBreakpoint(BreakpointId id) const;
99 void assignValueInDebugger(const WatchData *data,
100 const QString &expr, const QVariant &value);
101 void loadSymbols(const QString &moduleName);
102 void loadAllSymbols();
103 void requestModuleSymbols(const QString &moduleName);
104 void reloadModules();
105 void reloadRegisters() {}
106 void reloadSourceFiles() {}
107 void reloadFullStack() {}
109 bool supportsThreads() const { return false; }
110 void updateWatchData(const WatchData &data,
111 const WatchUpdateFlags &flags);
112 void executeDebuggerCommand(const QString &command);
114 unsigned int debuggerCapabilities() const;
117 void sendMessage(const QByteArray &msg);
118 void tooltipRequested(const QPoint &mousePos,
119 TextEditor::ITextEditor *editor, int cursorPos);
122 void connectionEstablished();
123 void connectionStartupFailed();
124 void connectionError(QAbstractSocket::SocketError error);
125 void serviceConnectionError(const QString &service);
126 void appendMessage(const QString &msg, bool);
127 void appendOutput(const QString &msg, bool);
130 void expandObject(const QByteArray &iname, quint64 objectId);
133 void closeConnection();
134 void startApplicationLauncher();
135 void stopApplicationLauncher();
137 bool isShadowBuildProject() const;
138 QString fromShadowBuildFilename(const QString &filename) const;
139 QString mangleFilenamePaths(const QString &filename,
140 const QString &oldBasePath, const QString &newBasePath) const;
141 QString toShadowBuildFilename(const QString &filename) const;
142 QString qmlImportPath() const;
148 void logMessage(LogDirection direction, const QString &str);
151 friend class QmlCppEngine;
153 QScopedPointer<QmlEnginePrivate> d;
156 } // namespace Internal
157 } // namespace Debugger
159 #endif // DEBUGGER_QMLENGINE_H