2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
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)
|