#ifndef SYNCHRONIZERPROVIDER_H
#define SYNCHRONIZERPROVIDER_H

#include <QObject>
#include <QHash>
#include "../services/synchronizer.h"

class SynchronizerProvider : public QObject
{
    Q_OBJECT
public:
    static SynchronizerProvider& instance();
    Synchronizer* getSynchronizer(const QString &accountId);
    void registerSynchronizer(const QString &accountId, Synchronizer *sync);
    void unregisterSynchronizer(const QString &accountId);
    
    Synchronizer* createSynchronizer(const QString &accountId, const QString &providerType);
    bool hasSynchronizer(const QString &accountId) const;
    QStringList activeAccountIds() const;
    
private:
    explicit SynchronizerProvider(QObject *parent = nullptr);
    QHash<QString, Synchronizer*> m_synchronizers;
};

#endif // SYNCHRONIZERPROVIDER_H
