#ifndef DESIGNATORMAPPINGDIALOG_H
#define DESIGNATORMAPPINGDIALOG_H

#include <QDialog>
#include <QTableView>
#include <QPushButton>
#include <QLineEdit>
#include <QCheckBox>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QGridLayout>
#include <QLabel>
#include <QGroupBox>
#include <QHeaderView>
#include "../model/designatormappingmodel.h"
#include "../model/designatormappingtablemodel.h"

class DesignatorMappingDialog : public QDialog
{
    Q_OBJECT

public:
    explicit DesignatorMappingDialog(DesignatorMappingModel *mappingModel, QWidget *parent = nullptr);

private slots:
    void onAddMapping();
    void onRemoveMapping();
    void onResetToDefaults();
    void onSaveSettings();
    void onFilterTextChanged(const QString &text);
    void onShowOnlyCustomChanged(bool checked);
    void onSelectionChanged();

private:
    void setUp();
    void setUpLayout();
    void setUpConnections();
    void updateButtons();

    DesignatorMappingModel *m_mappingModel;
    DesignatorMappingTableModel *m_tableModel;

    // Виджеты
    QTableView *m_tableView;
    QLineEdit *m_filterEdit;
    QCheckBox *m_showOnlyCustomCheckBox;
    QPushButton *m_addButton;
    QPushButton *m_removeButton;
    QPushButton *m_resetButton;
    QPushButton *m_saveButton;
    QPushButton *m_okButton;
    QPushButton *m_cancelButton;

    // Группы виджетов
    QGroupBox *m_filterGroupBox;
    QGroupBox *m_tableGroupBox;
    QGroupBox *m_buttonsGroupBox;
};

#endif // DESIGNATORMAPPINGDIALOG_H 