2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2011-02-22 12:08:19 +01:00
|
|
|
**
|
2016-01-15 14:59:14 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2011-02-22 12:08:19 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2011-02-22 12:08:19 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** 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
|
2016-01-15 14:59:14 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2011-02-22 12:08:19 +01:00
|
|
|
**
|
2015-09-18 11:34:48 +02:00
|
|
|
** GNU General Public License Usage
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
2016-01-15 14:59:14 +01:00
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2011-02-22 12:08:19 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2011-02-22 12:08:19 +01:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2010-11-24 14:52:06 +01:00
|
|
|
|
|
|
|
#include <qmetatype.h>
|
|
|
|
#include <QString>
|
2012-09-26 16:21:11 +02:00
|
|
|
#include <QDataStream>
|
2010-11-24 14:52:06 +01:00
|
|
|
|
2013-03-05 12:19:19 +01:00
|
|
|
#include "nodeinstanceglobal.h"
|
|
|
|
|
2010-11-24 14:52:06 +01:00
|
|
|
namespace QmlDesigner {
|
|
|
|
|
|
|
|
class InstanceContainer;
|
|
|
|
|
|
|
|
QDataStream &operator<<(QDataStream &out, const InstanceContainer &container);
|
|
|
|
QDataStream &operator>>(QDataStream &in, InstanceContainer &container);
|
|
|
|
|
|
|
|
class InstanceContainer
|
|
|
|
{
|
|
|
|
friend QDataStream &operator>>(QDataStream &in, InstanceContainer &container);
|
|
|
|
|
|
|
|
public:
|
2011-06-08 17:02:03 +02:00
|
|
|
enum NodeSourceType {
|
|
|
|
NoSource = 0,
|
|
|
|
CustomParserSource = 1,
|
|
|
|
ComponentSource = 2
|
|
|
|
};
|
|
|
|
|
2011-06-28 13:24:18 +02:00
|
|
|
enum NodeMetaType {
|
|
|
|
ObjectMetaType,
|
|
|
|
ItemMetaType
|
|
|
|
};
|
|
|
|
|
2018-03-02 15:29:26 +01:00
|
|
|
enum NodeFlag {
|
|
|
|
ParentTakesOverRendering = 1
|
|
|
|
};
|
|
|
|
|
|
|
|
Q_DECLARE_FLAGS(NodeFlags, NodeFlag)
|
|
|
|
|
2010-11-24 14:52:06 +01:00
|
|
|
InstanceContainer();
|
2018-03-02 15:29:26 +01:00
|
|
|
InstanceContainer(qint32 instanceId,
|
|
|
|
const TypeName &type,
|
|
|
|
int majorNumber,
|
|
|
|
int minorNumber,
|
|
|
|
const QString &componentPath,
|
|
|
|
const QString &nodeSource,
|
|
|
|
NodeSourceType nodeSourceType,
|
|
|
|
NodeMetaType metaType,
|
|
|
|
NodeFlags metaFlags);
|
2010-11-24 14:52:06 +01:00
|
|
|
|
|
|
|
qint32 instanceId() const;
|
2013-03-05 12:19:19 +01:00
|
|
|
TypeName type() const;
|
2010-11-24 14:52:06 +01:00
|
|
|
int majorNumber() const;
|
|
|
|
int minorNumber() const;
|
|
|
|
QString componentPath() const;
|
2011-06-08 17:02:03 +02:00
|
|
|
QString nodeSource() const;
|
|
|
|
NodeSourceType nodeSourceType() const;
|
2011-06-28 13:24:18 +02:00
|
|
|
NodeMetaType metaType() const;
|
2018-03-02 15:29:26 +01:00
|
|
|
bool checkFlag(NodeFlag flag) const;
|
|
|
|
NodeFlags metaFlags() const;
|
2010-11-24 14:52:06 +01:00
|
|
|
|
|
|
|
private:
|
2017-09-18 16:48:42 +02:00
|
|
|
qint32 m_instanceId = -1;
|
2013-03-05 12:19:19 +01:00
|
|
|
TypeName m_type;
|
2017-09-18 16:48:42 +02:00
|
|
|
qint32 m_majorNumber = -1;
|
|
|
|
qint32 m_minorNumber = -1;
|
2010-11-24 14:52:06 +01:00
|
|
|
QString m_componentPath;
|
2011-06-08 17:02:03 +02:00
|
|
|
QString m_nodeSource;
|
2017-09-18 16:48:42 +02:00
|
|
|
qint32 m_nodeSourceType = 0;
|
|
|
|
qint32 m_metaType = 0;
|
2018-03-02 15:29:26 +01:00
|
|
|
qint32 m_metaFlags = 0;
|
2010-11-24 14:52:06 +01:00
|
|
|
};
|
|
|
|
|
2013-07-16 17:00:07 +02:00
|
|
|
QDebug operator <<(QDebug debug, const InstanceContainer &command);
|
|
|
|
|
2010-11-24 14:52:06 +01:00
|
|
|
} // namespace QmlDesigner
|
|
|
|
|
2010-12-16 11:25:28 +01:00
|
|
|
Q_DECLARE_METATYPE(QmlDesigner::InstanceContainer)
|
2018-03-02 15:29:26 +01:00
|
|
|
Q_DECLARE_OPERATORS_FOR_FLAGS(QmlDesigner::InstanceContainer::NodeFlags)
|