/*
 * 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 MiscHelper = require("./../../../util/MiscHelper");

class PdfObject {
    
    constructor() {
        this.sourceFile = null;
        this.id = 0;
        this.m_WriteId = 0;
        this.version = 0;
        this.writePos = 0;
        this.readPos = 0;
        this.readLen = 0;
        this.deleted = false;
        this.tag = null;
        this.tmpTag = 0;
    }
    
    get writeId() {
        if (this.m_WriteId === 0) 
            return this.id;
        return this.m_WriteId;
    }
    set writeId(value) {
        this.m_WriteId = value;
        return value;
    }
    
    isSimple(lev) {
        return false;
    }
    
    toStringEx(lev) {
        return "?";
    }
    
    toString() {
        return this.toStringEx(0);
    }
    
    outHtml(res) {
        MiscHelper.correctHtmlValue(res, this.toString(), false, false, false);
        this._outHtmlRefs(res);
    }
    
    _outHtmlRefs(res) {
        if (this.sourceFile === null || this.id === 0) 
            return;
        let li = this.sourceFile.getAllWhoRefObject0(this.id);
        if (li.length === 0) 
            return;
        res.append("<hr/><div>На данный объект ссылаются:</div><ul>");
        for (const v of li) {
            res.append("<li>");
            if (v.id > 0) 
                res.append("<a href=\"obj").append(v.id).append("\">");
            MiscHelper.correctHtmlValue(res, v.toString(), false, false, false);
            if (v.id > 0) 
                res.append("</a>");
            res.append("</li>");
        }
        res.append("</ul>");
    }
    
    getDouble() {
        return 0;
    }
    
    write(s) {
        
    }
    
    getAllReferences(refs, ids) {
        
    }
    
    getAllWhoRefObject(objId, cur, res, ids) {
        
    }
}


module.exports = PdfObject