/* * 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 EVENT_LOG_CORE_H_ #define EVENT_LOG_CORE_H_ #include "ChatMessageCore.hpp" #include "core/call-history/CallHistoryCore.hpp" #include "core/conference/ConferenceInfoCore.hpp" #include "core/conference/ConferenceInfoGui.hpp" #include "model/chat/message/ChatMessageModel.hpp" #include "tool/AbstractObject.hpp" #include "tool/LinphoneEnums.hpp" #include "tool/thread/SafeConnection.hpp" #include #include #include class ChatMessageCore; class ChatMessageGui; class EventLogModel; class EventLogCore : public QObject, public AbstractObject { Q_OBJECT Q_PROPERTY(LinphoneEnums::EventLogType type MEMBER mEventLogType CONSTANT) Q_PROPERTY(ChatMessageGui *chatMessageGui READ getChatMessageGui CONSTANT) // Q_PROPERTY(NotifyCore *notification MEMBER mNotifyCore CONSTANT) Q_PROPERTY(CallHistoryCore *callLog READ getCallHistoryCorePointer CONSTANT) Q_PROPERTY(bool important MEMBER mImportant CONSTANT) Q_PROPERTY(bool handled MEMBER mHandled CONSTANT) Q_PROPERTY(QString eventDetails MEMBER mEventDetails CONSTANT) Q_PROPERTY(QDateTime timestamp READ getTimestamp CONSTANT) public: static QSharedPointer create(const std::shared_ptr &eventLog); EventLogCore(const std::shared_ptr &eventLog); ~EventLogCore(); void setSelf(QSharedPointer me); QString getEventLogId(); QSharedPointer getChatMessageCore(); ChatMessageGui *getChatMessageGui(); QSharedPointer getCallHistoryCore(); QDateTime getTimestamp() const; bool isHandled() const { return mHandled; } bool isEphemeralRelated() const { return mEphemeralRelated; } std::shared_ptr getModel() const; private: DECLARE_ABSTRACT_OBJECT QString mEventId; QSharedPointer mChatMessageCore = nullptr; QSharedPointer mCallHistoryCore = nullptr; LinphoneEnums::EventLogType mEventLogType; bool mHandled = false; bool mImportant; bool mEphemeralRelated; QString mEventDetails; QDateTime mTimestamp; ChatMessageCore *getChatMessageCorePointer(); CallHistoryCore *getCallHistoryCorePointer(); std::shared_ptr mEventLogModel; void computeEvent(const std::shared_ptr &eventLog); }; #endif // EventLogCore_H_