#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QDebug>
#include <QListWidgetItem>
#include <QCloseEvent>
#include <QGraphicsScene>

#include "alienmodel.h"
#include "towermodel.h"
#include "splashmodel.h"
#include "triggermodel.h"
#include "mapmodel.h"
#include "animationmodel.h"
#include "animlabel.h"
#include "wavemodel.h"

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow {
    Q_OBJECT
public:
    MainWindow(QWidget *parent = 0);
    ~MainWindow();

protected:
    void changeEvent(QEvent *e);

private:
    Ui::MainWindow *ui;
    Loader * adloader;
    AlienModel * alModel;
    TowerModel * twModel;
    SplashModel * splModel;
    TriggerModel* trigModel;
    MapModel * mapModel;
    AnimationModel * animModel;
    WavePartModel * wavePartModel;
    WaveModel * waveModel;
    QGraphicsScene * mapScene;

    //AnimLabel * alb;

    bool isSaved;

    void refresh_lwImages(QStringList pathes);
    void closeEvent(QCloseEvent *);
private slots:
    void on_pbAnimDel_clicked();
    void on_cbSplImage_currentIndexChanged(int index);
    void on_cbTwImage_currentIndexChanged(int index);
    void on_cbAlImage_currentIndexChanged(int index);
    void on_pbAnimAdd_clicked();
    void on_pbImgDel_clicked();
    void on_pbImgAdd_clicked();
    void on_cbTrigChildAim_currentIndexChanged(int index);
    void on_cbTrigType_currentIndexChanged(int index);
    void on_cbTrigCount_toggled(bool checked);
    void on_leTrigName_editingFinished();
    void on_pbTwSplashEdit_clicked();
    void on_cbTrigDamRad_toggled(bool checked);
    void on_cbTrigDamage_toggled(bool checked);
    void on_cbTrigDelPar_toggled(bool checked);
    void on_cbTrigChance_toggled(bool checked);
    void on_cbTrigRandRadius_toggled(bool checked);
    void on_cbTwExpByKill_toggled(bool checked);
    void on_cbTwExpByDam_toggled(bool checked);
    void on_cbTwExpByShot_toggled(bool checked);
    void on_cbAlIsFly_toggled(bool checked);
    void on_pbTrigDel_clicked();
    void on_pbTrigAdd_clicked();
    void on_sbTrigChance_valueChanged(int );
    void on_sbTrigDamRadius_valueChanged(double );
    void on_sbTrigDamage_valueChanged(double );
    void on_sbTrigTimer_valueChanged(int );
    void on_sbTrigRandomRadius_valueChanged(double );
    void on_sbTrigCount_valueChanged(int );
    void on_pbReload_clicked();
    void on_pbSlpDel_clicked();
    void on_pbSplAdd_clicked();
    void on_sbSplLifeTime_valueChanged(int );
    void on_cbSplAutoControl_toggled(bool checked);
    void on_sbSplSpeed_valueChanged(double );
    void on_leSplName_editingFinished();
    void on_pbTwDel_clicked();
    void on_sbTwExpByKill_valueChanged(double );
    void on_sbTwExpByDam_valueChanged(double );
    void on_sbTwExpByShot_valueChanged(double );
    void on_sbTwRadius_valueChanged(double );
    void on_sbTwReload_valueChanged(int );
    void on_cbTwSplash_currentIndexChanged(int index);
    void on_sbTwCost_valueChanged(int );
    void on_sbTwBuildTime_valueChanged(int );
    void on_pbTwAdd_clicked();
    void on_leTwName_editingFinished();
    void on_pbAlDel_clicked();
    void on_pbAlAdd_clicked();
    void on_leAlName_editingFinished();
    void on_sbAlScore_valueChanged(int );
    void on_sbAlPrise_valueChanged(int );
    void on_sbAlSpeed_valueChanged(double );
    void on_sbAlregeneration_valueChanged(double );
    void on_sbAlArmor_valueChanged(double );
    void on_sbAlHealth_valueChanged(double );
    void on_pbSave_clicked();
    void lvAliens_select(QModelIndex, QModelIndex);
    void lvAnimations_select(QModelIndex, QModelIndex);
    void lvTowers_select(QModelIndex, QModelIndex);
    void lvSplashes_select(QModelIndex, QModelIndex);
    void lvTriggers_select(QModelIndex, QModelIndex);
    void lvMaps_select(QModelIndex, QModelIndex);
    void tbWavePartSelect(QModelIndex, QModelIndex);
    void on_cbAlRegeneration_toggled(bool checked);
    void on_cbAlArmor_toggled(bool checked);
    void on_cbSplCompisitionMode_currentIndexChanged(const QString &arg1);
    void on_sbSplZValue_valueChanged(double arg1);
    void on_sbSplAnimSpeed_valueChanged(double arg1);
    void on_cbSplKeepOnAlien_toggled(bool checked);
    void on_btWaveAddAlien_clicked();
    void on_btWaveRemoveAlien_clicked();
    void on_btWaveClear_clicked();
    void on_pbWaveAdd_clicked();
    void on_pbWaveDel_clicked();
    void on_pbWaveCopy_clicked();
    void on_btWaveUp_clicked();
    void on_btWaveDown_clicked();
};

#endif // MAINWINDOW_H
