diff --git a/src/plugins/qmldesigner/components/importmanager/importmanager.pri b/src/plugins/qmldesigner/components/importmanager/importmanager.pri new file mode 100644 index 00000000000..089e4282607 --- /dev/null +++ b/src/plugins/qmldesigner/components/importmanager/importmanager.pri @@ -0,0 +1,7 @@ +VPATH += $$PWD + +HEADERS += importmanagerview.h + +SOURCES += importmanagerview.cpp + + diff --git a/src/plugins/qmldesigner/components/importmanager/importmanagerview.cpp b/src/plugins/qmldesigner/components/importmanager/importmanagerview.cpp new file mode 100644 index 00000000000..dff5da34d7d --- /dev/null +++ b/src/plugins/qmldesigner/components/importmanager/importmanagerview.cpp @@ -0,0 +1,199 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, 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. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ + +#include "importmanagerview.h" + +namespace QmlDesigner { + +ImportManagerView::ImportManagerView(QObject *parent) : + AbstractView(parent) +{ +} + +void ImportManagerView::modelAttached(Model *model) +{ + +} + +void ImportManagerView::modelAboutToBeDetached(Model *model) +{ + +} + +void ImportManagerView::nodeCreated(const ModelNode &createdNode) +{ +// handle case that the import is used +} + +void ImportManagerView::nodeAboutToBeRemoved(const ModelNode &removedNode) +{ +// handle case that the import is unused +} + +void ImportManagerView::nodeRemoved(const ModelNode &/*removedNode*/, const NodeAbstractProperty &/*parentProperty*/, AbstractView::PropertyChangeFlags /*propertyChange*/) +{ + +} + +void ImportManagerView::nodeAboutToBeReparented(const ModelNode &/*node*/, const NodeAbstractProperty &/*newPropertyParent*/, const NodeAbstractProperty &/*oldPropertyParent*/, AbstractView::PropertyChangeFlags /*propertyChange*/) +{ + +} + +void ImportManagerView::nodeReparented(const ModelNode &/*node*/, const NodeAbstractProperty &/*newPropertyParent*/, const NodeAbstractProperty &/*oldPropertyParent*/, AbstractView::PropertyChangeFlags /*propertyChange*/) +{ + +} + +void ImportManagerView::nodeIdChanged(const ModelNode &/*node*/, const QString &/*newId*/, const QString &/*oldId*/) +{ + +} + +void ImportManagerView::propertiesAboutToBeRemoved(const QList &/*propertyList*/) +{ + +} + +void ImportManagerView::propertiesRemoved(const QList &/*propertyList*/) +{ + +} + +void ImportManagerView::variantPropertiesChanged(const QList &/*propertyList*/, AbstractView::PropertyChangeFlags /*propertyChange*/) +{ + +} + +void ImportManagerView::bindingPropertiesChanged(const QList &/*propertyList*/, AbstractView::PropertyChangeFlags /*propertyChange*/) +{ + +} + +void ImportManagerView::signalHandlerPropertiesChanged(const QVector &/*propertyList*/, AbstractView::PropertyChangeFlags /*propertyChange*/) +{ + +} + +void ImportManagerView::rootNodeTypeChanged(const QString &/*type*/, int /*majorVersion*/, int /*minorVersion*/) +{ + +} + +void ImportManagerView::instancePropertyChange(const QList > &/*propertyList*/) +{ + +} + +void ImportManagerView::instancesCompleted(const QVector &/*completedNodeList*/) +{ + +} + +void ImportManagerView::instanceInformationsChange(const QMultiHash &/*informationChangeHash*/) +{ + +} + +void ImportManagerView::instancesRenderImageChanged(const QVector &/*nodeList*/) +{ + +} + +void ImportManagerView::instancesPreviewImageChanged(const QVector &/*nodeList*/) +{ + +} + +void ImportManagerView::instancesChildrenChanged(const QVector &/*nodeList*/) +{ + +} + +void ImportManagerView::instancesToken(const QString &/*tokenName*/, int /*tokenNumber*/, const QVector &/*nodeVector*/) +{ + +} + +void ImportManagerView::nodeSourceChanged(const ModelNode &/*modelNode*/, const QString &/*newNodeSource*/) +{ + +} + +void ImportManagerView::rewriterBeginTransaction() +{ + +} + +void ImportManagerView::rewriterEndTransaction() +{ + +} + +void ImportManagerView::currentStateChanged(const ModelNode &/*node*/) +{ + +} + +void ImportManagerView::selectedNodesChanged(const QList &/*selectedNodeList*/, const QList &/*lastSelectedNodeList*/) +{ + +} + +void ImportManagerView::fileUrlChanged(const QUrl &/*oldUrl*/, const QUrl &/*newUrl*/) +{ + +} + +void ImportManagerView::nodeOrderChanged(const NodeListProperty &/*listProperty*/, const ModelNode &/*movedNode*/, int /*oldIndex*/) +{ + +} + +void ImportManagerView::importsChanged(const QList &/*addedImports*/, const QList &/*removedImports*/) +{ + +} + +void ImportManagerView::auxiliaryDataChanged(const ModelNode &/*node*/, const PropertyName &/*name*/, const QVariant &/*data*/) +{ + +} + +void ImportManagerView::customNotification(const AbstractView */*view*/, const QString &/*identifier*/, const QList &/*nodeList*/, const QList &/*data*/) +{ + +} + +void ImportManagerView::scriptFunctionsChanged(const ModelNode &/*node*/, const QStringList &/*scriptFunctionList*/) +{ + +} + +} // namespace QmlDesigner diff --git a/src/plugins/qmldesigner/components/importmanager/importmanagerview.h b/src/plugins/qmldesigner/components/importmanager/importmanagerview.h new file mode 100644 index 00000000000..45970a5ea87 --- /dev/null +++ b/src/plugins/qmldesigner/components/importmanager/importmanagerview.h @@ -0,0 +1,92 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, 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. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ + +#ifndef QMLDESIGNER_IMPORTMANAGERVIEW_H +#define QMLDESIGNER_IMPORTMANAGERVIEW_H + +#include + +namespace QmlDesigner { + +class ImportManagerView : public AbstractView +{ + Q_OBJECT +public: + explicit ImportManagerView(QObject *parent = 0); + + void modelAttached(Model *model); + void modelAboutToBeDetached(Model *model); + + void nodeCreated(const ModelNode &createdNode); + void nodeAboutToBeRemoved(const ModelNode &removedNode); + void nodeRemoved(const ModelNode &removedNode, const NodeAbstractProperty &parentProperty, PropertyChangeFlags propertyChange); + void nodeAboutToBeReparented(const ModelNode &node, const NodeAbstractProperty &newPropertyParent, const NodeAbstractProperty &oldPropertyParent, AbstractView::PropertyChangeFlags propertyChange); + 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& propertyList); + void propertiesRemoved(const QList& propertyList); + void variantPropertiesChanged(const QList& propertyList, PropertyChangeFlags propertyChange); + void bindingPropertiesChanged(const QList& propertyList, PropertyChangeFlags propertyChange); + void signalHandlerPropertiesChanged(const QVector& propertyList, PropertyChangeFlags propertyChange); + void rootNodeTypeChanged(const QString &type, int majorVersion, int minorVersion); + + void instancePropertyChange(const QList > &propertyList); + void instancesCompleted(const QVector &completedNodeList); + void instanceInformationsChange(const QMultiHash &informationChangeHash); + void instancesRenderImageChanged(const QVector &nodeList); + void instancesPreviewImageChanged(const QVector &nodeList); + void instancesChildrenChanged(const QVector &nodeList); + void instancesToken(const QString &tokenName, int tokenNumber, const QVector &nodeVector); + + void nodeSourceChanged(const ModelNode &modelNode, const QString &newNodeSource); + + void rewriterBeginTransaction(); + void rewriterEndTransaction(); + + void currentStateChanged(const ModelNode &node); // base state is a invalid model node + + void selectedNodesChanged(const QList &selectedNodeList, + const QList &lastSelectedNodeList); + + void fileUrlChanged(const QUrl &oldUrl, const QUrl &newUrl); + + void nodeOrderChanged(const NodeListProperty &listProperty, const ModelNode &movedNode, int oldIndex); + + void importsChanged(const QList &addedImports, const QList &removedImports); + + void auxiliaryDataChanged(const ModelNode &node, const PropertyName &name, const QVariant &data); + + void customNotification(const AbstractView *view, const QString &identifier, const QList &nodeList, const QList &data); + + void scriptFunctionsChanged(const ModelNode &node, const QStringList &scriptFunctionList); +}; + +} // namespace QmlDesigner + +#endif // QMLDESIGNER_IMPORTMANAGERVIEW_H diff --git a/src/plugins/qmldesigner/designercore/include/viewmanager.h b/src/plugins/qmldesigner/designercore/include/viewmanager.h index c21c7652636..c7599be3bd2 100644 --- a/src/plugins/qmldesigner/designercore/include/viewmanager.h +++ b/src/plugins/qmldesigner/designercore/include/viewmanager.h @@ -41,6 +41,7 @@ #include #include #include +#include #include namespace QmlDesigner { @@ -109,6 +110,7 @@ private: // variables Internal::DebugView m_debugView; ComponentView m_componentView; FormEditorView m_formEditorView; + ImportManagerView m_importManagerView; ItemLibraryView m_itemLibraryView; NavigatorView m_navigatorView; PropertyEditorView m_propertyEditorView; diff --git a/src/plugins/qmldesigner/designercore/model/viewmanager.cpp b/src/plugins/qmldesigner/designercore/model/viewmanager.cpp index 15068ac3788..0d900348662 100644 --- a/src/plugins/qmldesigner/designercore/model/viewmanager.cpp +++ b/src/plugins/qmldesigner/designercore/model/viewmanager.cpp @@ -102,10 +102,13 @@ void ViewManager::detachViewsExceptRewriterAndComponetView() currentModel()->detachView(&m_formEditorView); currentModel()->detachView(&m_navigatorView); currentModel()->detachView(&m_itemLibraryView); + currentModel()->detachView(&m_importManagerView); currentModel()->detachView(&m_statesEditorView); currentModel()->detachView(&m_propertyEditorView); + if (m_debugView.isAttached()) currentModel()->detachView(&m_debugView); + currentModel()->setNodeInstanceView(0); } @@ -143,9 +146,11 @@ void ViewManager::attachViewsExceptRewriterAndComponetView() { if (QmlDesignerPlugin::instance()->settings().enableDebugView) currentModel()->attachView(&m_debugView); + attachNodeInstanceView(); currentModel()->attachView(&m_formEditorView); currentModel()->attachView(&m_navigatorView); + currentModel()->attachView(&m_importManagerView); attachItemLibraryView(); currentModel()->attachView(&m_statesEditorView); currentModel()->attachView(&m_propertyEditorView); diff --git a/src/plugins/qmldesigner/qmldesigner_dependencies.pri b/src/plugins/qmldesigner/qmldesigner_dependencies.pri index 654b5cb1c63..7dac1977a0d 100644 --- a/src/plugins/qmldesigner/qmldesigner_dependencies.pri +++ b/src/plugins/qmldesigner/qmldesigner_dependencies.pri @@ -15,6 +15,7 @@ INCLUDEPATH *= \ $$PWD/designercore \ $$PWD/designercore/include \ $$PWD/components/componentcore \ + $$PWD/components/importmanager \ $$PWD/components/formeditor \ $$PWD/components/itemlibrary \ $$PWD/components/navigator \ diff --git a/src/plugins/qmldesigner/qmldesignerplugin.pro b/src/plugins/qmldesigner/qmldesignerplugin.pro index 401c51d7227..c5026818da3 100644 --- a/src/plugins/qmldesigner/qmldesignerplugin.pro +++ b/src/plugins/qmldesigner/qmldesignerplugin.pro @@ -16,6 +16,7 @@ include(components/pluginmanager/pluginmanager.pri) include(components/stateseditor/stateseditor.pri) include(components/resources/resources.pri) include(components/debugview/debugview.pri) +include(components/importmanager/importmanager.pri) include(qmldesignerplugin.pri) DEFINES -= QT_NO_CAST_FROM_ASCII