    001/*
    002 * Licensed to the Apache Software Foundation (ASF) under one or more
    003 * contributor license agreements.  See the NOTICE file distributed with
    004 * this work for additional information regarding copyright ownership.
    005 * The ASF licenses this file to You under the Apache License, Version 2.0
    006 * (the "License"); you may not use this file except in compliance with
    007 * the License.  You may obtain a copy of the License at
    008 *
    009 *      http://www.apache.org/licenses/LICENSE-2.0
    010 *
    011 * Unless required by applicable law or agreed to in writing, software
    012 * distributed under the License is distributed on an "AS IS" BASIS,
    013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    014 * See the License for the specific language governing permissions and
    015 * limitations under the License.
    016 */
    017package org.apache.commons.imaging.formats.png;
    018
    019public abstract class AbstractPngText {
    020    public static class Itxt extends AbstractPngText {
    021
    022        /*
    023         * The language tag defined in [RFC-3066] indicates the human language used by the translated keyword and the text. Unlike the keyword, the language tag
    024         * is case-insensitive. It is an ISO 646.IRV:1991 [ISO 646] string consisting of hyphen-separated words of 1-8 alphanumeric characters each (for example
    025         * cn, en-uk, no-bok, x-klingon, x-KlInGoN). If the first word is two or three letters long, it is an ISO language code [ISO-639]. If the language tag
    026         * is empty, the language is unspecified.
    027         */
    028        public final String languageTag;
    029
    030        public final String translatedKeyword;
    031
    032        public Itxt(final String keyword, final String text, final String languageTag, final String translatedKeyword) {
    033            super(keyword, text);
    034            this.languageTag = languageTag;
    035            this.translatedKeyword = translatedKeyword;
    036        }
    037    }
    038
    039    public static class Text extends AbstractPngText {
    040        public Text(final String keyword, final String text) {
    041            super(keyword, text);
    042        }
    043    }
    044
    045    public static class Ztxt extends AbstractPngText {
    046        public Ztxt(final String keyword, final String text) {
    047            super(keyword, text);
    048        }
    049    }
    050
    051    public final String keyword;
    052
    053    public final String text;
    054
    055    public AbstractPngText(final String keyword, final String text) {
    056        this.keyword = keyword;
    057        this.text = text;
    058    }
    059
    060}