OSDN Git Service

Merge branch '2.3'
[qt-creator-jp/qt-creator-jp.git] / src / plugins / debugger / qml / qmlengine.h
index b8ebe40..3c6d6a7 100644 (file)
@@ -4,26 +4,29 @@
 **
 ** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
 **
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: Nokia Corporation (info@qt.nokia.com)
 **
-** Commercial Usage
-**
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Commercial License Agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Nokia.
 **
 ** GNU Lesser General Public License Usage
 **
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file.  Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this file.
+** Please review the following information to ensure the GNU Lesser General
+** Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
 **
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://qt.nokia.com/contact.
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
 **
 **************************************************************************/
 
 
 #include "debuggerengine.h"
 
-#include <QtCore/QScopedPointer>
+#include <utils/outputformat.h>
+
 #include <QtNetwork/QAbstractSocket>
 
 namespace Debugger {
-
 namespace Internal {
+
 class QmlEnginePrivate;
-} // namespace Internal
 
-class DEBUGGER_EXPORT QmlEngine : public DebuggerEngine
+class QmlEngine : public DebuggerEngine
 {
     Q_OBJECT
 
 public:
-    explicit QmlEngine(const DebuggerStartParameters &startParameters);
-    virtual ~QmlEngine();
+    QmlEngine(const DebuggerStartParameters &startParameters,
+        DebuggerEngine *masterEngine);
+    ~QmlEngine();
 
-    void handleRemoteSetupDone(int port);
+    void handleRemoteSetupDone(int gdbServerPort, int qmlPort);
     void handleRemoteSetupFailed(const QString &message);
 
-    void gotoLocation(const QString &fileName, int lineNumber, bool setMarker);
-    void gotoLocation(const Internal::StackFrame &frame, bool setMarker);
+    bool canDisplayTooltip() const;
 
-    void pauseConnection();
+    void showMessage(const QString &msg, int channel = LogDebug,
+                     int timeout = -1) const;
+    void filterApplicationMessage(const QString &msg, int channel);
+    virtual bool acceptsWatchesWhileRunning() const;
 
 public slots:
     void messageReceived(const QByteArray &message);
     void disconnected();
 
-signals:
-    void remoteStartupRequested();
+private slots:
+    void retryMessageBoxFinished(int result);
+    void wrongSetupMessageBoxFinished(int result);
 
 private:
-    // DebuggerEngine implementation
+    // DebuggerEngine implementation.
     bool isSynchronous() const { return false; }
     void executeStep();
     void executeStepOut();
@@ -79,23 +86,23 @@ private:
     void shutdownInferior();
     void shutdownEngine();
 
-    void setToolTipExpression(const QPoint &mousePos,
-        TextEditor::ITextEditor *editor, int cursorPos);
+    bool setToolTipExpression(const QPoint &mousePos,
+        TextEditor::ITextEditor *editor, const DebuggerToolTipContext &);
 
     void continueInferior();
     void interruptInferior();
 
-    void executeRunToLine(const QString &fileName, int lineNumber);
+    void executeRunToLine(const ContextData &data);
     void executeRunToFunction(const QString &functionName);
-    void executeJumpToLine(const QString &fileName, int lineNumber);
+    void executeJumpToLine(const ContextData &data);
 
     void activateFrame(int index);
     void selectThread(int index);
 
     void attemptBreakpointSynchronization();
-    bool acceptsBreakpoint(BreakpointId id);
+    bool acceptsBreakpoint(BreakpointModelId id) const;
 
-    void assignValueInDebugger(const Internal::WatchData *data,
+    void assignValueInDebugger(const WatchData *data,
         const QString &expr, const QVariant &value);
     void loadSymbols(const QString &moduleName);
     void loadAllSymbols();
@@ -106,8 +113,8 @@ private:
     void reloadFullStack() {}
 
     bool supportsThreads() const { return false; }
-    void updateWatchData(const Internal::WatchData &data,
-        const Internal::WatchUpdateFlags &flags);
+    void updateWatchData(const WatchData &data,
+        const WatchUpdateFlags &flags);
     void executeDebuggerCommand(const QString &command);
 
     unsigned int debuggerCapabilities() const;
@@ -122,6 +129,9 @@ private slots:
     void connectionStartupFailed();
     void connectionError(QAbstractSocket::SocketError error);
     void serviceConnectionError(const QString &service);
+    void appendMessage(const QString &msg, Utils::OutputFormat);
+
+    void synchronizeWatchers();
 
 private:
     void expandObject(const QByteArray &iname, quint64 objectId);
@@ -135,15 +145,21 @@ private:
     QString fromShadowBuildFilename(const QString &filename) const;
     QString mangleFilenamePaths(const QString &filename,
         const QString &oldBasePath, const QString &newBasePath) const;
-    QString toShadowBuildFilename(const QString &filename) const;
     QString qmlImportPath() const;
 
+    enum LogDirection {
+        LogSend,
+        LogReceive
+    };
+    void logMessage(LogDirection direction, const QString &str);
+    QString toFileInProject(const QUrl &fileUrl);
+
 private:
     friend class QmlCppEngine;
-
-    QScopedPointer<Internal::QmlEnginePrivate> d;
+    QmlEnginePrivate *d;
 };
 
+} // namespace Internal
 } // namespace Debugger
 
 #endif // DEBUGGER_QMLENGINE_H