#pragma once

#include <QScopedPointer>
#include <QWidget>
#include <QKeyEvent>
#include <QJsonObject>

class UserInfoInputViewPrivate;
class UserInfoInputView : public QWidget
{
    Q_OBJECT
public:
    explicit UserInfoInputView(QWidget *parent = Q_NULLPTR);
    ~UserInfoInputView() Q_DECL_OVERRIDE;

    void initConnect();
    void loadFormData();

public Q_SLOTS:
    void showQRCode();
    void showStatus(QJsonObject offlineResult, QJsonObject onlineResult);

    Q_INVOKABLE void StartUpdate();
    Q_INVOKABLE void FinishUpdate();

    void showOrgErrorMessage();
    void showIncompleteMessage();
    void showFailMessage();
    void showSuccessMessage();

protected Q_SLOTS:
    void keyPressEvent(QKeyEvent *e) Q_DECL_OVERRIDE;
    bool eventFilter(QObject *watched, QEvent *event) Q_DECL_OVERRIDE;

private:
    QScopedPointer<UserInfoInputViewPrivate> dd_ptr;
    Q_DECLARE_PRIVATE_D(qGetPtrHelper(dd_ptr), UserInfoInputView)
};

