1 /****************************************************************************
3 ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/
6 ** This file is part of the QtDeclarative module of the Qt Toolkit.
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** GNU Lesser General Public License Usage
10 ** This file may be used under the terms of the GNU Lesser General Public
11 ** License version 2.1 as published by the Free Software Foundation and
12 ** appearing in the file LICENSE.LGPL included in the packaging of this
13 ** file. Please review the following information to ensure the GNU Lesser
14 ** General Public License version 2.1 requirements will be met:
15 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
17 ** In addition, as a special exception, Nokia gives you certain additional
18 ** rights. These rights are described in the Nokia Qt LGPL Exception
19 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
21 ** GNU General Public License Usage
22 ** Alternatively, this file may be used under the terms of the GNU General
23 ** Public License version 3.0 as published by the Free Software Foundation
24 ** and appearing in the file LICENSE.GPL included in the packaging of this
25 ** file. Please review the following information to ensure the GNU General
26 ** Public License version 3.0 requirements will be met:
27 ** http://www.gnu.org/copyleft/gpl.html.
30 ** Alternatively, this file may be used in accordance with the terms and
31 ** conditions contained in a signed written agreement between you and Nokia.
40 ****************************************************************************/
42 #ifndef QDECLARATIVEENGINEDEBUGSERVICE_P_H
43 #define QDECLARATIVEENGINEDEBUGSERVICE_P_H
49 // This file is not part of the Qt API. It exists purely as an
50 // implementation detail. This header file may change from version to
51 // version without notice, or even be removed.
56 #include <private/qdeclarativedebugservice_p.h>
58 #include <QtCore/qurl.h>
59 #include <QtCore/qvariant.h>
63 class QDeclarativeEngine;
64 class QDeclarativeContext;
65 class QDeclarativeWatcher;
67 class QDeclarativeDebugStatesDelegate;
69 class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeEngineDebugService : public QDeclarativeDebugService
73 QDeclarativeEngineDebugService(QObject * = 0);
74 ~QDeclarativeEngineDebugService();
76 struct QDeclarativeObjectData {
87 struct QDeclarativeObjectProperty {
88 enum Type { Unknown, Basic, Object, List, SignalProperty };
92 QString valueTypeName;
97 void addEngine(QDeclarativeEngine *);
98 void remEngine(QDeclarativeEngine *);
99 void objectCreated(QDeclarativeEngine *, QObject *);
101 void setStatesDelegate(QDeclarativeDebugStatesDelegate *);
103 static QDeclarativeEngineDebugService *instance();
106 virtual void messageReceived(const QByteArray &);
109 void processMessage(const QByteArray &msg);
110 void propertyChanged(int id, int objectId, const QMetaProperty &property, const QVariant &value);
113 void prepareDeferredObjects(QObject *);
114 void buildObjectList(QDataStream &, QDeclarativeContext *);
115 void buildObjectDump(QDataStream &, QObject *, bool, bool);
116 void buildStatesList(QDeclarativeContext *, bool);
117 QDeclarativeObjectData objectData(QObject *);
118 QDeclarativeObjectProperty propertyData(QObject *, int);
119 QVariant valueContents(const QVariant &defaultValue) const;
120 void setBinding(int objectId, const QString &propertyName, const QVariant &expression, bool isLiteralValue, QString filename = QString(), int line = -1, int column = 0);
121 void resetBinding(int objectId, const QString &propertyName);
122 void setMethodBody(int objectId, const QString &method, const QString &body);
124 QList<QDeclarativeEngine *> m_engines;
125 QDeclarativeWatcher *m_watch;
126 QDeclarativeDebugStatesDelegate *m_statesDelegate;
128 Q_DECLARATIVE_PRIVATE_EXPORT QDataStream &operator<<(QDataStream &, const QDeclarativeEngineDebugService::QDeclarativeObjectData &);
129 Q_DECLARATIVE_PRIVATE_EXPORT QDataStream &operator>>(QDataStream &, QDeclarativeEngineDebugService::QDeclarativeObjectData &);
130 Q_DECLARATIVE_PRIVATE_EXPORT QDataStream &operator<<(QDataStream &, const QDeclarativeEngineDebugService::QDeclarativeObjectProperty &);
131 Q_DECLARATIVE_PRIVATE_EXPORT QDataStream &operator>>(QDataStream &, QDeclarativeEngineDebugService::QDeclarativeObjectProperty &);
135 #endif // QDECLARATIVEENGINEDEBUGSERVICE_P_H