/***
   This file is part of fly-ocr.

   Copyright (C) 2021 LLC "RusBITech-Astra" (https://astralinux.ru)

   Foobar is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation, either version 3 of the License, or
   (at your option) any later version.

   Foobar is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with fly-ocr. If not, see <https://www.gnu.org/licenses/>.
***/

#ifndef LANGUAGESELECTIONDIALOG_H
#define LANGUAGESELECTIONDIALOG_H

#include <QDialog>
#include <QList>
#include <fly-ocr/fly-ocr.h>

namespace Ui
{
class LanguageSelectionDialog;
}

class LanguageSelectionDialog : public QDialog
{
    Q_OBJECT

public:
    explicit LanguageSelectionDialog(const QList<FlyOcr::Lang>& langs, const QList<FlyOcr::Lang>& selectedLangs, QWidget* parent = nullptr);
    ~LanguageSelectionDialog();

    QList<FlyOcr::Lang> selectedLaguages() const;

private slots:
    void on_addButton_clicked();
    void on_removeButton_clicked();

private:
    enum LangItemRole {
        LangCodeRole = Qt::UserRole,
        ShortNameRole
    };

    Ui::LanguageSelectionDialog* m_ui;
};

#endif // LANGUAGESELECTIONDIALOG_H
