File indexing completed on 2024-05-12 05:22:26

0001 /*
0002  * SPDX-FileCopyrightText: 2021 Daniel Vrátil <dvratil@kde.org>
0003  * SPDX-FileCopyrightText: 2022 Claudio Cambra <claudio.cambra@kde.org>
0004  *
0005  * SPDX-License-Identifier: LGPL-2.1-only
0006  * SPDX-License-Identifier: LGPL-3.0-only
0007  * SPDX-License-Identifier: LicenseRef-KDE-Accepted-LGPL
0008  */
0009 
0010 #pragma once
0011 
0012 #include <QSharedDataPointer>
0013 #include "kgapipeople_export.h"
0014 
0015 #include <QString>
0016 
0017 #include <optional>
0018 
0019 class QJsonObject;
0020 class QJsonValue;
0021 class QJsonArray;
0022 
0023 namespace KGAPI2::People
0024 {
0025 class FieldMetadata;
0026 
0027 /**
0028  * A person's cover photo. A large image shown on the person's profile page that
0029  * represents who they are or what they care about.
0030  *
0031  * @see https://developers.google.com/people/api/rest/v1/people#coverphoto
0032  * @since 5.23.0
0033  **/
0034 class KGAPIPEOPLE_EXPORT CoverPhoto
0035 {
0036 public:
0037     /** Constructs a new CoverPhoto **/
0038     explicit CoverPhoto();
0039     CoverPhoto(const CoverPhoto &);
0040     CoverPhoto(CoverPhoto &&) noexcept;
0041     CoverPhoto &operator=(const CoverPhoto &);
0042     CoverPhoto &operator=(CoverPhoto &&) noexcept;
0043     /** Destructor. **/
0044     ~CoverPhoto();
0045 
0046     bool operator==(const CoverPhoto &) const;
0047     bool operator!=(const CoverPhoto &) const;
0048 
0049     [[nodiscard]] static CoverPhoto fromJSON(const QJsonObject &obj);
0050     [[nodiscard]] static QList<CoverPhoto> fromJSONArray(const QJsonArray &data);
0051     [[nodiscard]] QJsonValue toJSON() const;
0052 
0053     /** True if the cover photo is the default cover photo; false if the cover photo is a user-provided cover photo. **/
0054     [[nodiscard]] bool isDefault() const;
0055     /** Sets value of the isDefault property. **/
0056     void setIsDefault(bool value);
0057 
0058     /** Metadata about the cover photo. **/
0059     [[nodiscard]] FieldMetadata metadata() const;
0060     /** Sets value of the metadata property. **/
0061     void setMetadata(const FieldMetadata &value);
0062 
0063     /** The URL of the cover photo. **/
0064     [[nodiscard]] QString url() const;
0065     /** Sets value of the url property. **/
0066     void setUrl(const QString &value);
0067 
0068 private:
0069     class Private;
0070     QSharedDataPointer<Private> d;
0071 }; // CoverPhoto
0072 
0073 } // namespace KGAPI2::People