#ifndef WIDGETMANAGER_H
#define WIDGETMANAGER_H

#include "mainwindow.h"

#include <Widgets/commonbuttongroupwidget.h>
#include <Widgets/entrywidget.h>
#include <Widgets/instructorbuttongroupwidget.h>
#include <Widgets/updatenotifywidget.h>
#include <Widgets/waitanimationwidget.h>
#include <Core/notifycontroller.h>
#include <QObject>
#include <QWidget>

class WidgetManager : public QObject
{
    Q_OBJECT
public:
    explicit WidgetManager(QObject *parent = nullptr);

    void initialize();
    MainWindow *getMainWindow() const;
    UpdateNotifyWidget *getUpdateWidget() const;
    CommonButtonGroupWidget *getCommonButtonGroupWidget() const;
    EntryWidget *getEntryWidget() const;
    WaitAnimationWidget *getWaitAnimationWidget() const;
    InstructorButtonGroupWidget *getInstructorButtonGroupWiget() const;
    NotifyController *getNotifyController() const;


    void setLostConnectionState();
    void setLoginSuccess();
    void setLoginFailed();
    void showUpdateInfo();
    void setLoadCompleteState();
    void setNeedUpdateState(quint64 size, quint64 fileCount,quint64 deleteCount);
    void setRecoveryState();
    void setLastVersionState();
    void activateLoadingAnimation(bool flag);
    void setCompeteState();
    void setConnectionState(bool isConnected);
    void setServerDisconnectState();
    void setSendFileToServerState();
    void start();

    void setUndoCurrentChangesState();
    void showMainFrame(bool flag);
    void setAppAvailable(bool isAvailable);
    void slotInlineDebug(const QString &text);
public slots:
    void showSettings(bool isActive);
    void slotSetLoadSettings(ServerSettings *settings);
    void slotActivateLoadAnimation(bool flag);
signals:

private:
    MainWindow *mainWindow;
    UpdateNotifyWidget *updateWidget;
    CommonButtonGroupWidget *commonButtonGroupWidget;
    EntryWidget *entryWidget;
    WaitAnimationWidget *waitAnimationWidget;
    InstructorButtonGroupWidget *instructorButtonGroupWiget;
    NotifyController *notifyController;

    void binding();

};

#endif // WIDGETMANAGER_H
