Kgapi

imclient.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 ImClientDefinition;
27
28/**
29 * A person's instant messaging client.
30 *
31 * @see https://developers.google.com/people/api/rest/v1/people#imclient
32 * @since 5.23.0
33 **/
34class KGAPIPEOPLE_EXPORT ImClient
35{
36public:
37 /** Constructs a new ImClient **/
38 explicit ImClient();
39 ImClient(const ImClientDefinition &definition);
40 ImClient(const ImClient &);
41 ImClient(ImClient &&) noexcept;
42 ImClient &operator=(const ImClient &);
43 ImClient &operator=(ImClient &&) noexcept;
44 /** Destructor. **/
46
47 bool operator==(const ImClient &) const;
48 bool operator!=(const ImClient &) const;
49
50 [[nodiscard]] static ImClient fromJSON(const QJsonObject &);
51 [[nodiscard]] static QList<ImClient> fromJSONArray(const QJsonArray &data);
52 [[nodiscard]] QJsonValue toJSON() const;
53
54 /** The protocol of the IM client. The protocol can be custom or one of these predefined values: * `aim` * `msn` * `yahoo` * `skype` * `qq` * `googleTalk` *
55 * `icq` * `jabber` * `netMeeting` **/
56 [[nodiscard]] QString protocol() const;
57 /** Sets value of the protocol property. **/
58 void setProtocol(const QString &value);
59
60 /** The user name used in the IM client. **/
61 [[nodiscard]] QString username() const;
62 /** Sets value of the username property. **/
63 void setUsername(const QString &value);
64
65 /** The type of the IM client. The type can be custom or one of these predefined values: * `home` * `work` * `other` **/
66 [[nodiscard]] QString type() const;
67 /** Sets value of the type property. **/
68 void setType(const QString &value);
69
70 /** Metadata about the IM client. **/
71 [[nodiscard]] FieldMetadata metadata() const;
72 /** Sets value of the metadata property. **/
73 void setMetadata(const FieldMetadata &value);
74
75 /** Output only. The type of the IM client translated and formatted in the viewer's account locale or the `Accept-Language` HTTP header locale. **/
76 [[nodiscard]] QString formattedType() const;
77
78 /** Output only. The protocol of the IM client formatted in the viewer's account locale or the `Accept-Language` HTTP header locale. **/
79 [[nodiscard]] QString formattedProtocol() const;
80
81private:
82 class Private;
84}; // ImClient
85
86} // namespace KGAPI2::People
Metadata about a field.
A person's instant messaging client.
Definition imclient.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.