package com.hh.lib_idcard_base;


import android.app.Activity;

import com.hh.lib_idcard_base.listener.IDCardInfoLogListener;
import com.hh.lib_idcard_base.listener.ReadIDCardListener;

/**
 * @Description:
 * @author: Xia WeiHao
 * @date: 2024/7/1
 */
public abstract class BaseIDCardScan {

    /**
     * 日志信息
     */
    public volatile IDCardInfoLogListener onILogListener;

    /**
     * 配置
     */
    private IDCardConfig config;

    public BaseIDCardScan(IDCardConfig config) {
        this.config = config;
    }

    public void setIDCardInfoLogListener(IDCardInfoLogListener listener){
        onILogListener=listener;
    }

    public void setConfig(IDCardConfig config) {
        this.config = config;
    }

    public IDCardConfig getConfig() {
        if(config==null){
            config=new IDCardConfig();
        }
        return config;
    }

    /**
     *
     * desc:初始化身份证
     * @author xia weihao
     * @date 2024/7/4
     *
     */ 
    public abstract void initIDCard(IDCardInfoLogListener listener);

    /**
     *
     * desc:启动身份证轮询
     * @author xia weihao
     * @date 2024/7/4
     *
     */ 
    public abstract void startPollRead(ReadIDCardListener listener);
    /**
     *
     * desc:停止身份证轮询
     * @author xia weihao
     * @date 2024/7/4
     *
     */ 
    public abstract void stopPollRead();
    /**
     *
     * desc:获取单次身份证
     * @author xia weihao
     * @date 2024/7/4
     *
     */ 
    public abstract void onceReadIDCardInfo(final ReadIDCardListener listener);

    /**
     *
     * desc:停止获取单次身份证
     * @author xia weihao
     * @date 2024/9/5
     *
     */
    public abstract void stopOnceReadIDCardInfo();
    /**
     *
     * desc:获取身份证UID
     * @author xia weihao
     * @date 2024/7/4
     *
     */ 
    public abstract void getIDCardUid(final ReadIDCardListener listener);
    
    /**
     *
     * desc:释放资源
     * @author xia weihao
     * @date 2024/7/4
     *
     */ 
    public abstract void onRelease();

}
