/*
 * Copyright (C) 2018 Tianjin KYLIN Information Technology Co., Ltd.
 *
 * This program 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, or (at your option)
 * any later version.
 *
 * This program 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 this program; if not, see <http://www.gnu.org/licenses/>.
 *
 **/
#ifndef INPUTDIALOG_H
#define INPUTDIALOG_H

#include <QDialog>
#include <QKeyEvent>

namespace Ui
{
class InputDialog;
}

class InputDialog : public QDialog
{
    Q_OBJECT

public:
    explicit InputDialog(QStringList names, QWidget *parent = 0);
    ~InputDialog();

    void setTitle(const QString &text);
    void setPrompt(const QString &text);
    void setError(const QString &text);
    void setText(const QString &text);
    QString getText();

protected:
    void keyPressEvent(QKeyEvent *);

private slots:
    void on_btnClose_clicked();
    void on_btnOK_clicked();
    void on_btnCancel_clicked();
    // void on_lineEdit_returnPressed();

signals:
    void dataChanged(const QString &text);

private:
    Ui::InputDialog *ui;
};

#endif // INPUTDIALOG_H
