Kgapi

coverphoto.h
1/*
2 * SPDX-FileCopyrightText: 2021 Daniel Vrátil <dvratil@kde.org>
3 * SPDX-FileCopyrightText: 2022 Claudio Cambra <claudio.cambra@kde.org>
4 *
5 * SPDX-License-Identifier: LGPL-2.1-only
6 * SPDX-License-Identifier: LGPL-3.0-only
7 * SPDX-License-Identifier: LicenseRef-KDE-Accepted-LGPL
8 */
9
10#pragma once
11
12#include <QSharedDataPointer>
13#include "kgapipeople_export.h"
14
15#include <QString>
16
17#include <optional>
18
19class QJsonObject;
20class QJsonValue;
21class QJsonArray;
22
23namespace KGAPI2::People
24{
25class FieldMetadata;
26
27/**
28 * A person's cover photo. A large image shown on the person's profile page that
29 * represents who they are or what they care about.
30 *
31 * @see https://developers.google.com/people/api/rest/v1/people#coverphoto
32 * @since 5.23.0
33 **/
34class KGAPIPEOPLE_EXPORT CoverPhoto
35{
36public:
37 /** Constructs a new CoverPhoto **/
38 explicit CoverPhoto();
39 CoverPhoto(const CoverPhoto &);
40 CoverPhoto(CoverPhoto &&) noexcept;
41 CoverPhoto &operator=(const CoverPhoto &);
42 CoverPhoto &operator=(CoverPhoto &&) noexcept;
43 /** Destructor. **/
45
46 bool operator==(const CoverPhoto &) const;
47 bool operator!=(const CoverPhoto &) const;
48
49 [[nodiscard]] static CoverPhoto fromJSON(const QJsonObject &obj);
50 [[nodiscard]] static QList<CoverPhoto> fromJSONArray(const QJsonArray &data);
51 [[nodiscard]] QJsonValue toJSON() const;
52
53 /** True if the cover photo is the default cover photo; false if the cover photo is a user-provided cover photo. **/
54 [[nodiscard]] bool isDefault() const;
55 /** Sets value of the isDefault property. **/
56 void setIsDefault(bool value);
57
58 /** Metadata about the cover photo. **/
59 [[nodiscard]] FieldMetadata metadata() const;
60 /** Sets value of the metadata property. **/
61 void setMetadata(const FieldMetadata &value);
62
63 /** The URL of the cover photo. **/
64 [[nodiscard]] QString url() const;
65 /** Sets value of the url property. **/
66 void setUrl(const QString &value);
67
68private:
69 class Private;
71}; // CoverPhoto
72
73} // namespace KGAPI2::People
A person's cover photo.
Definition coverphoto.h:35
Metadata about a field.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:00:12 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.