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 <QSharedDataPointer>
0016 
0017 {{ dependencies.render_includes(schema.dependencies, True, True, False) }}
0018 
0019 #include <optional>
0020 
0021 class QJsonObject;
0022 class QJsonValue;
0023 
0024 namespace KGAPI2::{{ api.namespace }} {
0025 
0026 {{ dependencies.render_forward_declarations(schema.dependencies) }}
0027 
0028 /**
0029  * {{ schema.description | wordwrap(80) | replace('\n', '\n * ') }}
0030  *
0031  * @see {{ api.reference_base_uri }}#{{ schema.name | lower }}
0032 {%- if api.since %}
0033  * @since {{ api.since }}
0034 {%- endif %}
0035  **/
0036 class {{ api.export_macro }} {{ schema.name }} {
0037 public:
0038     {{ dependencies.render_enums_declarations(schema.nested_enums) }}
0039 
0040     /** Constructs a new {{ schema.name }} **/
0041     explicit {{ schema.name }}();
0042     {{ schema.name }}(const {{ schema.name }} &);
0043     {{ schema.name }}({{ schema.name }} &&) noexcept;
0044     {{ schema.name }} &operator=(const {{ schema.name }} &);
0045     {{ schema.name }} &operator=({{ schema.name }} &&) noexcept;
0046     /** Destructor. **/
0047     ~{{ schema.name }}();
0048 
0049     bool operator==(const {{ schema.name }} &) const;
0050     bool operator!=(const {{ schema.name }} &) const;
0051 
0052     static {{ schema.name }} fromJSON(const QJsonObject &);
0053     QJsonValue toJSON() const;
0054 
0055     {{ properties.render_accessors_declarations(schema.properties) }}
0056 
0057 private:
0058     class Private;
0059     QSharedDataPointer<Private> d;
0060 }; // {{ schema.name }}
0061 
0062 } // namespace KGAPI2::{{ api.namespace }}