#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QMouseEvent>
#include <QProcess>

#include "../launcher/launcher.h"
#include "../backend/backend.h"
#include "../settings/settings.h"



QT_BEGIN_NAMESPACE
namespace Ui {
class MainWindow;
}
QT_END_NAMESPACE

class MainWindow : public QMainWindow {
	Q_OBJECT

public:
	MainWindow(QWidget *parent = nullptr);
	~MainWindow();
	Settings *settings;
	Ui::MainWindow *ui;

protected:
	void mousePressEvent(QMouseEvent *event) override;
	void mouseMoveEvent(QMouseEvent *event) override;
	void mouseReleaseEvent(QMouseEvent *event) override;

private slots:
	void on_start_btn_clicked();
	void on_auth_login_btn_clicked();
	void on_settings_btn_clicked();
	void on_settings_back_btn_clicked();
	void on_logout_btn_clicked();
	void on_settings_apply_btn_clicked();
	void on_selected_profile_currentTextChanged(QString text);


private:
	QProcess *process;
	Launcher *launcher;
	Backend *backend;

	bool isDragging = false;
	QPoint dragStartPosition;
	QString username;
    QString uuid;
    QString access_token;
	QJsonObject json_settings;
};
#endif
