#ifndef AUTOTESTS_WINDOWS_STUB_NOTIFICATION_MODEL_H
#define AUTOTESTS_WINDOWS_STUB_NOTIFICATION_MODEL_H

#include <QAbstractListModel>
#include <QDateTime>

namespace UkuiNotification {

struct TestNotificationData
{
    uint id = 0;
    QString appName;
    bool noFold = false;
    bool isStored = false;
    bool showOnLockScreen = true;
    QString summary;
    QString body;
    int urgency = 0;
    QDateTime createTime;
};

class NotificationItem
{
    Q_GADGET
public:
    enum Property {
        Id = 0,
        Display,
        AppName,
        AppIconName,
        Icon,
        Summary,
        Body,
        Category,
        Image,
        CreateTime,
        Actions,
        ActionState,
        HasDefaultAction,
        EnableActionIcons,
        SoundFile,
        SuppressSound,
        Resident,
        Transient,
        Urgency,
        Timout,
        NoFold,
        PopupTimeout,
        ToBeStored,
        IsStored,
        IsExpired,
        GroupIndex,
        GroupName,
        GroupCount,
        GroupIsExpand,
        ShowOnLockScreen,
        ShowContentOnLockScreen,
        ProcessedBody,
        DelayRemove
    };
    Q_ENUM(Property)
};

class NotificationModel : public QAbstractListModel
{
    Q_OBJECT
public:
    static NotificationModel *instance();

    int rowCount(const QModelIndex &parent) const override;
    QVariant data(const QModelIndex &index, int role) const override;
    QHash<int, QByteArray> roleNames() const override;

    void removeNotification(uint id);
    void setItems(const QList<TestNotificationData> &items);
    void reset();
    QList<uint> removedIds() const;
    int getUnreadMessageCount() const;
    void storePopupNotification(bool store);

private:
    explicit NotificationModel(QObject *parent = nullptr);

    QList<TestNotificationData> m_items;
    QList<uint> m_removedIds;

Q_SIGNALS:
    void unreadMessageCountChanged();
};

} // namespace UkuiNotification

#endif
