package com.hh.ib_base_qr;

/**
 * Description: 二维码扫码基类$
 *
 * @author xwh
 * time 2024/9/30
 **/
public abstract class BaseQRScan {

    private QRInitListener qrInitListener;
    public volatile QRResultCallback qrResultCallback;

    public void setQrInitListener(QRInitListener qrInitListener) {
        this.qrInitListener = qrInitListener;
    }

    public void setQrResultCallback(QRResultCallback qrResultCallback) {
        this.qrResultCallback = qrResultCallback;
    }

    /**
     * 初始化
     */
    public abstract void onInit(QRInitListener qrInitListener);


    /**
     * 扫码获取数据成功
     * @param qrCode
     */
    public abstract void onScanSuccess(String qrCode);

    /**
     * 扫码获取数据失败
     * @param errMsg
     */
    public abstract void onScanFail(String errMsg);

    /**
     * 释放资源
     */
    public abstract void onRelease();
}
