1 /**************************************************************************
3 ** This file is part of Qt Creator
5 ** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
7 ** Contact: Nokia Corporation (qt-info@nokia.com)
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
16 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
25 ** In addition, as a special exception, Nokia gives you certain additional
26 ** rights. These rights are described in the Nokia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
29 ** If you have questions regarding the use of this file, please contact
30 ** Nokia at qt-info@nokia.com.
32 **************************************************************************/
34 #ifndef PROXYNODEINSTANCE_H
35 #define PROXYNODEINSTANCE_H
37 #include <QSharedPointer>
43 #include "commondefines.h"
45 namespace QmlDesigner {
48 class NodeInstanceView;
49 class ProxyNodeInstanceData;
53 friend class NodeInstanceView;
55 static NodeInstance create(const ModelNode &node);
58 NodeInstance(const NodeInstance &other);
59 NodeInstance& operator=(const NodeInstance &other);
61 ModelNode modelNode() const;
64 QRectF boundingRect() const;
65 bool hasContent() const;
66 bool isAnchoredBySibling() const;
67 bool isAnchoredByChildren() const;
68 bool isMovable() const;
69 bool isResizable() const;
70 QTransform transform() const;
71 QTransform sceneTransform() const;
72 bool isInPositioner() const;
73 QPointF position() const;
76 void paint(QPainter *painter);
78 QVariant property(const QString &name) const;
79 bool hasBindingForProperty(const QString &name) const;
80 QPair<QString, qint32> anchor(const QString &name) const;
81 bool hasAnchor(const QString &name) const;
82 QString instanceType(const QString &name) const;
84 qint32 parentId() const;
85 qint32 instanceId() const;
88 void setProperty(const QString &name, const QVariant &value);
89 void setInformation(InformationName name,
90 const QVariant &information,
91 const QVariant &secondInformation,
92 const QVariant &thirdInformation);
94 void setParentId(qint32 instanceId);
95 void setRenderImage(const QImage &image);
96 NodeInstance(ProxyNodeInstanceData *d);
99 QSharedPointer<ProxyNodeInstanceData> d;
102 bool operator ==(const NodeInstance &first, const NodeInstance &second);
106 #endif // PROXYNODEINSTANCE_H