ImagingTools Core SDK
CParameter.h
1// SPDX-License-Identifier: LGPL-2.1-or-later OR GPL-2.0-or-later OR GPL-3.0-or-later OR LicenseRef-ImtCore-Commercial
2#pragma once
3
4
5// Qt includes
6#include <QtCore/QJsonObject>
7#include <QtCore/QJsonArray>
8#include <QtCore/QJsonValue>
9#include <QtCore/QString>
10
11// ImtCore includes
12#include <imtoas/CSchema.h>
13#include <imtoas/CMediaType.h>
14
15
16namespace imtoas
17{
18
19
20class CParameter
21{
22public:
23 CParameter();
24
25 [[nodiscard]] QString GetName() const;
26 void SetName(const QString& name);
27
28 [[nodiscard]] QString GetIn() const;
29 void SetIn(const QString& in);
30
31 [[nodiscard]] QString GetDescription() const;
32 void SetDescription(const QString& description);
33
34 [[nodiscard]] bool IsRequired() const;
35 void SetRequired(bool required = true);
36
37 [[nodiscard]] bool IsDeprecated() const;
38 void SetDeprecated(bool deprecated = true);
39
40 [[nodiscard]] bool IsAllowEmptyValue() const;
41 void SetAllowEmptyValue(bool allowEmptyValue = true);
42
43 [[nodiscard]] QString GetStyle() const;
44 void SetStyle(const QString& style);
45
46 [[nodiscard]] bool IsExplode() const;
47 void SetExplode(bool explode = true);
48
49 [[nodiscard]] bool IsAllowReserved() const;
50 void SetAllowReserved(bool allowReserved = true);
51
52 [[nodiscard]] CSchema GetSchema() const;
53 void SetSchema(const CSchema& schema);
54
55 [[nodiscard]] CMediaType GetContent() const;
56 void SetContent(const CMediaType& content);
57
58 [[nodiscard]] static bool ReadFromJsonObject(CParameter& object, const QJsonObject& jsonObject, const QJsonObject& globalObject);
59
60 bool operator==(const CParameter& other) const;
61 bool operator!=(const CParameter& other) const { return !(operator==(other)); }
62
63 [[nodiscard]] QString GetId() const;
64 void SetId(const QString& id);
65
66private:
67 QString m_id;
68 QString m_name;
69 QString m_in;
70 QString m_description;
71 bool m_isRequired;
72 bool m_isDeprecated;
73 bool m_isAllowEmptyValue;
74 QString m_style;
75 bool m_isExplode;
76 bool m_isAllowReserved;
77 CSchema m_schema;
78 CMediaType m_content;
79};
80
81
82} // namespace imtoas
83
84
85Q_DECLARE_METATYPE(imtoas::CParameter);
86
87