1 /**************************************************************************
3 ** This file is part of Qt Creator
5 ** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
7 ** Contact: Nokia Corporation (info@qt.nokia.com)
10 ** GNU Lesser General Public License Usage
12 ** This file may be used under the terms of the GNU Lesser General Public
13 ** License version 2.1 as published by the Free Software Foundation and
14 ** appearing in the file LICENSE.LGPL included in the packaging of this file.
15 ** Please review the following information to ensure the GNU Lesser General
16 ** Public License version 2.1 requirements will be met:
17 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
19 ** In addition, as a special exception, Nokia gives you certain additional
20 ** rights. These rights are described in the Nokia Qt LGPL Exception
21 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
25 ** Alternatively, this file may be used in accordance with the terms and
26 ** conditions contained in a signed written agreement between you and Nokia.
28 ** If you have questions regarding the use of this file, please contact
29 ** Nokia at info@qt.nokia.com.
31 **************************************************************************/
33 #ifndef DEBUGGER_QMLENGINE_H
34 #define DEBUGGER_QMLENGINE_H
36 #include "debuggerengine.h"
38 #include <utils/outputformat.h>
40 #include <QtNetwork/QAbstractSocket>
45 class QmlEnginePrivate;
47 class QmlEngine : public DebuggerEngine
52 QmlEngine(const DebuggerStartParameters &startParameters,
53 DebuggerEngine *masterEngine);
56 void handleRemoteSetupDone(int gdbServerPort, int qmlPort);
57 void handleRemoteSetupFailed(const QString &message);
59 bool canDisplayTooltip() const;
61 void showMessage(const QString &msg, int channel = LogDebug,
62 int timeout = -1) const;
63 void filterApplicationMessage(const QString &msg, int channel);
64 virtual bool acceptsWatchesWhileRunning() const;
67 void messageReceived(const QByteArray &message);
71 void retryMessageBoxFinished(int result);
72 void wrongSetupMessageBoxFinished(int result);
75 // DebuggerEngine implementation.
76 bool isSynchronous() const { return false; }
78 void executeStepOut();
86 void shutdownInferior();
87 void shutdownEngine();
89 bool setToolTipExpression(const QPoint &mousePos,
90 TextEditor::ITextEditor *editor, const DebuggerToolTipContext &);
92 void continueInferior();
93 void interruptInferior();
95 void executeRunToLine(const ContextData &data);
96 void executeRunToFunction(const QString &functionName);
97 void executeJumpToLine(const ContextData &data);
99 void activateFrame(int index);
100 void selectThread(int index);
102 void attemptBreakpointSynchronization();
103 bool acceptsBreakpoint(BreakpointModelId id) const;
105 void assignValueInDebugger(const WatchData *data,
106 const QString &expr, const QVariant &value);
107 void loadSymbols(const QString &moduleName);
108 void loadAllSymbols();
109 void requestModuleSymbols(const QString &moduleName);
110 void reloadModules();
111 void reloadRegisters() {}
112 void reloadSourceFiles() {}
113 void reloadFullStack() {}
115 bool supportsThreads() const { return false; }
116 void updateWatchData(const WatchData &data,
117 const WatchUpdateFlags &flags);
118 void executeDebuggerCommand(const QString &command);
120 unsigned int debuggerCapabilities() const;
123 void sendMessage(const QByteArray &msg);
124 void tooltipRequested(const QPoint &mousePos,
125 TextEditor::ITextEditor *editor, int cursorPos);
128 void connectionEstablished();
129 void connectionStartupFailed();
130 void connectionError(QAbstractSocket::SocketError error);
131 void serviceConnectionError(const QString &service);
132 void appendMessage(const QString &msg, Utils::OutputFormat);
134 void synchronizeWatchers();
137 void expandObject(const QByteArray &iname, quint64 objectId);
140 void closeConnection();
141 void startApplicationLauncher();
142 void stopApplicationLauncher();
144 bool isShadowBuildProject() const;
145 QString fromShadowBuildFilename(const QString &filename) const;
146 QString mangleFilenamePaths(const QString &filename,
147 const QString &oldBasePath, const QString &newBasePath) const;
148 QString qmlImportPath() const;
154 void logMessage(LogDirection direction, const QString &str);
155 QString toFileInProject(const QUrl &fileUrl);
158 friend class QmlCppEngine;
162 } // namespace Internal
163 } // namespace Debugger
165 #endif // DEBUGGER_QMLENGINE_H