File indexing completed on 2024-12-22 05:02:57
0001 {# 0002 SPDX-FileCopyrightText: 2021 Daniel Vrátil <dvratil@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.1-only 0005 SPDX-License-Identifier: LGPL-3.0-only 0006 SPDX-License-Identifier: LicenseRef-KDE-Accepted-LGPL 0007 #} 0008 0009 {% import 'macros/properties.j2' as properties -%} 0010 {% import 'macros/dependencies.j2' as dependencies -%} 0011 0012 #pragma once 0013 0014 #include <{{ api.export_macro | lower() }}.h> 0015 #include "object.h" 0016 0017 {{ dependencies.render_includes(schema.dependencies, True, True, False) }} 0018 0019 #include <QSharedPointer> 0020 0021 #include <optional> 0022 0023 class QJsonObject; 0024 class QJsonValue; 0025 0026 namespace KGAPI2::{{ api.namespace }} { 0027 0028 class {{ schema.name }}; 0029 using {{ schema.name }}Ptr = QSharedPointer<{{ schema.name }}>; 0030 0031 {{ dependencies.render_forward_declarations(schema.dependencies) }} 0032 0033 /** 0034 * {{ schema.description | wordwrap(80) | replace('\n', '\n * ') }} 0035 * 0036 * @see {{ api.reference_base_uri }}#{{ schema.name | lower }} 0037 {%- if api.since %} 0038 * @since {{ api.since }} 0039 {%- endif %} 0040 **/ 0041 class {{ api.export_macro }} {{ schema.name }} : public KGAPI2::Object { 0042 0043 public: 0044 {{ dependencies.render_enums_declarations(schema.nested_enums) }} 0045 0046 /** Construcuts a new {{ schema.name }} **/ 0047 explicit {{ schema.name }}(); 0048 /** Destructor. **/ 0049 ~{{ schema.name }}(); 0050 0051 bool operator==(const {{ schema.name }} &) const; 0052 bool operator!=(const {{ schema.name }} &) const; 0053 0054 {{ properties.render_accessors_declarations(schema.properties) }} 0055 0056 static {{ schema.name }}Ptr fromJSON(const QJsonObject &); 0057 QJsonValue toJSON() const; 0058 0059 private: 0060 class Private; 0061 std::unique_ptr<Private> d; 0062 }; // {{ schema.name }} 0063 0064 } // namespace KGAPI2::{{ api.namespace }}