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 <projectexplorer/outputformat.h>
41 #include <QtCore/QScopedPointer>
42 #include <QtNetwork/QAbstractSocket>
47 class QmlEnginePrivate;
49 class QmlEngine : public DebuggerEngine
54 QmlEngine(const DebuggerStartParameters &startParameters,
55 DebuggerEngine *masterEngine);
58 void handleRemoteSetupDone(int gdbServerPort, int qmlPort);
59 void handleRemoteSetupFailed(const QString &message);
61 bool canDisplayTooltip() const;
63 void showMessage(const QString &msg, int channel = LogDebug,
64 int timeout = -1) const;
65 void filterApplicationMessage(const QString &msg, int channel);
68 void messageReceived(const QByteArray &message);
72 void retryMessageBoxFinished(int result);
73 void wrongSetupMessageBoxFinished(int result);
76 // DebuggerEngine implementation.
77 bool isSynchronous() const { return false; }
79 void executeStepOut();
87 void shutdownInferior();
88 void shutdownEngine();
90 bool setToolTipExpression(const QPoint &mousePos,
91 TextEditor::ITextEditor *editor, const DebuggerToolTipContext &);
93 void continueInferior();
94 void interruptInferior();
96 void executeRunToLine(const ContextData &data);
97 void executeRunToFunction(const QString &functionName);
98 void executeJumpToLine(const ContextData &data);
100 void activateFrame(int index);
101 void selectThread(int index);
103 void attemptBreakpointSynchronization();
104 bool acceptsBreakpoint(BreakpointId id) const;
106 void assignValueInDebugger(const WatchData *data,
107 const QString &expr, const QVariant &value);
108 void loadSymbols(const QString &moduleName);
109 void loadAllSymbols();
110 void requestModuleSymbols(const QString &moduleName);
111 void reloadModules();
112 void reloadRegisters() {}
113 void reloadSourceFiles() {}
114 void reloadFullStack() {}
116 bool supportsThreads() const { return false; }
117 void updateWatchData(const WatchData &data,
118 const WatchUpdateFlags &flags);
119 void executeDebuggerCommand(const QString &command);
121 unsigned int debuggerCapabilities() const;
124 void sendMessage(const QByteArray &msg);
125 void tooltipRequested(const QPoint &mousePos,
126 TextEditor::ITextEditor *editor, int cursorPos);
129 void connectionEstablished();
130 void connectionStartupFailed();
131 void connectionError(QAbstractSocket::SocketError error);
132 void serviceConnectionError(const QString &service);
133 void appendMessage(const QString &msg, ProjectExplorer::OutputFormat);
136 void expandObject(const QByteArray &iname, quint64 objectId);
139 void closeConnection();
140 void startApplicationLauncher();
141 void stopApplicationLauncher();
143 bool isShadowBuildProject() const;
144 QString fromShadowBuildFilename(const QString &filename) const;
145 QString mangleFilenamePaths(const QString &filename,
146 const QString &oldBasePath, const QString &newBasePath) const;
147 QString qmlImportPath() const;
149 void synchronizeWatchers();
155 void logMessage(LogDirection direction, const QString &str);
156 QString toFileInProject(const QString &file);
159 friend class QmlCppEngine;
161 QScopedPointer<QmlEnginePrivate> d;
164 } // namespace Internal
165 } // namespace Debugger
167 #endif // DEBUGGER_QMLENGINE_H