#ifndef CHANGEPROCESSOR_H
#define CHANGEPROCESSOR_H

#include <QObject>
#include <QVector>
#include "changetype.h"
#include "core/mailitem.h"
#include "core/models/folder.h"
#include "core/models/account.h"

class ChangeProcessor : public QObject
{
    Q_OBJECT
public:
    explicit ChangeProcessor(QObject *parent = nullptr);
    ~ChangeProcessor() override = default;

    void processMailItemAdded(const QString &accountId, const MailItem &item);
    void processMailItemUpdated(const QString &accountId, const MailItem &item);
    void processMailItemDeleted(const QString &accountId, const QString &mailItemId);
    void processFolderAdded(const QString &accountId, const Folder &folder);
    void processFolderDeleted(const QString &accountId, const QString &folderId);
    void processAccountAdded(const Account &account);
    void processAccountRemoved(const QString &accountId);

signals:
    void changeProcessed(ChangeType type, const QString &accountId, const QVariant &data);
    void mailItemsChanged(const QString &accountId, const QString &folderId);
};

#endif // CHANGEPROCESSOR_H
