OSDN Git Service

2259858deb125fdea2e8b6bfa38859be23b60f61
[qt-creator-jp/qt-creator-jp.git] / share / qtcreator / qml / qmljsdebugger / include / qdeclarativeobserverservice.h
1 /****************************************************************************
2 **
3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
4 ** All rights reserved.
5 ** Contact: Nokia Corporation (qt-info@nokia.com)
6 **
7 ** This file is part of the QtDeclarative module of the Qt Toolkit.
8 **
9 ** $QT_BEGIN_LICENSE:LGPL$
10 ** No Commercial Usage
11 ** This file contains pre-release code and may not be distributed.
12 ** You may use this file in accordance with the terms and conditions
13 ** contained in the Technology Preview License Agreement accompanying
14 ** this package.
15 **
16 ** GNU Lesser General Public License Usage
17 ** Alternatively, this file may be used under the terms of the GNU Lesser
18 ** General Public License version 2.1 as published by the Free Software
19 ** Foundation and appearing in the file LICENSE.LGPL included in the
20 ** packaging of this file.  Please review the following information to
21 ** ensure the GNU Lesser General Public License version 2.1 requirements
22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
23 **
24 ** In addition, as a special exception, Nokia gives you certain additional
25 ** rights.  These rights are described in the Nokia Qt LGPL Exception
26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
27 **
28 ** If you have questions regarding the use of this file, please contact
29 ** Nokia at qt-info@nokia.com.
30 **
31 **
32 **
33 **
34 **
35 **
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41
42 #ifndef QDECLARATIVEDESIGNDEBUGSERVER_H
43 #define QDECLARATIVEDESIGNDEBUGSERVER_H
44
45 #include "qt_private/qdeclarativedebugservice_p.h"
46 #include "qmlobserverconstants.h"
47 #include "qmljsdebugger_global.h"
48
49 #include <QtCore/QHash>
50
51 QT_FORWARD_DECLARE_CLASS(QColor)
52 QT_FORWARD_DECLARE_CLASS(QDeclarativeEngine)
53 QT_FORWARD_DECLARE_CLASS(QDeclarativeContext)
54 QT_FORWARD_DECLARE_CLASS(QDeclarativeWatcher)
55 QT_FORWARD_DECLARE_CLASS(QDataStream)
56
57 namespace QmlJSDebugger {
58
59 class QMLJSDEBUGGER_EXPORT QDeclarativeObserverService : public QDeclarativeDebugService
60 {
61     Q_OBJECT
62 public:
63     QDeclarativeObserverService();
64     static QDeclarativeObserverService *instance();
65
66     void setDesignModeBehavior(bool inDesignMode);
67     void setCurrentObjects(QList<QObject*> items);
68     void setAnimationSpeed(qreal slowDownFactor);
69     void setAnimationPaused(bool paused);
70     void setCurrentTool(QmlJSDebugger::Constants::DesignTool toolId);
71     void reloaded();
72     void setShowAppOnTop(bool showAppOnTop);
73
74     QString idStringForObject(QObject *obj) const;
75
76     void sendMessage(const QByteArray &message);
77
78 public Q_SLOTS:
79     void selectedColorChanged(const QColor &color);
80     void contextPathUpdated(const QStringList &contextPath);
81
82 Q_SIGNALS:
83     void debuggingClientChanged(bool hasDebuggingClient);
84
85     void currentObjectsChanged(const QList<QObject*> &objects);
86     void designModeBehaviorChanged(bool inDesignMode);
87     void showAppOnTopChanged(bool showAppOnTop);
88     void reloadRequested();
89     void selectToolRequested();
90     void selectMarqueeToolRequested();
91     void zoomToolRequested();
92     void colorPickerToolRequested();
93
94     void objectCreationRequested(const QString &qml, QObject *parent,
95                                  const QStringList &imports, const QString &filename = QString());
96     void objectReparentRequested(QObject *object, QObject *newParent);
97
98     // 1 = normal speed,
99     // 1 < x < 16 = slowdown by some factor
100     void animationSpeedChangeRequested(qreal speedFactor);
101     void executionPauseChangeRequested(bool paused);
102
103     void contextPathIndexChanged(int contextPathIndex);
104     void clearComponentCacheRequested();
105
106 protected:
107     virtual void statusChanged(Status status);
108     virtual void messageReceived(const QByteArray &);
109
110 private:
111     QHash<int, QString> m_stringIdForObjectId;
112 };
113
114 } // namespace QmlJSDebugger
115
116 #endif // QDECLARATIVEDESIGNDEBUGSERVER_H