Kgapi

biography.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 short biography.
29 *
30 * @see https://developers.google.com/people/api/rest/v1/people#biography
31 * @since 5.23.0
32 **/
33class KGAPIPEOPLE_EXPORT Biography
34{
35public:
36 enum class ContentType {
37 CONTENT_TYPE_UNSPECIFIED, ///< Unspecified.
38 TEXT_PLAIN, ///< Plain text.
39 TEXT_HTML, ///< HTML text.
40 };
41
42 /** Constructs a new Biography **/
43 explicit Biography();
44 Biography(const Biography &);
45 Biography(Biography &&) noexcept;
46 Biography &operator=(const Biography &);
47 Biography &operator=(Biography &&) noexcept;
48 /** Destructor. **/
50
51 bool operator==(const Biography &) const;
52 bool operator!=(const Biography &) const;
53
54 [[nodiscard]] static Biography fromJSON(const QJsonObject &obj);
55 [[nodiscard]] static QList<Biography> fromJSONArray(const QJsonArray &data);
56 [[nodiscard]] QJsonValue toJSON() const;
57
58 /** Metadata about the biography. **/
59 [[nodiscard]] FieldMetadata metadata() const;
60 /** Sets value of the metadata property. **/
61 void setMetadata(const FieldMetadata &value);
62
63 /** The content type of the biography. **/
64 [[nodiscard]] Biography::ContentType contentType() const;
65 /** Sets value of the contentType property. **/
66 void setContentType(Biography::ContentType value);
67
68 /** The short biography. **/
69 [[nodiscard]] QString value() const;
70 /** Sets value of the value property. **/
71 void setValue(const QString &value);
72
73private:
74 class Private;
75 QSharedDataPointer<Private> d;
76}; // Biography
77
78} // namespace KGAPI2::People
A person's short biography.
Definition biography.h:34
Metadata about a field.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:36:13 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.