#ifndef EDITORPAGE_H
#define EDITORPAGE_H

#include "tab_docs.h"
#include "dialog.h"
#include <QMainWindow>
#include <QtWidgets>

class Editor_class : public QMainWindow
{
    Q_OBJECT
private:

    QTabWidget* f_tabWid;
    unsigned int f_newTabsCount;
    QSignalMapper* f_sigMapper;
    QDockWidget* f_dockFileSysWid;
    QDockWidget* f_dockTabsWid;
    QTreeView* f_treeFileSysView;
    QListView* f_tableTabsView;

    QFileSystemModel* f_sysModel;
    QStringListModel* f_strListModel;
    QStringList f_openedTabsNames;
    QStringList f_openedTabsDirectories;
    QStringList f_codeExtensions;
    QString f_newTabName;
    int f_amountOfChanged;

protected:
    void closeEvent(QCloseEvent *event);

private:
    tabDoc* createNewDocument();
    void getExtensionsFromIni();

public slots:
    void sltNewDocument();
    void sltOpen();
    void sltOpenIdx(const QModelIndex&);
    void sltSave();
    void sltTabs() const;
    void sltSetActiveTab(QWidget*);
    void sltSetActiveTab(const QModelIndex&);
    void sltFileBrowser() const;
    void sltOnClose();
    void sltCopy() const;
    void sltCut() const;
    void sltPaste() const;
    void sltDelete() const;
    void sltSelectAll() const;
    void sltSaveAs();
    void sltSaveAll();
    void sltClose();
    void sltCloseIdx(int);
    bool sltCloseAll();
    void sltChangeTabTitle(const QString&, const QString&);
    void sltFileChanged(const QString&);

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


};
#endif // EDITORPAGE_H
