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

class RichTextItem {
    
    constructor() {
        this.text = null;
        this.children = new Array();
        this.owner = null;
        this.tag = null;
        this.beginChar = 0;
        this.endChar = 0;
        this.isPageBreak = false;
        this.newLines = 0;
    }
    
    addChild(it) {
        if (this.children === null) 
            this.children = new Array();
        this.children.push(it);
        it.owner = this;
    }
    
    toString() {
        let res = new StringBuilder();
        if (this.text !== null) 
            res.append(" '").append(this.text).append("'");
        else if (this.children !== null) 
            res.append(" ").append(this.children.length).append(" items");
        return res.toString();
    }
}


module.exports = RichTextItem