/** * @RDE_HEADER@ * Gui Plugin for NotificationManangement * * Created by Mike Lennart Wille, ESZS, 2025-06-17 */ #pragma once #include #include #include #include #include #include namespace LtsNotification { class LtsNotification; } namespace NotificationManagement { class GuiPlugin final : public QObject , public GuiPluginBase::Plugin { Q_PLUGIN_METADATA(IID "gui:3:nom.edit") Q_INTERFACES(GuiPluginBase::Plugin) Q_OBJECT public: explicit GuiPlugin() = default; ~GuiPlugin() = default; QString pluginName() override { return QLatin1String("NotificationManagementGuiPlugin"); } std::shared_ptr createGuiInterface(LtsSession::LtsSession *session) override; bool availableInPartition(IDL::PartitionType partition) const override { return partition == IDL::PartitionType::Global || partition == IDL::PartitionType::Exercise; } }; class InterfaceImpl final : public QObject , public GuiPluginBase::Interface , protected NotificationManagement::Interface::Ftc::ReadReceiptReplyHandler { Q_OBJECT public: explicit InterfaceImpl(LtsSession::LtsSession *session); ~InterfaceImpl(); static const QString s_nomEditGuiPlugin; QVector getActions() override; QString menuGroup() const override { return tr("Notifications"); } bool fetchInterfaces() override; void clearInterfaces() override; bool availableInPartition(IDL::PartitionType partition) const override { return partition == IDL::PartitionType::Global || partition == IDL::PartitionType::Exercise; } static const QString s_participantInfoScheme; protected: void initNotificationSystem(); void onNotificationChanged(const NotificationManagement::NomNotification ¬i, DataModification modType); void onReadReceiptReply(const Core::FunctionReplyObject &replyObject) override final; private: int isDeleted(const NomNotification &data) const; LtsWidgets::LtsDialog *onShowNotificationManagementDialog(QWidget *parent); void ack(const NotificationManagement::NomNotification ¬ification); void updateUnreadCount(); bool parseContent(const QString &contentString, QMap &retMap); bool isMyMessage(const std::vector &recipents); bool eventFilter(QObject *watched, QEvent *event) override; void showNotificationList(int notificationId); QSet m_unreadMessages; LtsNotification::LtsNotification *m_noti; QHash m_nomNotifications; LtsUtils::RequestHelper *m_requestHelper; std::shared_ptr m_dtc; std::shared_ptr m_ftc; std::shared_ptr m_dtcOpm; std::shared_ptr m_nomGuiInterface; }; } // namespace NotificationManagement