#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include "character.h"
#include "notepad.h"

#include <QMainWindow>

QT_BEGIN_NAMESPACE
namespace Ui {
class MainWindow;
}
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

    void loadImage(QString fileName);
    void createNewCharacter(Character* p);
    void loadNewCharacter();
    void saveJson();
    void saveAsJson();
    void getUi();
    void setUi(Character* p);

private slots:
    void on_actionEditer_triggered();
    void on_actionBlocNote_triggered();
    void on_actionOuvrir_une_fiche_triggered();
    void on_actionNouvelle_fiche_triggered();
    void on_actionSauvegarder_triggered();
    void on_actionEnregistrer_sous_triggered();
    void on_actionFermer_triggered();

    void recevoirSauvegarde(QString contenu);

private:
    Ui::MainWindow *ui;
    NotePad *notePad;

    bool edition = true;
    bool backPack = false;
    QString currentFile;
    QList<Character*> characters;
    Character* currentCharacter;
};
#endif // MAINWINDOW_H
