Maki
Formally verfied low-code orchestration
Loading...
Searching...
No Matches
property_info.h
1#pragma once
2
3#include <QJsonObject>
4#include <QList>
5
6#include "idocument.h"
7#include "mission_parameter.h"
8#include "types.h"
9
10class PropertyConfig;
11
15class PropertyInfo : public IParameter
16{
17public:
22
28 PropertyInfo(const PropertyConfig& object);
29
35 QString getid() const override;
36
37 QString getname() const override;
38
44 const IValue* getvalue() const override;
45
51 koda::types::TypeReference gettype() const override;
52
58 Types::ControlTypes getcontrol() const override;
59
65 void setId(const QString& arg);
66
72 void setDefaultValue(const maki::Value& arg);
73
79 void setType(const koda::types::TypeReference& arg);
80
86 void setControl(Types::ControlTypes arg);
87
94 PropertyInfo getOption(const QString& optionId);
95
101 QJsonObject toJson() const;
102
109 static PropertyInfo fromJson(const QJsonObject& data);
110
111 friend QDataStream& operator<<(QDataStream& out, const PropertyInfo& config);
112 friend QDataStream& operator>>(QDataStream& in, PropertyInfo& config);
113
114private:
115 QString mId;
116 maki::Value mDefaultValue;
117 koda::types::TypeReference mType;
118 Types::ControlTypes mControlType;
119};
120
121QDataStream& operator<<(QDataStream& out, const QVector<std::shared_ptr<PropertyInfo>>& properties);
122QDataStream& operator>>(QDataStream& in, QVector<std::shared_ptr<PropertyInfo>>& properties);
123QDataStream& operator<<(QDataStream& out, const QVector<std::shared_ptr<IParameter>>& properties);
124QDataStream& operator>>(QDataStream& in, QVector<std::shared_ptr<IParameter>>& properties);
Configuration for a property.
Definition config.h:17
void setDefaultValue(const maki::Value &arg)
Sets the default value of the property.
Definition property_info.cpp:52
void setType(const koda::types::TypeReference &arg)
Sets the type of the property.
Definition property_info.cpp:57
void setControl(Types::ControlTypes arg)
Sets the control type of the property.
Definition property_info.cpp:62
PropertyInfo getOption(const QString &optionId)
Gets a specific option by ID.
const IValue * getvalue() const override
Gets the default value of the property.
Definition property_info.cpp:32
Types::ControlTypes getcontrol() const override
Gets the control type of the property.
Definition property_info.cpp:42
koda::types::TypeReference gettype() const override
Gets the type of the property.
Definition property_info.cpp:37
Types::ControlTypes mControlType
Type of the property.
Definition property_info.h:118
void setId(const QString &arg)
Sets the ID of the property.
Definition property_info.cpp:47
QJsonObject toJson() const
Converts the PropertyInfo object to a JSON object.
Definition property_info.cpp:69
PropertyInfo()
Constructs an empty PropertyInfo object.
Definition property_info.cpp:10
maki::Value mDefaultValue
ID of the property.
Definition property_info.h:116
QString getid() const override
Gets the ID of the property.
Definition property_info.cpp:22
koda::types::TypeReference mType
Default value of the property.
Definition property_info.h:117
static PropertyInfo fromJson(const QJsonObject &data)
Creates a PropertyInfo object from a JSON object.
Definition property_info.cpp:80