/*
 * 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 FtsWidthType {

    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 FtsWidthType) 
            return val;
        if(typeof val === 'string' || val instanceof String) {
            val = val.toUpperCase();
            if(FtsWidthType.mapStringToEnum.containsKey(val))
                return FtsWidthType.mapStringToEnum.get(val);
            return null;
        }
        if(FtsWidthType.mapIntToEnum.containsKey(val))
            return FtsWidthType.mapIntToEnum.get(val);
        let it = new FtsWidthType(val, val.toString());
        FtsWidthType.mapIntToEnum.put(val, it);
        FtsWidthType.mapStringToEnum.put(val.toString(), it);
        return it;
    }
    static isDefined(val) {
        return FtsWidthType.m_Keys.indexOf(val) >= 0;
    }
    static getValues() {
        return FtsWidthType.m_Values;
    }
    static static_constructor() {
        FtsWidthType.mapIntToEnum = new Hashtable();
        FtsWidthType.mapStringToEnum = new Hashtable();
        FtsWidthType.NONE = new FtsWidthType(0, "NONE");
        FtsWidthType.mapIntToEnum.put(FtsWidthType.NONE.value(), FtsWidthType.NONE); 
        FtsWidthType.mapStringToEnum.put(FtsWidthType.NONE.m_str.toUpperCase(), FtsWidthType.NONE); 
        FtsWidthType.AUTO = new FtsWidthType(1, "AUTO");
        FtsWidthType.mapIntToEnum.put(FtsWidthType.AUTO.value(), FtsWidthType.AUTO); 
        FtsWidthType.mapStringToEnum.put(FtsWidthType.AUTO.m_str.toUpperCase(), FtsWidthType.AUTO); 
        FtsWidthType.PERCENT = new FtsWidthType(2, "PERCENT");
        FtsWidthType.mapIntToEnum.put(FtsWidthType.PERCENT.value(), FtsWidthType.PERCENT); 
        FtsWidthType.mapStringToEnum.put(FtsWidthType.PERCENT.m_str.toUpperCase(), FtsWidthType.PERCENT); 
        FtsWidthType.DXA = new FtsWidthType(3, "DXA");
        FtsWidthType.mapIntToEnum.put(FtsWidthType.DXA.value(), FtsWidthType.DXA); 
        FtsWidthType.mapStringToEnum.put(FtsWidthType.DXA.m_str.toUpperCase(), FtsWidthType.DXA); 
        FtsWidthType.DXASYS = new FtsWidthType(19, "DXASYS");
        FtsWidthType.mapIntToEnum.put(FtsWidthType.DXASYS.value(), FtsWidthType.DXASYS); 
        FtsWidthType.mapStringToEnum.put(FtsWidthType.DXASYS.m_str.toUpperCase(), FtsWidthType.DXASYS); 
        FtsWidthType.m_Values = Array.from(FtsWidthType.mapIntToEnum.values);
        FtsWidthType.m_Keys = Array.from(FtsWidthType.mapIntToEnum.keys);
    }
}


FtsWidthType.static_constructor();

module.exports = FtsWidthType