package com.adealink.weparty.module.widget.form

import com.adealink.weparty.module.widget.form.data.StepField


enum class WidgetType(val type: Int) {
    UNKNOWN(-1), //未知类型
    SINGLE_TEXT(0),     //单行文本
    MULTIPLE_TEXT(1),   //多行文本
    SINGLE_CHOICE(2),   //单选
    MULTIPLE_CHOICE(3), //多选
    NUMBER(4),          //数字
    PICTURE(5),         //图片
    VOICE(7);           //语音
    //VIDEO(8),               //视频

    companion object {
        @JvmStatic
        fun map(type: Int?): WidgetType {
            type ?: return UNKNOWN
            return entries.find { it.type == type } ?: UNKNOWN
        }
    }
}

interface IWidgetData {

    val fieldData: StepField<*>
    fun widgetType(): WidgetType

}