/*
 * SDK Pullenti Unitext, version 4.33, fabruary 2026. Copyright (c) 2013-2026, Pullenti. All rights reserved. 
 * Non-Commercial Freeware and Commercial Software. 
 * This class is generated using the converter UniSharping (www.unisharping.ru) from Pullenti C# project. 
 * The latest version of the code is available on the site www.pullenti.ru
 */

const Hashtable = require("./../unisharp/Hashtable");

/**
 * Тип нетекстового элемента
 */
class UnitextMiscType {

    constructor(val, str) {
        this.m_val = val;
        this.m_str = str;
    }
    toString() {
        return this.m_str;
    }
    value() {
        return this.m_val;
    }
    static of(val) {
        if(val instanceof UnitextMiscType) 
            return val;
        if(typeof val === 'string' || val instanceof String) {
            val = val.toUpperCase();
            if(UnitextMiscType.mapStringToEnum.containsKey(val))
                return UnitextMiscType.mapStringToEnum.get(val);
            return null;
        }
        if(UnitextMiscType.mapIntToEnum.containsKey(val))
            return UnitextMiscType.mapIntToEnum.get(val);
        let it = new UnitextMiscType(val, val.toString());
        UnitextMiscType.mapIntToEnum.put(val, it);
        UnitextMiscType.mapStringToEnum.put(val.toString(), it);
        return it;
    }
    static isDefined(val) {
        return UnitextMiscType.m_Keys.indexOf(val) >= 0;
    }
    static getValues() {
        return UnitextMiscType.m_Values;
    }
    static static_constructor() {
        UnitextMiscType.mapIntToEnum = new Hashtable();
        UnitextMiscType.mapStringToEnum = new Hashtable();
        UnitextMiscType.UNDEFINED = new UnitextMiscType(0, "UNDEFINED");
        UnitextMiscType.mapIntToEnum.put(UnitextMiscType.UNDEFINED.value(), UnitextMiscType.UNDEFINED); 
        UnitextMiscType.mapStringToEnum.put(UnitextMiscType.UNDEFINED.m_str.toUpperCase(), UnitextMiscType.UNDEFINED); 
        UnitextMiscType.HORIZONTALLINE = new UnitextMiscType(1, "HORIZONTALLINE");
        UnitextMiscType.mapIntToEnum.put(UnitextMiscType.HORIZONTALLINE.value(), UnitextMiscType.HORIZONTALLINE); 
        UnitextMiscType.mapStringToEnum.put(UnitextMiscType.HORIZONTALLINE.m_str.toUpperCase(), UnitextMiscType.HORIZONTALLINE); 
        UnitextMiscType.ANCHOR = new UnitextMiscType(2, "ANCHOR");
        UnitextMiscType.mapIntToEnum.put(UnitextMiscType.ANCHOR.value(), UnitextMiscType.ANCHOR); 
        UnitextMiscType.mapStringToEnum.put(UnitextMiscType.ANCHOR.m_str.toUpperCase(), UnitextMiscType.ANCHOR); 
        UnitextMiscType.m_Values = Array.from(UnitextMiscType.mapIntToEnum.values);
        UnitextMiscType.m_Keys = Array.from(UnitextMiscType.mapIntToEnum.keys);
    }
}


UnitextMiscType.static_constructor();

module.exports = UnitextMiscType