Kgapi

gender.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 gender.
29 *
30 * @see https://developers.google.com/people/api/rest/v1/people#gender
31 * @since 5.23.0
32 **/
33class KGAPIPEOPLE_EXPORT Gender
34{
35public:
36 /** Constructs a new Gender **/
37 explicit Gender();
38 Gender(const Gender &);
39 Gender(Gender &&) noexcept;
40 Gender &operator=(const Gender &);
41 Gender &operator=(Gender &&) noexcept;
42 /** Destructor. **/
44
45 bool operator==(const Gender &) const;
46 bool operator!=(const Gender &) const;
47
48 [[nodiscard]] static Gender fromJSON(const QJsonObject &);
49 [[nodiscard]] static QList<Gender> fromJSONArray(const QJsonArray &data);
50 [[nodiscard]] QJsonValue toJSON() const;
51
52 /** Metadata about the gender. **/
53 [[nodiscard]] FieldMetadata metadata() const;
54 /** Sets value of the metadata property. **/
55 void setMetadata(const FieldMetadata &value);
56
57 /** Output only. The value of the gender translated and formatted in the viewer's account locale or the `Accept-Language` HTTP header locale. Unspecified or
58 * custom value are not localized. **/
59 [[nodiscard]] QString formattedValue() const;
60
61 /** The gender for the person. The gender can be custom or one of these predefined values: * `male` * `female` * `unspecified` **/
62 [[nodiscard]] QString value() const;
63 /** Sets value of the value property. **/
64 void setValue(const QString &value);
65
66 /** Free form text field for pronouns that should be used to address the person. Common values are: * `he`/`him` * `she`/`her` * `they`/`them` **/
67 [[nodiscard]] QString addressMeAs() const;
68 /** Sets value of the addressMeAs property. **/
69 void setAddressMeAs(const QString &value);
70
71private:
72 class Private;
74}; // Gender
75
76} // namespace KGAPI2::People
Metadata about a field.
A person's gender.
Definition gender.h:34
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 3 2024 11:50:41 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.