1 /**************************************************************************
3 ** This file is part of Qt Creator
5 ** Copyright (c) 2011 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 qt-info@nokia.com.
31 **************************************************************************/
33 #ifndef DEBGUGGER_QMLADAPTER_H
34 #define DEBGUGGER_QMLADAPTER_H
36 #include "debugger_global.h"
37 #include "qmldebuggerclient.h"
39 #include <QtCore/QObject>
40 #include <QtCore/QScopedPointer>
41 #include <QtNetwork/QAbstractSocket>
43 namespace QmlJsDebugClient {
44 class QDeclarativeEngineDebug;
45 class QDeclarativeDebugConnection;
53 class QmlDebuggerClient;
54 class QmlAdapterPrivate;
55 } // namespace Internal
57 class DEBUGGER_EXPORT QmlAdapter : public QObject
61 explicit QmlAdapter(DebuggerEngine *engine, QObject *parent = 0);
62 virtual ~QmlAdapter();
64 void beginConnection();
65 void closeConnection();
67 bool isConnected() const;
69 QmlJsDebugClient::QDeclarativeDebugConnection *connection() const;
71 bool disableJsDebugging(bool block);
74 void logServiceStatusChange(const QString &service, QDeclarativeDebugClient::Status newStatus);
75 void logServiceActivity(const QString &service, const QString &logMessage);
80 void connectionStartupFailed();
81 void connectionError(QAbstractSocket::SocketError socketError);
82 void serviceConnectionError(const QString serviceName);
85 void sendMessage(const QByteArray &msg);
86 void connectionErrorOccurred(QAbstractSocket::SocketError socketError);
87 void clientStatusChanged(QDeclarativeDebugClient::Status status);
88 void connectionStateChanged();
92 void connectToViewer();
93 void createDebuggerClient();
94 void showConnectionStatusMessage(const QString &message);
95 void showConnectionErrorMessage(const QString &message);
96 void flushSendBuffer();
99 QScopedPointer<Internal::QmlAdapterPrivate> d;
102 } // namespace Debugger
104 #endif // DEBGUGGER_QMLADAPTER_H