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

package com.pullenti.unitext.internal.rtf;

public class RichTextItem {

    public String text;

    public java.util.ArrayList<RichTextItem> children = new java.util.ArrayList<RichTextItem>();

    public RichTextItem owner;

    public Object tag;

    public int beginChar;

    public int endChar;

    public boolean isPageBreak = false;

    public int newLines = 0;

    public void addChild(RichTextItem it) {
        if (children == null) 
            children = new java.util.ArrayList<RichTextItem>();
        children.add(it);
        it.owner = this;
    }

    @Override
    public String toString() {
        StringBuilder res = new StringBuilder();
        res.append(this.getClass().getSimpleName().substring(8));
        if (text != null) 
            res.append(" '").append(text).append("'");
        else if (children != null) 
            res.append(" ").append(children.size()).append(" items");
        return res.toString();
    }
    public RichTextItem() {
    }
}
