File indexing completed on 2024-05-12 05:22:27
0001 /* 0002 * SPDX-FileCopyrightText: 2021 Daniel Vrátil <dvratil@kde.org> 0003 * SPDX-FileCopyrightText: 2022 Claudio Cambra <claudio.cambra@kde.org> 0004 * 0005 * SPDX-License-Identifier: LGPL-2.1-only 0006 * SPDX-License-Identifier: LGPL-3.0-only 0007 * SPDX-License-Identifier: LicenseRef-KDE-Accepted-LGPL 0008 */ 0009 0010 #pragma once 0011 0012 #include <QSharedDataPointer> 0013 #include "kgapipeople_export.h" 0014 0015 #include <QString> 0016 0017 #include <optional> 0018 0019 class QJsonObject; 0020 class QJsonValue; 0021 class QJsonArray; 0022 0023 namespace KGAPI2::People 0024 { 0025 class FieldMetadata; 0026 struct ImClientDefinition; 0027 0028 /** 0029 * A person's instant messaging client. 0030 * 0031 * @see https://developers.google.com/people/api/rest/v1/people#imclient 0032 * @since 5.23.0 0033 **/ 0034 class KGAPIPEOPLE_EXPORT ImClient 0035 { 0036 public: 0037 /** Constructs a new ImClient **/ 0038 explicit ImClient(); 0039 ImClient(const ImClientDefinition &definition); 0040 ImClient(const ImClient &); 0041 ImClient(ImClient &&) noexcept; 0042 ImClient &operator=(const ImClient &); 0043 ImClient &operator=(ImClient &&) noexcept; 0044 /** Destructor. **/ 0045 ~ImClient(); 0046 0047 bool operator==(const ImClient &) const; 0048 bool operator!=(const ImClient &) const; 0049 0050 [[nodiscard]] static ImClient fromJSON(const QJsonObject &); 0051 [[nodiscard]] static QList<ImClient> fromJSONArray(const QJsonArray &data); 0052 [[nodiscard]] QJsonValue toJSON() const; 0053 0054 /** The protocol of the IM client. The protocol can be custom or one of these predefined values: * `aim` * `msn` * `yahoo` * `skype` * `qq` * `googleTalk` * 0055 * `icq` * `jabber` * `netMeeting` **/ 0056 [[nodiscard]] QString protocol() const; 0057 /** Sets value of the protocol property. **/ 0058 void setProtocol(const QString &value); 0059 0060 /** The user name used in the IM client. **/ 0061 [[nodiscard]] QString username() const; 0062 /** Sets value of the username property. **/ 0063 void setUsername(const QString &value); 0064 0065 /** The type of the IM client. The type can be custom or one of these predefined values: * `home` * `work` * `other` **/ 0066 [[nodiscard]] QString type() const; 0067 /** Sets value of the type property. **/ 0068 void setType(const QString &value); 0069 0070 /** Metadata about the IM client. **/ 0071 [[nodiscard]] FieldMetadata metadata() const; 0072 /** Sets value of the metadata property. **/ 0073 void setMetadata(const FieldMetadata &value); 0074 0075 /** Output only. The type of the IM client translated and formatted in the viewer's account locale or the `Accept-Language` HTTP header locale. **/ 0076 [[nodiscard]] QString formattedType() const; 0077 0078 /** Output only. The protocol of the IM client formatted in the viewer's account locale or the `Accept-Language` HTTP header locale. **/ 0079 [[nodiscard]] QString formattedProtocol() const; 0080 0081 private: 0082 class Private; 0083 QSharedDataPointer<Private> d; 0084 }; // ImClient 0085 0086 } // namespace KGAPI2::People