#ifndef ALERTITEM_H #define ALERTITEM_H #include #include "megaapi.h" #include #include namespace Ui { class AlertItem; } namespace UserAttributes{ class FullName; } class AlertItem : public QWidget { Q_OBJECT public: explicit AlertItem(QWidget *parent = 0); ~AlertItem(); void setAlertData(mega::MegaUserAlert *alert); void setAlertType(int type); void setAlertHeading(mega::MegaUserAlert *alert); void setAlertContent(mega::MegaUserAlert *alert); void setAlertTimeStamp(int64_t ts); QString getHeadingString(); QSize minimumSizeHint() const; QSize sizeHint() const; signals: void refreshAlertItem(unsigned item); protected: void changeEvent(QEvent *event); private slots: void onAttributesReady(); private: QString formatRichString(QString str); QString getUserFullName(mega::MegaUserAlert *alert); private: Ui::AlertItem *ui; mega::MegaApi *megaApi; QString mNotificationHeading; std::unique_ptr mAlertNode; std::unique_ptr mAlertUser; std::shared_ptr mFullNameAttributes; QFutureWatcher mAlertNodeWatcher; }; #endif // ALERTITEM_H