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 **************************************************************************/
37 #include <qmlmodelview.h>
39 #include <QStringList>
42 class TestView : public QmlDesigner::QmlModelView
47 MethodCall(const QString &n, const QStringList &args) :
48 name(n), arguments(args)
53 QStringList arguments;
56 TestView(QmlDesigner::Model *model);
58 void modelAttached(QmlDesigner::Model *model);
59 void modelAboutToBeDetached(QmlDesigner::Model *model);
60 void nodeCreated(const QmlDesigner::ModelNode &createdNode);
61 void nodeAboutToBeRemoved(const QmlDesigner::ModelNode &removedNode);
62 void nodeRemoved(const QmlDesigner::ModelNode &removedNode, const QmlDesigner::NodeAbstractProperty &parentProperty, AbstractView::PropertyChangeFlags propertyChange);
63 void nodeReparented(const QmlDesigner::ModelNode &node, const QmlDesigner::NodeAbstractProperty &newPropertyParent, const QmlDesigner::NodeAbstractProperty &oldPropertyParent, AbstractView::PropertyChangeFlags propertyChange);
64 void nodeIdChanged(const QmlDesigner::ModelNode& node, const QString& newId, const QString& oldId);
65 void rootNodeTypeChanged(const QString &type, int majorVersion, int minorVersion);
67 void bindingPropertiesChanged(const QList<QmlDesigner::BindingProperty>& propertyList, PropertyChangeFlags propertyChange);
68 void variantPropertiesChanged(const QList<QmlDesigner::VariantProperty>& propertyList, PropertyChangeFlags propertyChange);
69 void propertiesAboutToBeRemoved(const QList<QmlDesigner::AbstractProperty> &propertyList);
73 void fileUrlChanged(const QUrl &oldBaseUrl, const QUrl &newBaseUrl);
74 void selectedNodesChanged(const QList<QmlDesigner::ModelNode> &selectedNodeList,
75 const QList<QmlDesigner::ModelNode> &lastSelectedNodeList);
77 void nodeOrderChanged(const QmlDesigner::NodeListProperty &listProperty, const QmlDesigner::ModelNode &movedNode, int oldIndex);
79 void stateChanged(const QmlDesigner::QmlModelState &newQmlModelState, const QmlDesigner::QmlModelState &oldQmlModelState);
81 QList<MethodCall> &methodCalls();
83 QString lastFunction() const;
85 QmlDesigner::NodeInstanceView *nodeInstanceView() const;
87 QmlDesigner::NodeInstance instanceForModelNode(const QmlDesigner::ModelNode &modelNode);
90 QList<MethodCall> m_methodCalls;
91 static QString serialize(AbstractView::PropertyChangeFlags change);
94 bool operator==(TestView::MethodCall call1, TestView::MethodCall call2);
95 QDebug operator<<(QDebug debug, TestView::MethodCall call);