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>
48 class QmlEnginePrivate;
50 class QmlEngine : public DebuggerEngine
60 QmlEngine(const DebuggerStartParameters &startParameters,
61 DebuggerEngine *masterEngine);
64 void handleRemoteSetupDone(int gdbServerPort, int qmlPort);
65 void handleRemoteSetupFailed(const QString &message);
67 bool canDisplayTooltip() const;
69 void showMessage(const QString &msg, int channel = LogDebug,
70 int timeout = -1) const;
71 void filterApplicationMessage(const QString &msg, int channel);
72 QString toFileInProject(const QUrl &fileUrl);
73 void inferiorSpontaneousStop();
75 void logMessage(LogDirection direction, const QString &str);
77 QmlAdapter *adapter() const;
83 void retryMessageBoxFinished(int result);
84 void wrongSetupMessageBoxFinished(int result);
87 // DebuggerEngine implementation.
88 bool isSynchronous() const { return false; }
90 void executeStepOut();
98 void shutdownInferior();
99 void shutdownEngine();
101 bool setToolTipExpression(const QPoint &mousePos,
102 TextEditor::ITextEditor *editor, const DebuggerToolTipContext &);
104 void continueInferior();
105 void interruptInferior();
107 void executeRunToLine(const ContextData &data);
108 void executeRunToFunction(const QString &functionName);
109 void executeJumpToLine(const ContextData &data);
111 void activateFrame(int index);
112 void selectThread(int index);
114 void attemptBreakpointSynchronization();
115 void insertBreakpoint(BreakpointModelId id);
116 void removeBreakpoint(BreakpointModelId id);
117 void changeBreakpoint(BreakpointModelId id);
118 bool acceptsBreakpoint(BreakpointModelId id) const;
120 void assignValueInDebugger(const WatchData *data,
121 const QString &expr, const QVariant &value);
122 void loadSymbols(const QString &moduleName);
123 void loadAllSymbols();
124 void requestModuleSymbols(const QString &moduleName);
125 void reloadModules();
126 void reloadRegisters() {}
127 void reloadSourceFiles() {}
128 void reloadFullStack() {}
130 bool supportsThreads() const { return false; }
131 void updateWatchData(const WatchData &data,
132 const WatchUpdateFlags &flags);
133 void executeDebuggerCommand(const QString &command);
135 unsigned int debuggerCapabilities() const;
138 void tooltipRequested(const QPoint &mousePos,
139 TextEditor::ITextEditor *editor, int cursorPos);
142 void beginConnection();
143 void connectionEstablished();
144 void connectionStartupFailed();
145 void connectionError(QAbstractSocket::SocketError error);
146 void serviceConnectionError(const QString &service);
147 void appendMessage(const QString &msg, Utils::OutputFormat);
149 void synchronizeWatchers();
152 void closeConnection();
153 void startApplicationLauncher();
154 void stopApplicationLauncher();
156 bool isShadowBuildProject() const;
157 QString fromShadowBuildFilename(const QString &filename) const;
158 QString mangleFilenamePaths(const QString &filename,
159 const QString &oldBasePath, const QString &newBasePath) const;
160 QString qmlImportPath() const;
163 friend class QmlCppEngine;
167 } // namespace Internal
168 } // namespace Debugger
170 #endif // DEBUGGER_QMLENGINE_H