/* * Copyright (c) 2010-2024 Belledonne Communications SARL. * * This file is part of linphone-desktop * (see https://www.linphone.org). * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef CONFERENCE_CORE_H_ #define CONFERENCE_CORE_H_ #include "core/participant/ParticipantCore.hpp" #include "core/participant/ParticipantDeviceCore.hpp" #include "core/participant/ParticipantDeviceGui.hpp" #include "core/participant/ParticipantGui.hpp" #include "model/conference/ConferenceModel.hpp" #include "tool/LinphoneEnums.hpp" #include "tool/thread/SafeConnection.hpp" #include #include #include #include class ConferenceCore : public QObject, public AbstractObject { Q_OBJECT public: Q_PROPERTY(QString subject READ getSubject NOTIFY subjectChanged) Q_PROPERTY(QDateTime startDate READ getStartDate CONSTANT) // Q_PROPERTY(ParticipantDeviceList *participantDevices READ getParticipantDeviceList CONSTANT) // Q_PROPERTY(ParticipantModel* localParticipant READ getLocalParticipant NOTIFY localParticipantChanged) Q_PROPERTY(bool isReady MEMBER mIsReady WRITE setIsReady NOTIFY isReadyChanged) Q_PROPERTY(int participantDeviceCount READ getParticipantDeviceCount NOTIFY participantDeviceCountChanged) Q_PROPERTY(ParticipantDeviceGui *activeSpeaker READ getActiveSpeakerGui NOTIFY activeSpeakerChanged) Q_PROPERTY(ParticipantGui *me READ getMeGui) // Should be call from model Thread. Will be automatically in App thread after initialization static QSharedPointer create(const std::shared_ptr &conference); ConferenceCore(const std::shared_ptr &conference); ~ConferenceCore(); void setSelf(QSharedPointer me); bool updateLocalParticipant(); // true if changed QString getSubject() const; QDateTime getStartDate() const; Q_INVOKABLE qint64 getElapsedSeconds() const; // Q_INVOKABLE ParticipantModel *getLocalParticipant() const; // ParticipantListModel *getParticipantListModel() const; // std::list> // getParticipantList() const; // SDK exclude me. We want to get ALL participants. // void getParticipantDeviceList() const; int getParticipantDeviceCount() const; ParticipantDeviceCore *getActiveSpeaker() const; ParticipantDeviceGui *getActiveSpeakerGui() const; ParticipantGui *getMeGui() const; void setActiveSpeaker(const QSharedPointer &device); void setIsReady(bool state); std::shared_ptr getModel() const; //--------------------------------------------------------------------------- signals: void subjectChanged(); void isReadyChanged(); void participantDeviceCountChanged(); void activeSpeakerChanged(); private: QSharedPointer> mConferenceModelConnection; std::shared_ptr mConferenceModel; QSharedPointer mActiveSpeaker; QSharedPointer mMe; int mParticipantDeviceCount = 0; bool mIsReady = false; QString mSubject; QDateTime mStartDate = QDateTime::currentDateTime(); DECLARE_ABSTRACT_OBJECT }; Q_DECLARE_METATYPE(ConferenceCore *) #endif