OSDN Git Service

Update license.
[qt-creator-jp/qt-creator-jp.git] / src / plugins / qmldesigner / designercore / instances / nodeinstanceclientproxy.h
1 /**************************************************************************
2 **
3 ** This file is part of Qt Creator
4 **
5 ** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
6 **
7 ** Contact: Nokia Corporation (info@qt.nokia.com)
8 **
9 **
10 ** GNU Lesser General Public License Usage
11 **
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.
18 **
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.
22 **
23 ** Other Usage
24 **
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.
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 #ifndef NODEINSTANCECLIENTPROXY_H
34 #define NODEINSTANCECLIENTPROXY_H
35
36 #include "nodeinstanceclientinterface.h"
37
38 #include <QObject>
39 #include <QHash>
40 #include <QWeakPointer>
41
42 QT_BEGIN_NAMESPACE
43 class QLocalSocket;
44 QT_END_NAMESPACE
45
46 namespace QmlDesigner {
47
48 class NodeInstanceServerInterface;
49 class CreateSceneCommand;
50 class CreateInstancesCommand;
51 class ClearSceneCommand;
52 class ReparentInstancesCommand;
53 class ChangeFileUrlCommand;
54 class ChangeValuesCommand;
55 class ChangeBindingsCommand;
56 class ChangeIdsCommand;
57 class RemoveInstancesCommand;
58 class RemovePropertiesCommand;
59 class AddImportCommand;
60 class CompleteComponentCommand;
61 class ChangeStateCommand;
62
63 class NodeInstanceClientProxy : public QObject, public NodeInstanceClientInterface
64 {
65     Q_OBJECT
66
67 public:
68     NodeInstanceClientProxy(QObject *parent = 0);
69
70     void informationChanged(const InformationChangedCommand &command);
71     void valuesChanged(const ValuesChangedCommand &command);
72     void pixmapChanged(const PixmapChangedCommand &command);
73     void childrenChanged(const ChildrenChangedCommand &command);
74     void statePreviewImagesChanged(const StatePreviewImageChangedCommand &command);
75     void componentCompleted(const ComponentCompletedCommand &command);
76
77     void flush();
78     void synchronizeWithClientProcess();
79     qint64 bytesToWrite() const;
80
81 protected:
82     void writeCommand(const QVariant &command);
83     void dispatchCommand(const QVariant &command);
84     NodeInstanceServerInterface *nodeInstanceServer() const;
85
86     void createInstances(const CreateInstancesCommand &command);
87     void changeFileUrl(const ChangeFileUrlCommand &command);
88     void createScene(const CreateSceneCommand &command);
89     void clearScene(const ClearSceneCommand &command);
90     void removeInstances(const RemoveInstancesCommand &command);
91     void removeProperties(const RemovePropertiesCommand &command);
92     void changePropertyBindings(const ChangeBindingsCommand &command);
93     void changePropertyValues(const ChangeValuesCommand &command);
94     void reparentInstances(const ReparentInstancesCommand &command);
95     void changeIds(const ChangeIdsCommand &command);
96     void changeState(const ChangeStateCommand &command);
97     void addImport(const AddImportCommand &command);
98     void completeComponent(const CompleteComponentCommand &command);
99
100 private slots:
101     void readDataStream();
102
103 private:
104     QLocalSocket *m_socket;
105     NodeInstanceServerInterface *m_nodeInstanceServer;
106     quint32 m_blockSize;
107     int m_synchronizeId;
108 };
109
110 } // namespace QmlDesigner
111
112 #endif // NODEINSTANCECLIENTPROXY_H