#ifndef FRAGMENTSORDERVIEW_H
#define FRAGMENTSORDERVIEW_H

#include "DocsManager.h"
#include "appcore.h"
#include <QStandardItemModel>
#include <QTableView>
#include <QWidget>
#include <commandsdispatcher.h>
#include <libParse.h>

namespace DataModel {
    class FragmentsOrderviewModel : public Schedule::AccessibleObject {
      public:
        FragmentsOrderviewModel(Core::AppCore *core);

        void refreshTable();

        QStandardItemModel *tableModel() const;

      private:
        Core::AppCore *const core_ins;
        QStandardItemModel *const table_base;

        // AccessibleObject interface
      public:
        virtual QString name() const override;
    };
} // namespace DataModel

namespace Components {
    class FragmentsOrderPresent : public QWidget, public MakeTools::PresentBase {
        Q_OBJECT
      public:
        explicit FragmentsOrderPresent(Schedule::CommandsDispatcher *core, DataModel::FragmentsOrderviewModel *backend, QWidget *parent = nullptr);

        void double_click(const QModelIndex &index);

      private:
        Schedule::CommandsDispatcher *const core_ins;
        QTableView *const table_view;

        // PresentBase interface
      public:
        virtual QWidget *widget() const override;
        virtual QString name() const override;
    };
} // namespace Components

#endif // FRAGMENTSORDERVIEW_H
