2010-01-07 12:14:35 +01:00
|
|
|
/**************************************************************************
|
|
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator
|
|
|
|
|
**
|
2011-01-11 16:28:15 +01:00
|
|
|
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
2010-01-07 12:14:35 +01:00
|
|
|
**
|
2011-04-13 08:42:33 +02:00
|
|
|
** Contact: Nokia Corporation (info@qt.nokia.com)
|
2010-01-07 12:14:35 +01:00
|
|
|
**
|
|
|
|
|
**
|
|
|
|
|
** GNU Lesser General Public License Usage
|
|
|
|
|
**
|
2011-04-13 08:42:33 +02:00
|
|
|
** This file may be used under the terms of the GNU Lesser General Public
|
|
|
|
|
** License version 2.1 as published by the Free Software Foundation and
|
|
|
|
|
** appearing in the file LICENSE.LGPL included in the packaging of this file.
|
|
|
|
|
** Please review the following information to ensure the GNU Lesser General
|
|
|
|
|
** Public License version 2.1 requirements will be met:
|
|
|
|
|
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
2010-01-07 12:14:35 +01:00
|
|
|
**
|
2010-12-17 16:01:08 +01:00
|
|
|
** In addition, as a special exception, Nokia gives you certain additional
|
2011-04-13 08:42:33 +02:00
|
|
|
** rights. These rights are described in the Nokia Qt LGPL Exception
|
2010-12-17 16:01:08 +01:00
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
|
**
|
2011-04-13 08:42:33 +02:00
|
|
|
** Other Usage
|
|
|
|
|
**
|
|
|
|
|
** Alternatively, this file may be used in accordance with the terms and
|
|
|
|
|
** conditions contained in a signed written agreement between you and Nokia.
|
|
|
|
|
**
|
2010-12-17 16:01:08 +01:00
|
|
|
** If you have questions regarding the use of this file, please contact
|
2011-05-06 15:05:37 +02:00
|
|
|
** Nokia at info@qt.nokia.com.
|
2010-01-07 12:14:35 +01:00
|
|
|
**
|
|
|
|
|
**************************************************************************/
|
|
|
|
|
|
|
|
|
|
#ifndef COMPONENTVIEW_H
|
|
|
|
|
#define COMPONENTVIEW_H
|
|
|
|
|
|
|
|
|
|
#include <abstractview.h>
|
|
|
|
|
#include <modelnode.h>
|
|
|
|
|
|
|
|
|
|
#include <QStringList>
|
|
|
|
|
|
2010-02-16 15:13:57 +01:00
|
|
|
QT_BEGIN_NAMESPACE
|
2010-01-07 12:14:35 +01:00
|
|
|
class QStandardItemModel;
|
2010-02-16 15:13:57 +01:00
|
|
|
QT_END_NAMESPACE
|
2010-01-07 12:14:35 +01:00
|
|
|
|
|
|
|
|
namespace QmlDesigner {
|
|
|
|
|
|
2011-05-24 18:47:33 +02:00
|
|
|
class ComponentAction;
|
|
|
|
|
|
2010-01-07 12:14:35 +01:00
|
|
|
class ComponentView : public AbstractView
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
enum UserRoles
|
|
|
|
|
{
|
|
|
|
|
ModelNodeRole = Qt::UserRole
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
ComponentView(QObject *parent);
|
|
|
|
|
|
|
|
|
|
void modelAttached(Model *model);
|
|
|
|
|
void modelAboutToBeDetached(Model *model);
|
|
|
|
|
|
2011-05-24 18:47:33 +02:00
|
|
|
ComponentAction *action();
|
|
|
|
|
|
2010-01-07 12:14:35 +01:00
|
|
|
void nodeCreated(const ModelNode &createdNode);
|
|
|
|
|
void nodeAboutToBeRemoved(const ModelNode &removedNode);
|
|
|
|
|
void nodeRemoved(const ModelNode &removedNode, const NodeAbstractProperty &parentProperty, PropertyChangeFlags propertyChange);
|
2010-12-08 16:46:25 +01:00
|
|
|
void nodeAboutToBeReparented(const ModelNode &node, const NodeAbstractProperty &newPropertyParent, const NodeAbstractProperty &oldPropertyParent, AbstractView::PropertyChangeFlags propertyChange);
|
2010-01-07 12:14:35 +01:00
|
|
|
void nodeReparented(const ModelNode &node, const NodeAbstractProperty &newPropertyParent, const NodeAbstractProperty &oldPropertyParent, AbstractView::PropertyChangeFlags propertyChange);
|
|
|
|
|
void nodeIdChanged(const ModelNode& node, const QString& newId, const QString& oldId);
|
|
|
|
|
void propertiesAboutToBeRemoved(const QList<AbstractProperty>& propertyList);
|
|
|
|
|
void propertiesRemoved(const QList<AbstractProperty>& propertyList);
|
|
|
|
|
void variantPropertiesChanged(const QList<VariantProperty>& propertyList, PropertyChangeFlags propertyChange);
|
|
|
|
|
void bindingPropertiesChanged(const QList<BindingProperty>& propertyList, PropertyChangeFlags propertyChange);
|
2010-02-10 13:02:49 +01:00
|
|
|
void rootNodeTypeChanged(const QString &type, int majorVersion, int minorVersion);
|
2010-06-10 17:36:14 +02:00
|
|
|
void scriptFunctionsChanged(const ModelNode &node, const QStringList &scriptFunctionList);
|
2010-09-23 15:26:58 +02:00
|
|
|
void instancePropertyChange(const QList<QPair<ModelNode, QString> > &propertyList);
|
2010-12-09 16:09:37 +01:00
|
|
|
void instancesCompleted(const QVector<ModelNode> &completedNodeList);
|
2011-02-01 15:54:52 +01:00
|
|
|
void instanceInformationsChange(const QVector<ModelNode> &nodeList);
|
|
|
|
|
void instancesRenderImageChanged(const QVector<ModelNode> &nodeList);
|
|
|
|
|
void instancesPreviewImageChanged(const QVector<ModelNode> &nodeList);
|
|
|
|
|
void instancesChildrenChanged(const QVector<ModelNode> &nodeList);
|
2011-06-08 17:02:03 +02:00
|
|
|
void nodeSourceChanged(const ModelNode &modelNode, const QString &newNodeSource);
|
2011-02-01 15:54:52 +01:00
|
|
|
|
|
|
|
|
void rewriterBeginTransaction();
|
|
|
|
|
void rewriterEndTransaction();
|
2010-01-07 12:14:35 +01:00
|
|
|
|
2011-02-02 21:52:15 +01:00
|
|
|
void actualStateChanged(const ModelNode &node);
|
|
|
|
|
|
2010-01-07 12:14:35 +01:00
|
|
|
void selectedNodesChanged(const QList<ModelNode> &selectedNodeList,
|
|
|
|
|
const QList<ModelNode> &lastSelectedNodeList);
|
|
|
|
|
|
|
|
|
|
void fileUrlChanged(const QUrl &oldUrl, const QUrl &newUrl);
|
|
|
|
|
|
2010-01-12 10:39:40 +01:00
|
|
|
void nodeOrderChanged(const NodeListProperty &listProperty, const ModelNode &movedNode, int oldIndex);
|
2010-01-07 12:14:35 +01:00
|
|
|
|
|
|
|
|
void auxiliaryDataChanged(const ModelNode &node, const QString &name, const QVariant &data);
|
|
|
|
|
|
|
|
|
|
void customNotification(const AbstractView *view, const QString &identifier, const QList<ModelNode> &nodeList, const QList<QVariant> &data);
|
|
|
|
|
|
2011-02-10 15:44:40 +01:00
|
|
|
void importsChanged(const QList<Import> &addedImports, const QList<Import> &removedImports);
|
2010-01-07 12:14:35 +01:00
|
|
|
|
|
|
|
|
QStandardItemModel *standardItemModel() const;
|
|
|
|
|
|
|
|
|
|
ModelNode modelNode(int index) const;
|
|
|
|
|
|
|
|
|
|
signals:
|
|
|
|
|
void componentListChanged(const QStringList &componentList);
|
|
|
|
|
|
|
|
|
|
private: //functions
|
|
|
|
|
void updateModel();
|
|
|
|
|
void searchForComponentAndAddToList(const ModelNode &node);
|
2011-05-24 18:47:33 +02:00
|
|
|
void searchForComponentAndRemoveFromList(const ModelNode &node);
|
2010-01-07 12:14:35 +01:00
|
|
|
void appendWholeDocumentAsComponent();
|
2011-06-09 11:34:13 +02:00
|
|
|
void removeSingleNodeFromList(const ModelNode &node);
|
2010-01-07 12:14:35 +01:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
QStandardItemModel *m_standardItemModel;
|
2011-05-24 18:47:33 +02:00
|
|
|
ComponentAction *m_componentAction;
|
2010-01-07 12:14:35 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace QmlDesigner
|
|
|
|
|
|
|
|
|
|
#endif // COMPONENTVIEW_H
|