001    /* PrinterStateReason.java --
002       Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
003    
004    This file is part of GNU Classpath.
005    
006    GNU Classpath is free software; you can redistribute it and/or modify
007    it under the terms of the GNU General Public License as published by
008    the Free Software Foundation; either version 2, or (at your option)
009    any later version.
010    
011    GNU Classpath is distributed in the hope that it will be useful, but
012    WITHOUT ANY WARRANTY; without even the implied warranty of
013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
014    General Public License for more details.
015    
016    You should have received a copy of the GNU General Public License
017    along with GNU Classpath; see the file COPYING.  If not, write to the
018    Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
019    02110-1301 USA.
020    
021    Linking this library statically or dynamically with other modules is
022    making a combined work based on this library.  Thus, the terms and
023    conditions of the GNU General Public License cover the whole
024    combination.
025    
026    As a special exception, the copyright holders of this library give you
027    permission to link this library with independent modules to produce an
028    executable, regardless of the license terms of these independent
029    modules, and to copy and distribute the resulting executable under
030    terms of your choice, provided that you also meet, for each linked
031    independent module, the terms and conditions of the license of that
032    module.  An independent module is a module which is not derived from
033    or based on this library.  If you modify this library, you may extend
034    this exception to your version of the library, but you are not
035    obligated to do so.  If you do not wish to do so, delete this
036    exception statement from your version. */
037    
038    
039    package javax.print.attribute.standard;
040    
041    import javax.print.attribute.Attribute;
042    import javax.print.attribute.EnumSyntax;
043    
044    /**
045     * The <code>PrinterStateReason</code> attribute provides additional
046     * information about the current state of the printer device. Its always part
047     * of the {@link javax.print.attribute.standard.PrinterStateReasons}
048     * printing attribute.
049     * <p>
050     * <b>IPP Compatibility:</b> PrinterStateReason is not an IPP 1.1
051     * attribute itself but used inside the <code>PrinterStateReasons</code>
052     * attribute.
053     * </p>
054     *
055     * @author Michael Koch (konqueror@gmx.de)
056     * @author Wolfgang Baer (WBaer@gmx.de)
057     */
058    public class PrinterStateReason extends EnumSyntax
059      implements Attribute
060    {
061      private static final long serialVersionUID = -1623720656201472593L;
062    
063      /**
064       * Any state other state not listed here.
065       */
066      public static final PrinterStateReason OTHER = new PrinterStateReason(0);
067    
068      /**
069       * A media tray has run out of media.
070       */
071      public static final PrinterStateReason MEDIA_NEEDED =
072        new PrinterStateReason(1);
073    
074      /**
075       * A media jam occured in the printer device.
076       */
077      public static final PrinterStateReason MEDIA_JAM = new PrinterStateReason(2);
078    
079      /**
080       * Indicates that the printer has been paused by the pause printer
081       * operation and is currently moving to the pause state.
082       */
083      public static final PrinterStateReason MOVING_TO_PAUSED =
084        new PrinterStateReason(3);
085    
086      /**
087       * The printer device has be paused by the pause printer operation.
088       */
089      public static final PrinterStateReason PAUSED = new PrinterStateReason(4);
090    
091      /**
092       * The printer device has been shutdown or removed from service.
093       */
094      public static final PrinterStateReason SHUTDOWN = new PrinterStateReason(5);
095    
096      /**
097       * The printer object is connecting to the device. If a printer
098       * device is on the network the printer object may be unable to connect.
099       */
100      public static final PrinterStateReason CONNECTING_TO_DEVICE =
101        new PrinterStateReason(6);
102    
103      /**
104       * The connection to the device has timed out.
105       */
106      public static final PrinterStateReason TIMED_OUT = new PrinterStateReason(7);
107    
108      /**
109       * The printer object is stopping the printer device.
110       */
111      public static final PrinterStateReason STOPPING = new PrinterStateReason(8);
112    
113      /**
114       * The printer object has stopped partly. A printer object may control
115       * several physical output devices (e.g. a printer class in CUPS) and
116       * stop only some of the devices.
117       */
118      public static final PrinterStateReason STOPPED_PARTLY =
119        new PrinterStateReason(9);
120    
121      /**
122       * The printer device is low on toner.
123       */
124      public static final PrinterStateReason TONER_LOW =
125        new PrinterStateReason(10);
126    
127      /**
128       * The printer device is out of toner.
129       */
130      public static final PrinterStateReason TONER_EMPTY =
131        new PrinterStateReason(11);
132    
133      /**
134       * The printers spool area is currently full. The printer is
135       * currently not able to accept jobs.
136       */
137      public static final PrinterStateReason SPOOL_AREA_FULL =
138        new PrinterStateReason(12);
139    
140      /**
141       * One or more covers of the printer device are open.
142       */
143      public static final PrinterStateReason COVER_OPEN =
144        new PrinterStateReason(13);
145    
146      /**
147       * One or more interlocks of the printer device are open.
148       */
149      public static final PrinterStateReason INTERLOCK_OPEN =
150        new PrinterStateReason(14);
151    
152      /**
153       * One or more doors of the printer device are open.
154       */
155      public static final PrinterStateReason DOOR_OPEN =
156        new PrinterStateReason(15);
157    
158      /**
159       * One or more input trays are missing in the printer device.
160       */
161      public static final PrinterStateReason INPUT_TRAY_MISSING =
162        new PrinterStateReason(16);
163    
164      /**
165       * The printer device is low on media.
166       */
167      public static final PrinterStateReason MEDIA_LOW =
168        new PrinterStateReason(17);
169    
170      /**
171       * The printer device is out of media.
172       */
173      public static final PrinterStateReason MEDIA_EMPTY =
174        new PrinterStateReason(18);
175    
176      /**
177       * One or more output trays are missing in the printer device.
178       */
179      public static final PrinterStateReason OUTPUT_TRAY_MISSING =
180        new PrinterStateReason(19);
181    
182      /**
183       * One or more output areas of the printer device are almost full.
184       */
185      public static final PrinterStateReason OUTPUT_AREA_ALMOST_FULL =
186        new PrinterStateReason(20);
187    
188      /**
189       * One or more output areas of the printer device are full.
190       */
191      public static final PrinterStateReason OUTPUT_AREA_FULL =
192        new PrinterStateReason(21);
193    
194      /**
195       * The printer device is low on marker supply.
196       */
197      public static final PrinterStateReason MARKER_SUPPLY_LOW =
198        new PrinterStateReason(22);
199    
200      /**
201       * The printer device is out of marker supply.
202       */
203      public static final PrinterStateReason MARKER_SUPPLY_EMPTY =
204        new PrinterStateReason(23);
205    
206      /**
207       * The marker waste bin of the printer device is almost full.
208       */
209      public static final PrinterStateReason MARKER_WASTE_ALMOST_FULL =
210        new PrinterStateReason(24);
211    
212      /**
213       * The marker waste bin of the printer device is full.
214       */
215      public static final PrinterStateReason MARKER_WASTE_FULL =
216        new PrinterStateReason(25);
217    
218      /**
219       * The fuser of the printer device is over temperature.
220       */
221      public static final PrinterStateReason FUSER_OVER_TEMP =
222        new PrinterStateReason(26);
223    
224      /**
225       * The fuser of the printer device is under the needed temperature.
226       */
227      public static final PrinterStateReason FUSER_UNDER_TEMP =
228        new PrinterStateReason(27);
229    
230      /**
231       * The optical photo conductor is near its end of life (EOL).
232       */
233      public static final PrinterStateReason OPC_NEAR_EOL =
234        new PrinterStateReason(28);
235    
236      /**
237       * The optical photo conductor has reached its end of life.
238       */
239      public static final PrinterStateReason OPC_LIFE_OVER =
240        new PrinterStateReason(29);
241    
242      /**
243       * The printer device is low on developer.
244       */
245      public static final PrinterStateReason DEVELOPER_LOW =
246        new PrinterStateReason(30);
247    
248      /**
249       * The printer device is out of developer.
250       */
251      public static final PrinterStateReason DEVELOPER_EMPTY =
252        new PrinterStateReason(31);
253    
254      /**
255       * An interpreter resource (e.g. font) is unavailable.
256       */
257      public static final PrinterStateReason INTERPRETER_RESOURCE_UNAVAILABLE =
258        new PrinterStateReason(32);
259    
260      private static final String[] stringTable =
261        { "other", "media-needed",  "media-jam", "moving-to-paused", "paused",
262        "shutdown", "connecting-to-device", "timed-out", "stopping",
263        "stopped-partly", "toner-low", "toner-empty", "spool-area-full",
264        "cover-open", "interlock-open", "door-open", "input-tray-missing",
265        "media-low", "media-empty", "output-tray-missing", "output-area-almost-full",
266        "output-area-full", "marker-supply-low", "marker-supply-empty",
267        "marker-waste-almost-full", "marker-waste-full", "fuser-over-temp",
268        "fuser-under-temp", "opc-near-eol", "opc-life-over", "developer-low",
269        "developer-empty", "interpreter-resource-unavailable" };
270    
271      private static final PrinterStateReason[] enumValueTable =
272        { OTHER, MEDIA_NEEDED, MEDIA_JAM, MOVING_TO_PAUSED, PAUSED, SHUTDOWN,
273        CONNECTING_TO_DEVICE, TIMED_OUT, STOPPING, STOPPED_PARTLY, TONER_LOW,
274        TONER_EMPTY, SPOOL_AREA_FULL, COVER_OPEN, INTERLOCK_OPEN, DOOR_OPEN,
275        INPUT_TRAY_MISSING, MEDIA_LOW, MEDIA_EMPTY, OUTPUT_TRAY_MISSING,
276        OUTPUT_AREA_ALMOST_FULL, OUTPUT_AREA_FULL, MARKER_SUPPLY_LOW,
277        MARKER_SUPPLY_EMPTY, MARKER_WASTE_ALMOST_FULL, MARKER_WASTE_FULL,
278        FUSER_OVER_TEMP, FUSER_UNDER_TEMP, OPC_NEAR_EOL, OPC_LIFE_OVER,
279        DEVELOPER_LOW, DEVELOPER_EMPTY, INTERPRETER_RESOURCE_UNAVAILABLE };
280    
281      /**
282       * Constructs a <code>PrinterStateReason</code> object.
283       *
284       * @param value the enum value.
285       */
286      protected PrinterStateReason(int value)
287      {
288        super(value);
289      }
290    
291      /**
292       * Returns category of this class.
293       *
294       * @return The class <code>PrintStateReason</code> itself.
295       */
296      public Class< ? extends Attribute> getCategory()
297      {
298        return PrinterStateReason.class;
299      }
300    
301      /**
302       * Returns the name of this attribute.
303       *
304       * @return The name "printer-state-reason".
305       */
306      public final String getName()
307      {
308        return "printer-state-reason";
309      }
310    
311      /**
312       * Returns a table with the enumeration values represented as strings
313       * for this object.
314       *
315       * @return The enumeration values as strings.
316       */
317      protected String[] getStringTable()
318      {
319        return stringTable;
320      }
321    
322      /**
323       * Returns a table with the enumeration values for this object.
324       *
325       * @return The enumeration values.
326       */
327      protected EnumSyntax[] getEnumValueTable()
328      {
329        return enumValueTable;
330      }
331    }