File indexing completed on 2024-05-12 16:25:57
0001 /* 0002 SPDX-FileCopyrightText: 2022-2024 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #pragma once 0008 0009 #include "libruqolacore_export.h" 0010 #include <QDebug> 0011 0012 class LIBRUQOLACORE_EXPORT VideoConference 0013 { 0014 Q_GADGET 0015 public: 0016 enum Action { 0017 Unknown, 0018 IncomingCall, 0019 Canceled, 0020 Confirmed, 0021 Accepted, 0022 Rejected, 0023 }; 0024 Q_ENUM(Action) 0025 0026 VideoConference(); 0027 ~VideoConference(); 0028 0029 [[nodiscard]] bool operator==(const VideoConference &other) const; 0030 0031 void parseVideoConference(const QJsonObject &content); 0032 [[nodiscard]] QString callId() const; 0033 void setCallId(const QString &newCallId); 0034 0035 [[nodiscard]] QString roomId() const; 0036 void setRoomId(const QString &newRoomId); 0037 0038 [[nodiscard]] QString userId() const; 0039 void setUserId(const QString &newUserId); 0040 0041 [[nodiscard]] bool isValid() const; 0042 0043 [[nodiscard]] Action action() const; 0044 void setAction(Action newAction); 0045 0046 private: 0047 [[nodiscard]] LIBRUQOLACORE_NO_EXPORT VideoConference::Action convertActionToEnum(const QString &str); 0048 QString mCallId; 0049 QString mRoomId; 0050 QString mUserId; 0051 Action mAction = Unknown; 0052 }; 0053 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) 0054 Q_DECLARE_METATYPE(VideoConference) 0055 #endif 0056 Q_DECLARE_TYPEINFO(VideoConference, Q_MOVABLE_TYPE); 0057 LIBRUQOLACORE_EXPORT QDebug operator<<(QDebug d, const VideoConference &t);