#ifndef SYNCHRONIZER_H
#define SYNCHRONIZER_H

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

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

    virtual bool initialize(const Account &account) = 0;
    virtual bool syncFolder(const Folder &folder) = 0;
    virtual QVector<Folder> getFolders() const = 0;
    virtual QVector<MailItem> fetchMailItems(const QString &folderId, qint64 sinceUid = 0) = 0;
    virtual bool appendMailItem(const QString &folderId, const MailItem &item) = 0;
    virtual bool updateMailItemFlags(const QString &folderId, const QString &itemUid, bool read, bool flagged) = 0;
    virtual bool deleteMailItem(const QString &folderId, const QString &itemUid) = 0;

protected:
    Account m_account;
};

#endif // SYNCHRONIZER_H