|
| 1 | +/* |
| 2 | + This file is part of the iText (R) project. |
| 3 | + Copyright (c) 1998-2019 iText Group NV |
| 4 | + Authors: iText Software. |
| 5 | +
|
| 6 | + This program is free software; you can redistribute it and/or modify |
| 7 | + it under the terms of the GNU Affero General Public License version 3 |
| 8 | + as published by the Free Software Foundation with the addition of the |
| 9 | + following permission added to Section 15 as permitted in Section 7(a): |
| 10 | + FOR ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY |
| 11 | + ITEXT GROUP. ITEXT GROUP DISCLAIMS THE WARRANTY OF NON INFRINGEMENT |
| 12 | + OF THIRD PARTY RIGHTS |
| 13 | +
|
| 14 | + This program is distributed in the hope that it will be useful, but |
| 15 | + WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY |
| 16 | + or FITNESS FOR A PARTICULAR PURPOSE. |
| 17 | + See the GNU Affero General Public License for more details. |
| 18 | + You should have received a copy of the GNU Affero General Public License |
| 19 | + along with this program; if not, see http://www.gnu.org/licenses or write to |
| 20 | + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 21 | + Boston, MA, 02110-1301 USA, or download the license from the following URL: |
| 22 | + http://itextpdf.com/terms-of-use/ |
| 23 | +
|
| 24 | + The interactive user interfaces in modified source and object code versions |
| 25 | + of this program must display Appropriate Legal Notices, as required under |
| 26 | + Section 5 of the GNU Affero General Public License. |
| 27 | +
|
| 28 | + In accordance with Section 7(b) of the GNU Affero General Public License, |
| 29 | + a covered work must retain the producer line in every PDF that is created |
| 30 | + or manipulated using iText. |
| 31 | +
|
| 32 | + You can be released from the requirements of the license by purchasing |
| 33 | + a commercial license. Buying such a license is mandatory as soon as you |
| 34 | + develop commercial activities involving the iText software without |
| 35 | + disclosing the source code of your own applications. |
| 36 | + These activities include: offering paid services to customers as an ASP, |
| 37 | + serving PDFs on the fly in a web application, shipping iText with a closed |
| 38 | + source product. |
| 39 | +
|
| 40 | + For more information, please contact iText Software Corp. at this |
| 41 | + |
| 42 | + */ |
| 43 | +package com.itextpdf.forms.xfdf; |
| 44 | + |
| 45 | +import com.itextpdf.kernel.pdf.PdfName; |
| 46 | +import com.itextpdf.kernel.pdf.PdfString; |
| 47 | + |
| 48 | +/** |
| 49 | + * Represent Action tag in xfdf document structure. |
| 50 | + * Content model: ( URI | Launch | GoTo | GoToR | Named ). |
| 51 | + * Attributes: none. |
| 52 | + * For more details see paragraph 6.5.1 in Xfdf specification. |
| 53 | + */ |
| 54 | +public class ActionObject { |
| 55 | + |
| 56 | + |
| 57 | + /** |
| 58 | + * Type of inner action element. Possible values: URI, Launch, GoTo, GoToR, Named. |
| 59 | + */ |
| 60 | + private PdfName type; |
| 61 | + |
| 62 | + /** |
| 63 | + * Represents Name required attribute of URI element. For more details see paragraph 6.5.30 in Xfdf specification. |
| 64 | + */ |
| 65 | + private PdfString uri; |
| 66 | + |
| 67 | + /** |
| 68 | + * Represents IsMap optional attribute of URI element. For more details see paragraph 6.5.30 in Xfdf specification. |
| 69 | + */ |
| 70 | + private boolean isMap; |
| 71 | + |
| 72 | + /** |
| 73 | + * Represents Name required attribute of Named element. For more details see paragraph 6.5.24 in Xfdf specification. |
| 74 | + */ |
| 75 | + private PdfName nameAction; |
| 76 | + |
| 77 | + /** |
| 78 | + * Represents OriginalName required attribute of File inner element of GoToR or Launch element. |
| 79 | + * Corresponds to F key in go-to action or launch dictionaries. |
| 80 | + * For more details see paragraphs 6.5.11, 6.5.23 in Xfdf specification. |
| 81 | + */ |
| 82 | + private String fileOriginalName; |
| 83 | + |
| 84 | + /** |
| 85 | + * Represents NewWindows optional attribute of Launch element. For more details see paragraph 6.5.23 in Xfdf specification. |
| 86 | + */ |
| 87 | + private boolean isNewWindow; |
| 88 | + |
| 89 | + /** |
| 90 | + * Represents Dest inner element of link, GoTo, and GoToR elements. |
| 91 | + * Corresponds to Dest key in link annotation dictionary. |
| 92 | + * For more details see paragraph 6.5.10 in Xfdf specification. |
| 93 | + */ |
| 94 | + private DestObject destination; |
| 95 | + |
| 96 | + public ActionObject(PdfName type) { |
| 97 | + this.type = type; |
| 98 | + } |
| 99 | + |
| 100 | + public PdfName getType() { |
| 101 | + return type; |
| 102 | + } |
| 103 | + |
| 104 | + public ActionObject setType(PdfName type) { |
| 105 | + this.type = type; |
| 106 | + return this; |
| 107 | + } |
| 108 | + |
| 109 | + public PdfString getUri() { |
| 110 | + return uri; |
| 111 | + } |
| 112 | + |
| 113 | + public ActionObject setUri(PdfString uri) { |
| 114 | + this.uri = uri; |
| 115 | + return this; |
| 116 | + } |
| 117 | + |
| 118 | + public boolean isMap() { |
| 119 | + return isMap; |
| 120 | + } |
| 121 | + |
| 122 | + public ActionObject setMap(boolean map) { |
| 123 | + isMap = map; |
| 124 | + return this; |
| 125 | + } |
| 126 | + |
| 127 | + public PdfName getNameAction() { |
| 128 | + return nameAction; |
| 129 | + } |
| 130 | + |
| 131 | + public ActionObject setNameAction(PdfName nameAction) { |
| 132 | + this.nameAction = nameAction; |
| 133 | + return this; |
| 134 | + } |
| 135 | + |
| 136 | + public String getFileOriginalName() { |
| 137 | + return fileOriginalName; |
| 138 | + } |
| 139 | + |
| 140 | + public ActionObject setFileOriginalName(String fileOriginalName) { |
| 141 | + this.fileOriginalName = fileOriginalName; |
| 142 | + return this; |
| 143 | + } |
| 144 | + |
| 145 | + public boolean isNewWindow() { |
| 146 | + return isNewWindow; |
| 147 | + } |
| 148 | + |
| 149 | + public ActionObject setNewWindow(boolean newWindow) { |
| 150 | + isNewWindow = newWindow; |
| 151 | + return this; |
| 152 | + } |
| 153 | + |
| 154 | + public DestObject getDestination() { |
| 155 | + return destination; |
| 156 | + } |
| 157 | + |
| 158 | + public ActionObject setDestination(DestObject destination) { |
| 159 | + this.destination = destination; |
| 160 | + return this; |
| 161 | + } |
| 162 | +} |
0 commit comments