diff options
Diffstat (limited to 'lib/application-service/definitions/protocol.h')
-rw-r--r-- | lib/application-service/definitions/protocol.h | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/lib/application-service/definitions/protocol.h b/lib/application-service/definitions/protocol.h new file mode 100644 index 00000000..d4124779 --- /dev/null +++ b/lib/application-service/definitions/protocol.h @@ -0,0 +1,71 @@ +/****************************************************************************** + * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN + */ + +#pragma once + + +#include <QtCore/QJsonObject> +#include <QtCore/QVector> +#include "converters.h" + +#include "converters.h" + +namespace QMatrixClient +{ + // Data structures + + /// Definition of valid values for a field. + struct FieldType + { + /// A regular expression for validation of a field's value. + QString regexp; + /// An placeholder serving as a valid example of the field value. + QString placeholder; + }; + + QJsonObject toJson(const FieldType& pod); + + template <> struct FromJson<FieldType> + { + FieldType operator()(const QJsonValue& jv); + }; + + /// All location or user fields should have an entry here. + struct FieldTypes + { + /// Definition of valid values for a field. + Omittable<FieldType> fieldname; + }; + + QJsonObject toJson(const FieldTypes& pod); + + template <> struct FromJson<FieldTypes> + { + FieldTypes operator()(const QJsonValue& jv); + }; + + struct Protocol + { + /// Fields used to identify a third party user. + QStringList userFields; + /// Fields used to identify a third party location. + QStringList locationFields; + /// An icon representing the third party protocol. + QString icon; + /// All location or user fields should have an entry here. + Omittable<FieldTypes> fieldTypes; + /// A list of objects representing independent instances of configuration. + /// For instance multiple networks on IRC if multiple are bridged by the + /// same bridge. + QVector<QJsonObject> instances; + }; + + QJsonObject toJson(const Protocol& pod); + + template <> struct FromJson<Protocol> + { + Protocol operator()(const QJsonValue& jv); + }; + +} // namespace QMatrixClient |