Kgapi

misckeyword.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;
26struct MiscKeywordDefinition;
27
28/**
29 * A person's miscellaneous keyword.
30 *
31 * @see https://developers.google.com/people/api/rest/v1/people#misckeyword
32 * @since 5.23.0
33 **/
34class KGAPIPEOPLE_EXPORT MiscKeyword
35{
36public:
37 enum class Type {
38 TYPE_UNSPECIFIED, ///< Unspecified.
39 OUTLOOK_BILLING_INFORMATION, ///< Outlook field for billing information.
40 OUTLOOK_DIRECTORY_SERVER, ///< Outlook field for directory server.
41 OUTLOOK_KEYWORD, ///< Outlook field for keyword.
42 OUTLOOK_MILEAGE, ///< Outlook field for mileage.
43 OUTLOOK_PRIORITY, ///< Outlook field for priority.
44 OUTLOOK_SENSITIVITY, ///< Outlook field for sensitivity.
45 OUTLOOK_SUBJECT, ///< Outlook field for subject.
46 OUTLOOK_USER, ///< Outlook field for user.
47 HOME, ///< Home.
48 WORK, ///< Work.
49 OTHER, ///< Other.
50 };
51
52 /** Constructs a new MiscKeyword **/
53 explicit MiscKeyword();
54 MiscKeyword(const MiscKeywordDefinition &definition);
55 MiscKeyword(const MiscKeyword &);
56 MiscKeyword(MiscKeyword &&) noexcept;
57 MiscKeyword &operator=(const MiscKeyword &);
58 MiscKeyword &operator=(MiscKeyword &&) noexcept;
59 /** Destructor. **/
61
62 bool operator==(const MiscKeyword &) const;
63 bool operator!=(const MiscKeyword &) const;
64
65 [[nodiscard]] static MiscKeyword fromJSON(const QJsonObject &);
66 [[nodiscard]] static QList<MiscKeyword> fromJSONArray(const QJsonArray &data);
67 [[nodiscard]] QJsonValue toJSON() const;
68
69 /** Metadata about the miscellaneous keyword. **/
70 [[nodiscard]] FieldMetadata metadata() const;
71 /** Sets value of the metadata property. **/
72 void setMetadata(const FieldMetadata &value);
73
74 /** The value of the miscellaneous keyword. **/
75 [[nodiscard]] QString value() const;
76 /** Sets value of the value property. **/
77 void setValue(const QString &value);
78
79 /** The miscellaneous keyword type. **/
80 [[nodiscard]] MiscKeyword::Type type() const;
81 /** Sets value of the type property. **/
82 void setType(MiscKeyword::Type value);
83
84 /** Output only. The type of the miscellaneous keyword translated and formatted in the viewer's account locale or the `Accept-Language` HTTP header locale.
85 * **/
86 [[nodiscard]] QString formattedType() const;
87
88private:
89 class Private;
90 QSharedDataPointer<Private> d;
91}; // MiscKeyword
92
93} // namespace KGAPI2::People
Metadata about a field.
A person's miscellaneous keyword.
Definition misckeyword.h:35
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.