package com.knecon.fforesight.service.viewerdoc;

import java.util.List;

import org.apache.pdfbox.cos.COSName;

import lombok.AccessLevel;
import lombok.experimental.FieldDefaults;

@FieldDefaults(makeFinal = true, level = AccessLevel.PUBLIC)
public class ContentStreams {

    public static Identifier KNECON_LAYOUT = new Identifier("Layout grid", COSName.getPDFName("KNECON_LAYOUT"), true);

    public static Identifier KNECON_VISUAL_PARSING = new Identifier("Layout grid - visual", COSName.getPDFName("KNECON_VISUAL_PARSING"), true);

    public static Identifier KNECON_OCR = new Identifier("OCR", COSName.getPDFName("KNECON_OCR"), false);

    public static Identifier KNECON_OCR_TEXT_DEBUG = new Identifier("OCR Text", COSName.getPDFName("KNECON_OCR_TEXT_DEBUG"), true);

    public static Identifier KNECON_OCR_BBOX_DEBUG = new Identifier("OCR Boxes", COSName.getPDFName("KNECON_OCR_BBOX_DEBUG"), true);

    public static Identifier OTHER = new Identifier("other", COSName.getPDFName("OTHER"), false);

    public static Identifier ESCAPE_START = new Identifier("escape start", COSName.getPDFName("ESCAPE_START"), false);

    public static Identifier ESCAPE_END = new Identifier("escape start", COSName.getPDFName("ESCAPE_END"), false);

    public static Identifier RULINGS = new Identifier("Rulings", COSName.getPDFName("KNECON_RULINGS"), true);

    public static Identifier WORDS = new Identifier("Words", COSName.getPDFName("KNECON_WORDS"), true);

    public static Identifier ZONES = new Identifier("Text Zones", COSName.getPDFName("KNECON_ZONES"), true);

    public static Identifier LINES = new Identifier("Text Lines", COSName.getPDFName("KNECON_LINES"), true);

    public static Identifier CELLS = new Identifier("Cells", COSName.getPDFName("KNECON_CELLS"), true);

    public static Identifier MAIN_BODY = new Identifier("Main Text Body", COSName.getPDFName("KNECON_MAIN_BODY"), true);

    public static Identifier MARKED_CONTENT = new Identifier("Marked content", COSName.getPDFName("KNECON_MARKED_CONTENT"), true);

    public static Identifier NEIGHBOURS = new Identifier("Neighbours", COSName.getPDFName("KNECON_NEIGHBOURS"), true);

    public static Identifier CHARACTERS = new Identifier("Characters", COSName.getPDFName("KNECON_CHARACTERS"), true);

    public static List<Identifier> allContentStreams = List.of(KNECON_LAYOUT,
                                                               KNECON_VISUAL_PARSING,
                                                               KNECON_OCR,
                                                               KNECON_OCR_BBOX_DEBUG,
                                                               KNECON_OCR_TEXT_DEBUG,
                                                               OTHER,
                                                               ESCAPE_START,
                                                               ESCAPE_END,
                                                               RULINGS,
                                                               WORDS,
                                                               ZONES,
                                                               LINES,
                                                               MAIN_BODY,
                                                               MARKED_CONTENT,
                                                               NEIGHBOURS,
                                                               CHARACTERS,
                                                               CELLS);

    public record Identifier(String name, COSName cosName, boolean optionalContent) {

    }

}
