Merge from mainline
[official-gcc.git] / libjava / classpath / javax / print / attribute / standard / Finishings.java
blob6d474a6ead182df5797e98e9b728cc58cc78e2f6
1 /* Finishings.java --
2 Copyright (C) 2004, 2005 Free Software Foundation, Inc.
4 This file is part of GNU Classpath.
6 GNU Classpath is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
11 GNU Classpath is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU Classpath; see the file COPYING. If not, write to the
18 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 02110-1301 USA.
21 Linking this library statically or dynamically with other modules is
22 making a combined work based on this library. Thus, the terms and
23 conditions of the GNU General Public License cover the whole
24 combination.
26 As a special exception, the copyright holders of this library give you
27 permission to link this library with independent modules to produce an
28 executable, regardless of the license terms of these independent
29 modules, and to copy and distribute the resulting executable under
30 terms of your choice, provided that you also meet, for each linked
31 independent module, the terms and conditions of the license of that
32 module. An independent module is a module which is not derived from
33 or based on this library. If you modify this library, you may extend
34 this exception to your version of the library, but you are not
35 obligated to do so. If you do not wish to do so, delete this
36 exception statement from your version. */
39 package javax.print.attribute.standard;
41 import javax.print.attribute.DocAttribute;
42 import javax.print.attribute.EnumSyntax;
43 import javax.print.attribute.PrintJobAttribute;
44 import javax.print.attribute.PrintRequestAttribute;
47 /**
48 * The <code>Finishings</code> attribute specifies the finishing operations
49 * that the Printer applies to every copy of each printed document in the Job.
50 * <p>
51 * Standard enum values are: <code>NONE</code>, <code>STAPLE</code>,
52 * <code>COVER</code>, <code>BIND</code>, <code>SADDLE_STITCH</code>,
53 * <code>EDGE_STITCH</code>.
54 * <br><br>
55 * The following values are more specific:
56 * <code>STAPLE_TOP_LEFT</code>, <code>STAPLE_BOTTOM_LEFT</code>,
57 * <code>STAPLE_TOP_RIGHT</code>, <code>STAPLE_BOTTOM_RIGHT</code>,
58 * <code>EDGE_STITCH_LEFT</code>, <code>EDGE_STITCH_TOP</code>,
59 * <code>EDGE_STITCH_RIGHT</code>, <code>EDGE_STITCH_BOTTOM</code>,
60 * <code>STAPLE_DUAL_LEFT</code>, <code>STAPLE_DUAL_TOP</code>,
61 * <code>STAPLE_DUAL_RIGHT</code>, <code>STAPLE_DUAL_BOTTOM</code>.
62 * </p>
63 * <p>
64 * <b>Note:</b> The effect of this attribute on jobs with multiple documents
65 * is controlled by the job attribute
66 * {@link javax.print.attribute.standard.MultipleDocumentHandling}.
67 * </p>
68 * <p>
69 * <b>IPP Compatibility:</b> Finishings is an IPP 1.1 attribute. Differences
70 * to the IPP specification are that in the Java Print Service API only one
71 * enum value is supported (in IPP a set of enums). Further the enum
72 * <code>punch</code> is not supported.
73 * </p>
75 * @author Michael Koch (konqueror@gmx.de)
76 * @author Wolfgang Baer (WBaer@gmx.de)
78 public class Finishings extends EnumSyntax
79 implements DocAttribute, PrintJobAttribute, PrintRequestAttribute
81 private static final long serialVersionUID = -627840419548391754L;
83 /**
84 * Perform no finishings of the documents.
86 public static final Finishings NONE = new Finishings(3);
88 /**
89 * Selects binding of the documents with one or more staples.
91 public static final Finishings STAPLE = new Finishings(4);
93 /**
94 * Selects the use of a non-printed (or pre-printed) cover for
95 * the document.
97 public static final Finishings COVER = new Finishings(6);
99 /**
100 * Selects that a binding is to be applied to the document.
101 * The type and placement of the binding is site-defined.
103 public static final Finishings BIND = new Finishings(7);
106 * Selects binding of the documents with one or more staples
107 * along the middle fold.
109 public static final Finishings SADDLE_STITCH = new Finishings(8);
112 * Selects binding of the documents with one or more staples
113 * along one edge.
115 public static final Finishings EDGE_STITCH = new Finishings(9);
117 /**
118 * Selects binding of the documents with one or more staples
119 * in the top left corner.
121 public static final Finishings STAPLE_TOP_LEFT = new Finishings(20);
123 /**
124 * Selects binding of the documents with one or more staples in the bottom
125 * left corner.
127 public static final Finishings STAPLE_BOTTOM_LEFT = new Finishings(21);
130 * Selects binding of the documents with one or more staples in
131 * the top right corner.
133 public static final Finishings STAPLE_TOP_RIGHT = new Finishings(22);
136 * Selects binding of the documents with one or more staples in
137 * the bottom right corner.
139 public static final Finishings STAPLE_BOTTOM_RIGHT = new Finishings(23);
142 * Selects binding of the documents with one or more staples
143 * along the left edge.
145 public static final Finishings EDGE_STITCH_LEFT = new Finishings(24);
148 * Selects binding of the documents with one or more staples along
149 * the top edge.
151 public static final Finishings EDGE_STITCH_TOP = new Finishings(25);
154 * Selects binding of the documents with one or more staples along
155 * the right edge.
157 public static final Finishings EDGE_STITCH_RIGHT = new Finishings(26);
160 * Selects binding of the documents with one or more staples along
161 * the bottom edge.
163 public static final Finishings EDGE_STITCH_BOTTOM = new Finishings(27);
166 * Selects binding of the documents with two staples along the
167 * left edge assuming a portrait document.
169 public static final Finishings STAPLE_DUAL_LEFT = new Finishings(28);
172 * Selects binding of the documents with two staples along the
173 * top edge assuming a portrait document.
175 public static final Finishings STAPLE_DUAL_TOP = new Finishings(29);
178 * Selects binding of the documents with two staples along the
179 * right edge assuming a portrait document.
181 public static final Finishings STAPLE_DUAL_RIGHT = new Finishings(30);
184 * Selects binding of the documents with two staples along the
185 * bottom edge assuming a portrait document.
187 public static final Finishings STAPLE_DUAL_BOTTOM = new Finishings(31);
189 private static final String[] stringTable = { "none", "staple", null,
190 "cover", "bind", "saddle-stitch",
191 "edge-stitch", null, null, null,
192 null, null, null, null, null,
193 null, null, "staple-top-left",
194 "staple-bottom-left",
195 "staple-top-right",
196 "staple-bottom-right",
197 "edge-stitch-left",
198 "edge-stitch-top",
199 "edge-stitch-right",
200 "edge-stitch-bottom",
201 "staple-dual-left",
202 "staple-dual-top",
203 "staple-dual-right",
204 "staple-dual-bottom" };
206 private static final Finishings[] enumValueTable = { NONE, STAPLE, null,
207 COVER, BIND,
208 SADDLE_STITCH,
209 EDGE_STITCH, null,
210 null, null, null,
211 null, null, null,
212 null, null, null,
213 STAPLE_TOP_LEFT,
214 STAPLE_BOTTOM_LEFT,
215 STAPLE_TOP_RIGHT,
216 STAPLE_BOTTOM_RIGHT,
217 EDGE_STITCH_LEFT,
218 EDGE_STITCH_TOP,
219 EDGE_STITCH_RIGHT,
220 EDGE_STITCH_BOTTOM,
221 STAPLE_DUAL_LEFT,
222 STAPLE_DUAL_TOP,
223 STAPLE_DUAL_RIGHT,
224 STAPLE_DUAL_BOTTOM };
227 * Constructs a <code>Finishings</code> object.
229 * @param value the value
231 protected Finishings(int value)
233 super(value);
237 * Returns category of this class.
239 * @return the class <code>Finishings</code> itself
241 public Class getCategory()
243 return Finishings.class;
247 * Returns the name of this attribute.
249 * @return The name "finishings".
251 public String getName()
253 return "finishings";
257 * Returns a table with the enumeration values represented as strings
258 * for this object.
260 * @return The enumeration values as strings.
262 protected String[] getStringTable()
264 return stringTable;
268 * Returns a table with the enumeration values for this object.
270 * @return The enumeration values.
272 protected EnumSyntax[] getEnumValueTable()
274 return enumValueTable;
278 * Returns the lowest used value by the enumerations of this class.
280 * @return The lowest value used.
282 protected int getOffset()
284 return 3;