/*
 * SDK Pullenti Lingvo, 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#.NET project. 
 * The latest version of the code is available on the site www.pullenti.ru
 */

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

const ReferentClass = require("./../../metadata/ReferentClass");
const BookLinkRefType = require("./../BookLinkRefType");

class MetaBookLinkRef extends ReferentClass {
    
    static initialize() {
        const BookLinkRefReferent = require("./../BookLinkRefReferent");
        MetaBookLinkRef.globalMeta = new MetaBookLinkRef();
        MetaBookLinkRef.globalMeta.addFeature(BookLinkRefReferent.ATTR_BOOK, "Источник", 1, 1);
        MetaBookLinkRef.globalMeta.addFeature(BookLinkRefReferent.ATTR_TYPE, "Тип", 0, 1);
        MetaBookLinkRef.globalMeta.addFeature(BookLinkRefReferent.ATTR_PAGES, "Страницы", 0, 1);
        MetaBookLinkRef.globalMeta.addFeature(BookLinkRefReferent.ATTR_NUMBER, "Номер", 0, 1);
        MetaBookLinkRef.globalMeta.addFeature(BookLinkRefReferent.ATTR_MISC, "Разное", 0, 0);
    }
    
    get name() {
        const BookLinkRefReferent = require("./../BookLinkRefReferent");
        return BookLinkRefReferent.OBJ_TYPENAME;
    }
    
    get caption() {
        return "Ссылка на внешний источник в тексте";
    }
    
    getImageId(obj = null) {
        const BookLinkRefReferent = require("./../BookLinkRefReferent");
        let rr = Utils.as(obj, BookLinkRefReferent);
        if (rr !== null) {
            if (rr.typ === BookLinkRefType.INLINE) 
                return MetaBookLinkRef.IMAGE_ID_INLINE;
        }
        return MetaBookLinkRef.IMAGE_ID;
    }
    
    static static_constructor() {
        MetaBookLinkRef.IMAGE_ID = "booklinkref";
        MetaBookLinkRef.IMAGE_ID_INLINE = "booklinkrefinline";
        MetaBookLinkRef.IMAGE_ID_LAST = "booklinkreflast";
        MetaBookLinkRef.globalMeta = null;
    }
}


MetaBookLinkRef.static_constructor();

module.exports = MetaBookLinkRef