MarkupXHTMLAttr.java 5.71 KB
/*
 * Decompiled with CFR 0_118.
 */
package com.adobe.xfa.text.markup;

import com.adobe.xfa.text.markup.MarkupAttr;

public class MarkupXHTMLAttr
extends MarkupAttr {
    public static final MarkupXHTMLAttr DEFAULT_ATTR = new MarkupXHTMLAttr();

    MarkupXHTMLAttr() {
        this.InitializeMap();
    }

    public boolean isFontNameSpecifier(String oStrCommand) {
        return false;
    }

    public static MarkupXHTMLAttr getDefault() {
        return DEFAULT_ATTR;
    }

    @Override
    public char blockPrefix() {
        return '\u0000';
    }

    @Override
    public char blockSuffix() {
        return '\u0000';
    }

    @Override
    public char commandPrefix() {
        return '\u0000';
    }

    @Override
    public boolean isDelimiter(char c) {
        return !(c == '*' || c == '-' || c == '\'' || c == '\"' || c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c >= '0' && c <= '9');
    }

    @Override
    public char disablingChar() {
        return '0';
    }

    @Override
    public char delimiter() {
        return '\u0000';
    }

    @Override
    public int pointSizeFactor() {
        return 2;
    }

    @Override
    public boolean isValidMarkup(String sXHTML) {
        return sXHTML.contains("xmlns=\"http://www.w3.org/1999/xhtml\"") || sXHTML.contains("xmlns='http://www.w3.org/1999/xhtml'");
    }

    @Override
    public String whiteSpace() {
        return "\t\n\f\r \u8203";
    }

    private void InitializeMap() {
        this.setEntry(2, "all");
        this.setEntry(3, "auto");
        this.setEntry(4, "none");
        this.setEntry(5, "normal");
        this.setEntry(6, "solid");
        this.setEntry(18, "p");
        this.setEntry(22, "br");
        this.setEntry(38, "span");
        this.setEntry(40, "a");
        this.setEntry(53, "line-height:");
        this.setEntry(41, "style");
        this.setEntry(154, "div");
        this.setEntry(42, "embed");
        this.setEntry(43, "embedMode");
        this.setEntry(44, "embedType");
        this.setEntry(46, "body");
        this.setEntry(47, "html");
        this.setEntry(50, "xfa-spacerun:");
        this.setEntry(52, "no");
        this.setEntry(51, "yes");
        this.setEntry(57, "text-indent:", true);
        this.setEntry(58, "margin-left:", true);
        this.setEntry(59, "margin-right:", true);
        this.setEntry(61, "margin-top:", true);
        this.setEntry(62, "margin-bottom:", true);
        this.setEntry(64, "margin:", true);
        this.setEntry(144, "cm");
        this.setEntry(145, "pt");
        this.setEntry(146, "in");
        this.setEntry(147, "mm");
        this.setEntry(65, "font-family:", true);
        this.setEntry(66, "font-size:", true);
        this.setEntry(67, "font-weight:", true);
        this.setEntry(68, "font-style:", true);
        this.setEntry(69, "font:", true);
        this.setEntry(70, "bold");
        this.setEntry(71, "italic");
        this.setEntry(72, "xfa-font-horizontal-scale");
        this.setEntry(73, "xfa-font-vertical-scale");
        this.setEntry(75, "color:");
        this.setEntry(77, "b");
        this.setEntry(79, "i");
        this.setEntry(113, "sup");
        this.setEntry(115, "sub");
        this.setEntry(92, "u");
        this.setEntry(85, "underline");
        this.setEntry(81, "line-through");
        this.setEntry(86, "double");
        this.setEntry(87, "word");
        this.setEntry(89, "continuous");
        this.setEntry(93, "text-underline:");
        this.setEntry(94, "text-underline-style:");
        this.setEntry(95, "text-underline-mode:");
        this.setEntry(110, "text-decoration:");
        this.setEntry(112, "baseline");
        this.setEntry(119, "text-align:");
        this.setEntry(120, "justify");
        this.setEntry(121, "justify-all");
        this.setEntry(125, "comb-left");
        this.setEntry(126, "comb-center");
        this.setEntry(127, "comb-right");
        this.setEntry(132, "vertical-align:");
        this.setEntry(128, "text-valign:");
        this.setEntry(129, "top");
        this.setEntry(130, "middle");
        this.setEntry(131, "bottom");
        this.setEntry(137, "tab-interval:");
        this.setEntry(138, "tab-stops:", true);
        this.setEntry(142, "decimal");
        this.setEntry(143, "xfa-tab-count:");
        this.setEntry(156, "left");
        this.setEntry(157, "center");
        this.setEntry(158, "right");
        this.setEntry(159, "xfa-digits:");
        this.setEntry(160, "default");
        this.setEntry(161, "arabic");
        this.setEntry(162, "indic");
        this.setEntry(163, "dir");
        this.setEntry(165, "ltr");
        this.setEntry(166, "rtl");
        this.setEntry(167, "xfa-ligatures:");
        this.setEntry(168, "minimal");
        this.setEntry(169, "common");
        this.setEntry(54, "letter-spacing:");
        this.setEntry(55, "word-spacing:");
        this.setEntry(171, "hyphenation:");
        this.setEntry(175, "xfa-hyphenation-acronyms:");
        this.setEntry(174, "xfa-hyphenation-length:");
        this.setEntry(172, "xfa-hyphenation-level:");
        this.setEntry(176, "xfa-hyphenation-names:");
        this.setEntry(173, "preferred");
        this.setEntry(169, "kerning-mode:");
        this.setEntry(170, "pair");
        this.setEntry(177, "leader-align:", true);
        this.setEntry(178, "page");
        this.setEntry(179, "leader-pattern:", true);
        this.setEntry(180, "space");
        this.setEntry(181, "rule");
        this.setEntry(182, "dots");
        this.setEntry(183, "use-content");
        this.setEntry(184, "useContent");
        this.setEntry(185, "leader-pattern-width:", true);
        this.setEntry(186, "rule-style:", true);
        this.setEntry(187, "dotted");
        this.setEntry(188, "dashed");
        this.setEntry(189, "rule-thickness:", true);
    }
}