#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QComboBox>
#include <QWidgetAction>
// #include <QFileInfo>

#include "DockManager.h"
#include "DockAreaWidget.h"
#include "DockWidget.h"

#include "QDetailsView.h"
#include "graphicsItem/graphicsBaseItem.h"

QT_BEGIN_NAMESPACE
namespace Ui { class CMainWindow; }
QT_END_NAMESPACE

class QGraphicsItem;
class Document;
class DrawingPanel;
class GraphicElementsPanel;
class DesignerScene;

class CMainWindow : public QMainWindow
{
    Q_OBJECT

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

protected:
	virtual void closeEvent(QCloseEvent* event) override;
    virtual void changeEvent(QEvent* event) override;

private:
    void initializeDockUi();
    void initializeAction();
    bool maybeSave();
    void updateWindowTitle();

private slots:
    void onAction_new();
    void onAction_open();
    void onAction_save();
    void onAction_saveAs();
    void onAction_zoomIn();
    void onAction_zoomOut();
    void onAction_zoomFit();
    void onAction_createGroup();
    void onAction_destroyGroup();
    void onSignal_addItem(QGraphicsItem*);
    void onSignal_deleteItem();
    void onSignal_selectionChanged();

private:
	QAction*       m_pSavePerspectiveAction = nullptr;
	QWidgetAction* m_pPerspectiveListAction = nullptr;
	QComboBox*     m_pPerspectiveComboBox   = nullptr;

    Document*      m_pDocument;

    Ui::CMainWindow *ui;

    ads::CDockManager*     m_pDockManager;
    ads::CDockAreaWidget*  m_pStatusDockArea;
    ads::CDockWidget*      m_pTimelineDockWidget;

    DrawingPanel*          m_pDrawingPanel;
    GraphicElementsPanel*  m_pGraphicElementsPanel;
    QDetailsView*          m_pPropertiesEditorView;
};
#endif // MAINWINDOW_H
