#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QTimer>

#include "VsView.h"
#include "VsStream.h"

#include "global.h"

QT_BEGIN_NAMESPACE
namespace Ui
{
    class MainWindow;
    class SavePathWidget;
}
QT_END_NAMESPACE

class PEViewQt;

class TreeItem;
class TreeModel;

class QMenu;
class QAction;

class SavePathWidget;

class MainWindow : public QMainWindow
{
    Q_OBJECT

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


protected:
    void dragEnterEvent(QDragEnterEvent *e);
    void dropEvent(QDropEvent *e);

private:
    void initUI();
    void connects();

private slots:
    void addBall();
    void openVisFile();

    void quitProgram();

    void showHideNodeTree();

    void slotActionTriggered(QAction *action);
    void showMenu(const QPoint& point);

private:
    void peNodeRecurse(VsDatabase* node, TreeItem* parentItem);
    void debugInfo(VsDatabase* node);

    void loadVisFile(const QString& fileName);

private:
    Ui::MainWindow *ui;
    PEViewQt* mView;

    SavePathWidget* mSaveWidget;

    TreeItem* rootItem;
    TreeModel* mTreeModel;

    Param mParam;

    QMenu* mMenu;
    QAction* mPosAction;
    QAction* mConvertFbxAction;
};
#endif // MAINWINDOW_H
