package com.ycgis.macall.personalcenter.m.model;

/**
 * created by:   Macall
 * create time:  2022/11/21 18:16
 * copyright:    @ruansee.com
 * Describe:    H5文件选择配置
 */
public class SelectFileOptions {
    /*是否支持相机拍照*/
    private boolean isCamera;
    /*是否支持相册选择*/
    private boolean isDCIM;
    /*是否支持文件选择*/
    private boolean isFileSelection;
    /*是否由H5自己实现*/
    private boolean selfRealization;

    public SelectFileOptions(boolean isCamera) {
        this.isCamera = isCamera;
    }

    public SelectFileOptions(boolean isDCIM, boolean isFileSelection) {
        this.isDCIM = isDCIM;
        this.isFileSelection = isFileSelection;
    }

    public SelectFileOptions(boolean selfRealization, boolean isCamera, boolean isDCIM, boolean isFileSelection) {
        this.selfRealization = selfRealization;
        this.isCamera = isCamera;
        this.isDCIM = isDCIM;
        this.isFileSelection = isFileSelection;
    }
    public void configureOptions(boolean selfRealization,boolean isCamera, boolean isDCIM, boolean isFileSelection) {
        this.selfRealization = selfRealization;
        this.isCamera = isCamera;
        this.isDCIM = isDCIM;
        this.isFileSelection = isFileSelection;
    }

    public boolean isCamera() {
        return isCamera;
    }

    public void setCamera(boolean camera) {
        isCamera = camera;
    }

    public boolean isDCIM() {
        return isDCIM;
    }

    public void setDCIM(boolean DCIM) {
        isDCIM = DCIM;
    }

    public boolean isFileSelection() {
        return isFileSelection;
    }

    public void setFileSelection(boolean fileSelection) {
        isFileSelection = fileSelection;
    }

    public boolean isSelfRealization() {
        return selfRealization;
    }

    public void setSelfRealization(boolean selfRealization) {
        this.selfRealization = selfRealization;
    }

    /**
     * 是否只配置了一个选项
     * @return  true 只配置了一个选项
     *          false 配置了多个选项
     */
    public boolean onlyOneItemIsSelected(){
        int count = 0;
        if (isCamera){
            count++;
        }
        if (isDCIM){
            count++;
        }
        if (isFileSelection){
            count++;
        }
        return count==1;
    }
}
