#ifndef FORMAUTHENTICATION_H
#define FORMAUTHENTICATION_H

#include <QWidget>
#include <QLabel>
#include <QToolButton>
#include <QTimer>

namespace Ui {
class FormAuthentication;
}

class FormAuthentication : public QWidget
{
    Q_OBJECT

public:
    explicit FormAuthentication(QWidget *parent = nullptr);
    ~FormAuthentication();

    void setBackground(QLabel* label, const QString& imageUrl);

private:
    void initWidgets();
    void initConnect();

    int getNFCCardId(int timeout, QByteArray& cardId);

private slots:
    void authTimeout();

protected:
    void showEvent(QShowEvent* event) override;

signals:
    void signalCancelAuth();

private:
    Ui::FormAuthentication *ui;

    QLabel*         posBackgroundImage;
    QLabel*         authBackgroundImage;
    QToolButton*    cancelBackgroundImage;
    QLabel*         tipsBackGroundImage;

    QTimer* m_timer;
    int m_cur_time;
};

#endif // FORMAUTHENTICATION_H
