/*
 * 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");

/**
 * Типы стилевых фрагментов UnitextStyledFragment
 * Типы стилевых фрагментов
 */
class UnitextStyledFragmentType {

    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 UnitextStyledFragmentType) 
            return val;
        if(typeof val === 'string' || val instanceof String) {
            val = val.toUpperCase();
            if(UnitextStyledFragmentType.mapStringToEnum.containsKey(val))
                return UnitextStyledFragmentType.mapStringToEnum.get(val);
            return null;
        }
        if(UnitextStyledFragmentType.mapIntToEnum.containsKey(val))
            return UnitextStyledFragmentType.mapIntToEnum.get(val);
        let it = new UnitextStyledFragmentType(val, val.toString());
        UnitextStyledFragmentType.mapIntToEnum.put(val, it);
        UnitextStyledFragmentType.mapStringToEnum.put(val.toString(), it);
        return it;
    }
    static isDefined(val) {
        return UnitextStyledFragmentType.m_Keys.indexOf(val) >= 0;
    }
    static getValues() {
        return UnitextStyledFragmentType.m_Values;
    }
    static static_constructor() {
        UnitextStyledFragmentType.mapIntToEnum = new Hashtable();
        UnitextStyledFragmentType.mapStringToEnum = new Hashtable();
        UnitextStyledFragmentType.UNDEFINED = new UnitextStyledFragmentType(0, "UNDEFINED");
        UnitextStyledFragmentType.mapIntToEnum.put(UnitextStyledFragmentType.UNDEFINED.value(), UnitextStyledFragmentType.UNDEFINED); 
        UnitextStyledFragmentType.mapStringToEnum.put(UnitextStyledFragmentType.UNDEFINED.m_str.toUpperCase(), UnitextStyledFragmentType.UNDEFINED); 
        UnitextStyledFragmentType.INLINE = new UnitextStyledFragmentType(1, "INLINE");
        UnitextStyledFragmentType.mapIntToEnum.put(UnitextStyledFragmentType.INLINE.value(), UnitextStyledFragmentType.INLINE); 
        UnitextStyledFragmentType.mapStringToEnum.put(UnitextStyledFragmentType.INLINE.m_str.toUpperCase(), UnitextStyledFragmentType.INLINE); 
        UnitextStyledFragmentType.PARAGRAPH = new UnitextStyledFragmentType(2, "PARAGRAPH");
        UnitextStyledFragmentType.mapIntToEnum.put(UnitextStyledFragmentType.PARAGRAPH.value(), UnitextStyledFragmentType.PARAGRAPH); 
        UnitextStyledFragmentType.mapStringToEnum.put(UnitextStyledFragmentType.PARAGRAPH.m_str.toUpperCase(), UnitextStyledFragmentType.PARAGRAPH); 
        UnitextStyledFragmentType.TABLE = new UnitextStyledFragmentType(3, "TABLE");
        UnitextStyledFragmentType.mapIntToEnum.put(UnitextStyledFragmentType.TABLE.value(), UnitextStyledFragmentType.TABLE); 
        UnitextStyledFragmentType.mapStringToEnum.put(UnitextStyledFragmentType.TABLE.m_str.toUpperCase(), UnitextStyledFragmentType.TABLE); 
        UnitextStyledFragmentType.TABLECELL = new UnitextStyledFragmentType(4, "TABLECELL");
        UnitextStyledFragmentType.mapIntToEnum.put(UnitextStyledFragmentType.TABLECELL.value(), UnitextStyledFragmentType.TABLECELL); 
        UnitextStyledFragmentType.mapStringToEnum.put(UnitextStyledFragmentType.TABLECELL.m_str.toUpperCase(), UnitextStyledFragmentType.TABLECELL); 
        UnitextStyledFragmentType.FOOTNOTE = new UnitextStyledFragmentType(5, "FOOTNOTE");
        UnitextStyledFragmentType.mapIntToEnum.put(UnitextStyledFragmentType.FOOTNOTE.value(), UnitextStyledFragmentType.FOOTNOTE); 
        UnitextStyledFragmentType.mapStringToEnum.put(UnitextStyledFragmentType.FOOTNOTE.m_str.toUpperCase(), UnitextStyledFragmentType.FOOTNOTE); 
        UnitextStyledFragmentType.m_Values = Array.from(UnitextStyledFragmentType.mapIntToEnum.values);
        UnitextStyledFragmentType.m_Keys = Array.from(UnitextStyledFragmentType.mapIntToEnum.keys);
    }
}


UnitextStyledFragmentType.static_constructor();

module.exports = UnitextStyledFragmentType