From 554fd8c5195424bdbcabf5de30fdc183aba391bd Mon Sep 17 00:00:00 2001 From: upstream source tree Date: Sun, 15 Mar 2015 20:14:05 -0400 Subject: obtained gcc-4.6.4.tar.bz2 from upstream website; verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository. --- .../ipp/attribute/supported/CharsetSupported.java | 88 ++++++ .../attribute/supported/CompressionSupported.java | 161 +++++++++++ .../supported/DocumentFormatSupported.java | 92 +++++++ .../attribute/supported/FinishingsSupported.java | 302 +++++++++++++++++++++ .../GeneratedNaturalLanguageSupported.java | 89 ++++++ .../attribute/supported/IppVersionsSupported.java | 122 +++++++++ .../attribute/supported/JobHoldUntilSupported.java | 134 +++++++++ .../attribute/supported/JobSheetsSupported.java | 148 ++++++++++ .../ipp/attribute/supported/MediaSupported.java | 116 ++++++++ .../MultipleDocumentHandlingSupported.java | 176 ++++++++++++ .../supported/MultipleDocumentJobsSupported.java | 119 ++++++++ .../attribute/supported/OperationsSupported.java | 231 ++++++++++++++++ .../supported/OrientationRequestedSupported.java | 178 ++++++++++++ .../attribute/supported/PageRangesSupported.java | 117 ++++++++ .../attribute/supported/PrintQualitySupported.java | 169 ++++++++++++ .../supported/PrinterResolutionSupported.java | 142 ++++++++++ .../attribute/supported/PrinterUriSupported.java | 89 ++++++ .../ipp/attribute/supported/SidesSupported.java | 137 ++++++++++ .../supported/UriAuthenticationSupported.java | 142 ++++++++++ .../attribute/supported/UriSecuritySupported.java | 127 +++++++++ 20 files changed, 2879 insertions(+) create mode 100644 libjava/classpath/gnu/javax/print/ipp/attribute/supported/CharsetSupported.java create mode 100644 libjava/classpath/gnu/javax/print/ipp/attribute/supported/CompressionSupported.java create mode 100644 libjava/classpath/gnu/javax/print/ipp/attribute/supported/DocumentFormatSupported.java create mode 100644 libjava/classpath/gnu/javax/print/ipp/attribute/supported/FinishingsSupported.java create mode 100644 libjava/classpath/gnu/javax/print/ipp/attribute/supported/GeneratedNaturalLanguageSupported.java create mode 100644 libjava/classpath/gnu/javax/print/ipp/attribute/supported/IppVersionsSupported.java create mode 100644 libjava/classpath/gnu/javax/print/ipp/attribute/supported/JobHoldUntilSupported.java create mode 100644 libjava/classpath/gnu/javax/print/ipp/attribute/supported/JobSheetsSupported.java create mode 100644 libjava/classpath/gnu/javax/print/ipp/attribute/supported/MediaSupported.java create mode 100644 libjava/classpath/gnu/javax/print/ipp/attribute/supported/MultipleDocumentHandlingSupported.java create mode 100644 libjava/classpath/gnu/javax/print/ipp/attribute/supported/MultipleDocumentJobsSupported.java create mode 100644 libjava/classpath/gnu/javax/print/ipp/attribute/supported/OperationsSupported.java create mode 100644 libjava/classpath/gnu/javax/print/ipp/attribute/supported/OrientationRequestedSupported.java create mode 100644 libjava/classpath/gnu/javax/print/ipp/attribute/supported/PageRangesSupported.java create mode 100644 libjava/classpath/gnu/javax/print/ipp/attribute/supported/PrintQualitySupported.java create mode 100644 libjava/classpath/gnu/javax/print/ipp/attribute/supported/PrinterResolutionSupported.java create mode 100644 libjava/classpath/gnu/javax/print/ipp/attribute/supported/PrinterUriSupported.java create mode 100644 libjava/classpath/gnu/javax/print/ipp/attribute/supported/SidesSupported.java create mode 100644 libjava/classpath/gnu/javax/print/ipp/attribute/supported/UriAuthenticationSupported.java create mode 100644 libjava/classpath/gnu/javax/print/ipp/attribute/supported/UriSecuritySupported.java (limited to 'libjava/classpath/gnu/javax/print/ipp/attribute/supported') diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/supported/CharsetSupported.java b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/CharsetSupported.java new file mode 100644 index 000000000..22b484ef8 --- /dev/null +++ b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/CharsetSupported.java @@ -0,0 +1,88 @@ +/* CharsetSupported.java -- + Copyright (C) 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package gnu.javax.print.ipp.attribute.supported; + +import gnu.javax.print.ipp.attribute.CharsetSyntax; + +import javax.print.attribute.Attribute; +import javax.print.attribute.SupportedValuesAttribute; + +/** + * CharsetSupported attribute as described in RFC 2911 section + * 4.4.18 provides the charset which are supported by the + * IPP implementation to be used in the name and text syntax + * attribute types. + * + * @author Wolfgang Baer (WBaer@gmx.de) + */ +public final class CharsetSupported extends CharsetSyntax + implements SupportedValuesAttribute +{ + + /** + * Creates a CharsetSupported object. + * + * @param value the charset string value. + */ + public CharsetSupported(String value) + { + super(value); + } + + /** + * Returns category of this class. + * + * @return The class CharsetSupported itself. + */ + public Class getCategory() + { + return CharsetSupported.class; + } + + /** + * Returns the name of this attribute. + * + * @return The name "charset-supported". + */ + public String getName() + { + return "charset-supported"; + } + +} diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/supported/CompressionSupported.java b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/CompressionSupported.java new file mode 100644 index 000000000..768091cb2 --- /dev/null +++ b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/CompressionSupported.java @@ -0,0 +1,161 @@ +/* CompressionSupported.java -- + Copyright (C) 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + +package gnu.javax.print.ipp.attribute.supported; + +import gnu.javax.print.ipp.IppUtilities; + +import java.util.Iterator; +import java.util.Set; + +import javax.print.attribute.Attribute; +import javax.print.attribute.EnumSyntax; +import javax.print.attribute.SupportedValuesAttribute; +import javax.print.attribute.standard.Compression; + + +/** + * CompressionSupported provides the values which are + * supported for the compression attribute. + * + * @author Wolfgang Baer (WBaer@gmx.de) + */ +public final class CompressionSupported extends EnumSyntax + implements SupportedValuesAttribute +{ + + /** The print data is not compressed. */ + public static final CompressionSupported NONE = new CompressionSupported(0); + + /** The print data is ZIP compressed. */ + public static final CompressionSupported DEFLATE = new CompressionSupported(1); + + /** The print data is GNU Zip compressed. */ + public static final CompressionSupported GZIP = new CompressionSupported(2); + + /** The print data is UNIX compressed. */ + public static final CompressionSupported COMPRESS = new CompressionSupported(3); + + private static final String[] stringTable = { "none", "deflate", + "gzip", "compress" }; + + private static final CompressionSupported[] enumValueTable = { NONE, DEFLATE, + GZIP, COMPRESS }; + + /** + * Constructs a CompressionSupported object. + * + * @param value the enum value + */ + protected CompressionSupported(int value) + { + super(value); + } + + /** + * Returns category of this class. + * + * @return The class CompressionSupported itself. + */ + public Class getCategory() + { + return CompressionSupported.class; + } + + /** + * Returns the name of this attribute. + * + * @return The name "compression-supported". + */ + public String getName() + { + return "compression-supported"; + } + + /** + * Returns a table with the enumeration values represented as strings + * for this object. + * + * @return The enumeration values as strings. + */ + protected String[] getStringTable() + { + return stringTable; + } + + /** + * Returns a table with the enumeration values for this object. + * + * @return The enumeration values. + */ + protected EnumSyntax[] getEnumValueTable() + { + return enumValueTable; + } + + /** + * Returns the equally enum of the standard attribute class + * of this SupportedValuesAttribute enum. + * + * @return The enum of the standard attribute class. + */ + public Compression getAssociatedAttribute() + { + return (Compression) IppUtilities.getEnumAttribute( + "compression", new Integer(getValue())); + } + + /** + * Constructs an array from a set of -supported attributes. + * @param set set to process + * @return The constructed array. + * + * @see #getAssociatedAttribute() + */ + public static Compression[] + getAssociatedAttributeArray(Set set) + { + Compression[] result = new Compression[set.size()]; + int j = 0; + for (Attribute tmp : set) + { + result[j] = ((CompressionSupported) tmp).getAssociatedAttribute(); + j++; + } + return result; + } +} diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/supported/DocumentFormatSupported.java b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/DocumentFormatSupported.java new file mode 100644 index 000000000..03449fa4f --- /dev/null +++ b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/DocumentFormatSupported.java @@ -0,0 +1,92 @@ +/* DocumentFormatSupported.java -- + Copyright (C) 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package gnu.javax.print.ipp.attribute.supported; + +import java.util.Locale; + +import javax.print.attribute.Attribute; +import javax.print.attribute.SupportedValuesAttribute; +import javax.print.attribute.TextSyntax; + +/** + * DocumentFormatSupported specifies the supported document + * formats of a printer. Printer are supplying a set of this attribute. + * + * @author Wolfgang Baer (WBaer@gmx.de) + */ +public final class DocumentFormatSupported extends TextSyntax + implements SupportedValuesAttribute +{ + + /** + * Creates a DocumentFormatSupported object with the + * given value and locale. + * + * @param value the value for this syntax + * @param locale the locale to use, if null the default + * locale is used. + * + * @exception NullPointerException if value is null + */ + public DocumentFormatSupported(String value, Locale locale) + { + super(value, locale); + } + + /** + * Returns category of this class. + * + * @return The class DocumentFormatSupported itself. + */ + public Class getCategory() + { + return DocumentFormatSupported.class; + } + + /** + * Returns the name of this attribute. + * + * @return The name "document-format-supported". + */ + public String getName() + { + return "document-format-supported"; + } + +} diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/supported/FinishingsSupported.java b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/FinishingsSupported.java new file mode 100644 index 000000000..f271fa71b --- /dev/null +++ b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/FinishingsSupported.java @@ -0,0 +1,302 @@ +/* FinishingsSupported.java -- + Copyright (C) 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package gnu.javax.print.ipp.attribute.supported; + +import gnu.javax.print.ipp.IppUtilities; + +import java.util.Iterator; +import java.util.Set; + +import javax.print.attribute.Attribute; +import javax.print.attribute.EnumSyntax; +import javax.print.attribute.SupportedValuesAttribute; +import javax.print.attribute.standard.Finishings; + + +/** + * The FinishingsSupported attribute provides the supported + * values for finishings of a job. + * + * @author Wolfgang Baer (WBaer@gmx.de) + */ +public final class FinishingsSupported extends EnumSyntax + implements SupportedValuesAttribute +{ + + /** No finishing. */ + public static final FinishingsSupported NONE = new FinishingsSupported(3); + + /** Staple the document(s) */ + public static final FinishingsSupported STAPLE = new FinishingsSupported(4); + + /** Cover a document */ + public static final FinishingsSupported COVER = new FinishingsSupported(6); + + /** + * This value indicates that a binding is to be applied to the document. + * The type and placement of the binding is site-defined. + */ + public static final FinishingsSupported BIND = new FinishingsSupported(7); + + /** + * Bind the document(s) with one or more staples (wire stitches) + * along the middle fold. + */ + public static final FinishingsSupported SADDLE_STITCH = + new FinishingsSupported(8); + + /** + * Bind the document(s) with one or more staples (wire stitches) + * along one edge. + */ + public static final FinishingsSupported EDGE_STITCH = + new FinishingsSupported(9); + + /** + * Bind the document(s) with one or more staples in the top left + * corner. + */ + public static final FinishingsSupported STAPLE_TOP_LEFT = + new FinishingsSupported(20); + + /** + * Bind the document(s) with one or more staples in the bottom + * left corner. + */ + public static final FinishingsSupported STAPLE_BOTTOM_LEFT = + new FinishingsSupported(21); + + /** + * Bind the document(s) with one or more staples in the top right corner. + */ + public static final FinishingsSupported STAPLE_TOP_RIGHT = + new FinishingsSupported(22); + + /** + * Bind the document(s) with one or more staples in the bottom right corner. + */ + public static final FinishingsSupported STAPLE_BOTTOM_RIGHT = + new FinishingsSupported(23); + + /** + * Bind the document(s) with one or more staples (wire stitches) + * along the left edge. + */ + public static final FinishingsSupported EDGE_STITCH_LEFT = + new FinishingsSupported(24); + + /** + * Bind the document(s) with one or more staples (wire stitches) along + * the top edge. + */ + public static final FinishingsSupported EDGE_STITCH_TOP = + new FinishingsSupported(25); + + /** + * Bind the document(s) with one or more staples (wire stitches) along + * the right edge. + */ + public static final FinishingsSupported EDGE_STITCH_RIGHT = + new FinishingsSupported(26); + + /** + * Bind the document(s) with one or more staples (wire stitches) along + * the bottom edge. + */ + public static final FinishingsSupported EDGE_STITCH_BOTTOM = + new FinishingsSupported(27); + + /** + * Bind the document(s) with two staples (wire stitches) along the + * left edge assuming a portrait document. + */ + public static final FinishingsSupported STAPLE_DUAL_LEFT = + new FinishingsSupported(28); + + /** + * Bind the document(s) with two staples (wire stitches) along the + * top edge assuming a portrait document. + */ + public static final FinishingsSupported STAPLE_DUAL_TOP = + new FinishingsSupported(29); + + /** + * Bind the document(s) with two staples (wire stitches) along the + * right edge assuming a portrait document. + */ + public static final FinishingsSupported STAPLE_DUAL_RIGHT = + new FinishingsSupported(30); + + /** + * Bind the document(s) with two staples (wire stitches) along the + * bottom edge assuming a portrait document. + */ + public static final FinishingsSupported STAPLE_DUAL_BOTTOM = + new FinishingsSupported(31); + + private static final String[] stringTable = { "none", "staple", null, + "cover", "bind", "saddle-stitch", + "edge-stitch", null, null, null, + null, null, null, null, null, + null, null, "staple-top-left", + "staple-bottom-left", + "staple-top-right", + "staple-bottom-right", + "edge-stitch-left", + "edge-stitch-top", + "edge-stitch-right", + "edge-stitch-bottom", + "staple-dual-left", + "staple-dual-top", + "staple-dual-right", + "staple-dual-bottom" }; + + private static final FinishingsSupported[] enumValueTable = { NONE, STAPLE, + null, COVER, BIND, + SADDLE_STITCH, + EDGE_STITCH, null, + null, null, null, + null, null, null, + null, null, null, + STAPLE_TOP_LEFT, + STAPLE_BOTTOM_LEFT, + STAPLE_TOP_RIGHT, + STAPLE_BOTTOM_RIGHT, + EDGE_STITCH_LEFT, + EDGE_STITCH_TOP, + EDGE_STITCH_RIGHT, + EDGE_STITCH_BOTTOM, + STAPLE_DUAL_LEFT, + STAPLE_DUAL_TOP, + STAPLE_DUAL_RIGHT, + STAPLE_DUAL_BOTTOM }; + + /** + * Constructs a FinishingsSupported object. + * + * @param value the value + */ + protected FinishingsSupported(int value) + { + super(value); + } + + /** + * Returns category of this class. + * + * @return the class FinishingsSupported itself + */ + public Class getCategory() + { + return FinishingsSupported.class; + } + + /** + * Returns the name of this attribute. + * + * @return The name "finishings-supported". + */ + public String getName() + { + return "finishings-supported"; + } + + /** + * Returns a table with the enumeration values represented as strings + * for this object. + * + * @return The enumeration values as strings. + */ + protected String[] getStringTable() + { + return stringTable; + } + + /** + * Returns a table with the enumeration values for this object. + * + * @return The enumeration values. + */ + protected EnumSyntax[] getEnumValueTable() + { + return enumValueTable; + } + + /** + * Returns the lowest used value by the enumerations of this class. + * . + * @return The lowest value used. + */ + protected int getOffset() + { + return 3; + } + + /** + * Returns the equally enum of the standard attribute class + * of this SupportedValuesAttribute enum. + * + * @return The enum of the standard attribute class. + */ + public Finishings getAssociatedAttribute() + { + return (Finishings) IppUtilities.getEnumAttribute( + "finishings", new Integer(getValue())); + } + + /** + * Constructs an array from a set of -supported attributes. + * @param set set to process + * @return The constructed array. + * + * @see #getAssociatedAttribute() + */ + public static Finishings[] + getAssociatedAttributeArray(Set set) + { + Finishings[] result = new Finishings[set.size()]; + int j = 0; + for (Attribute tmp : set) + { + result[j] = ((FinishingsSupported) tmp).getAssociatedAttribute(); + j++; + } + return result; + } +} diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/supported/GeneratedNaturalLanguageSupported.java b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/GeneratedNaturalLanguageSupported.java new file mode 100644 index 000000000..df1d33007 --- /dev/null +++ b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/GeneratedNaturalLanguageSupported.java @@ -0,0 +1,89 @@ +/* GeneratedNaturalLanguageSupported.java -- + Copyright (C) 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package gnu.javax.print.ipp.attribute.supported; + +import gnu.javax.print.ipp.attribute.NaturalLanguageSyntax; + +import javax.print.attribute.Attribute; +import javax.print.attribute.SupportedValuesAttribute; + +/** + * GeneratedNaturalLanguageSupported attribute as described + * in RFC 2911 section 4.4.20 provides the natural languages + * which are supported by the IPP implementation to be used + * in the name and text syntax attribute types. + * + * @author Wolfgang Baer (WBaer@gmx.de) + */ +public final class GeneratedNaturalLanguageSupported + extends NaturalLanguageSyntax + implements SupportedValuesAttribute +{ + + /** + * Creates a GeneratedNaturalLanguageSupported object. + * + * @param value the charset string value. + */ + public GeneratedNaturalLanguageSupported(String value) + { + super(value); + } + + /** + * Returns category of this class. + * + * @return The class GeneratedNaturalLanguageSupported itself. + */ + public Class getCategory() + { + return GeneratedNaturalLanguageSupported.class; + } + + /** + * Returns the name of this attribute. + * + * @return The name "generated-natural-language-supported". + */ + public String getName() + { + return "generated-natural-language-supported"; + } + +} diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/supported/IppVersionsSupported.java b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/IppVersionsSupported.java new file mode 100644 index 000000000..072d7499a --- /dev/null +++ b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/IppVersionsSupported.java @@ -0,0 +1,122 @@ +/* IppVersionsSupported.java -- + Copyright (C) 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package gnu.javax.print.ipp.attribute.supported; + +import javax.print.attribute.Attribute; +import javax.print.attribute.EnumSyntax; +import javax.print.attribute.SupportedValuesAttribute; + +/** + * IppVersionsSupported attribute as described in RFC 2911 section + * 4.4.14 provides the value(s) (implemented as EnumSyntax) + * of the supported IPP versions. + * + * @author Wolfgang Baer (WBaer@gmx.de) + */ +public final class IppVersionsSupported extends EnumSyntax + implements SupportedValuesAttribute +{ + + // a keyword based attribute in IPP - int values just starting at 0 + + /** IPP version 1.0 */ + public static final IppVersionsSupported V_1_0 = + new IppVersionsSupported(0); + + /** IPP version 1.1 */ + public static final IppVersionsSupported V_1_1 = + new IppVersionsSupported(1); + + private static final String[] stringTable = { "1.0", "1.1" }; + + private static final IppVersionsSupported[] enumValueTable = { V_1_0, + V_1_1 }; + + /** + * Constructs a IppVersionsSupported object. + * + * @param value the enum value + */ + public IppVersionsSupported(int value) + { + super(value); + } + + /** + * Returns the category of this class. + * + * @return The class IppVersionsSupported itself. + */ + public Class getCategory() + { + return IppVersionsSupported.class; + } + + /** + * Returns the name of this attribute. + * + * @return The name "ipp-versions-supported". + */ + public String getName() + { + return "ipp-versions-supported"; + } + + /** + * Returns a table with the enumeration values represented as strings + * for this object. + * + * @return The enumeration values as strings. + */ + protected String[] getStringTable() + { + return stringTable; + } + + /** + * Returns a table with the enumeration values for this object. + * + * @return The enumeration values. + */ + protected EnumSyntax[] getEnumValueTable() + { + return enumValueTable; + } + +} diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/supported/JobHoldUntilSupported.java b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/JobHoldUntilSupported.java new file mode 100644 index 000000000..2add4a0cd --- /dev/null +++ b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/JobHoldUntilSupported.java @@ -0,0 +1,134 @@ +/* JobHoldUntilSupported.java -- + Copyright (C) 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package gnu.javax.print.ipp.attribute.supported; + +import java.util.Locale; + +import javax.print.attribute.Attribute; +import javax.print.attribute.SupportedValuesAttribute; +import javax.print.attribute.TextSyntax; + +/** + * JobHoldUntilSupported attribute provides the supported + * values for the attribute type job-hold-until. + * + * @author Wolfgang Baer (WBaer@gmx.de) + */ +public final class JobHoldUntilSupported extends TextSyntax + implements SupportedValuesAttribute +{ + + // a keyword/name based attribute in IPP + // can be extended by administrators + // standard values are predefined + + /** Job should be printed immediately. */ + public static final JobHoldUntilSupported NO_HOLD = + new JobHoldUntilSupported("no-hold", null); + + /** Job should be hold indefinitely. */ + public static final JobHoldUntilSupported INDEFINITE = + new JobHoldUntilSupported("indefinite", null); + + /** Job should be processed during the day. */ + public static final JobHoldUntilSupported DAY_TIME = + new JobHoldUntilSupported("day-time", null); + + /** Job should be processed in the evening. */ + public static final JobHoldUntilSupported EVENING = + new JobHoldUntilSupported("evening", null); + + /** Job should be processed during night. */ + public static final JobHoldUntilSupported NIGHT = + new JobHoldUntilSupported("night", null); + + /** Job should be processed during the weekend. */ + public static final JobHoldUntilSupported WEEKEND = + new JobHoldUntilSupported("weekend", null); + + /** + * Job should be processed as second-shift + * (after close of business). + */ + public static final JobHoldUntilSupported SECOND_SHIFT = + new JobHoldUntilSupported("second-shift", null); + + /** + * Job should be processed as third-shift + * (after midnight). + */ + public static final JobHoldUntilSupported THIRD_SHIFT = + new JobHoldUntilSupported("third-shift", null); + + /** + * Creates a JobHoldUntilSupported object with the + * given value and locale. + * + * @param value the value for this syntax + * @param locale the locale to use, if null the default + * locale is used. + * + * @throws NullPointerException if value is null + */ + public JobHoldUntilSupported(String value, Locale locale) + { + super(value, locale); + } + + /** + * Returns category of this class. + * + * @return The class JobHoldUntilSupported itself. + */ + public Class getCategory() + { + return JobHoldUntilSupported.class; + } + + /** + * Returns the name of this attribute. + * + * @return The name "job-hold-until-supported". + */ + public String getName() + { + return "job-hold-until-supported"; + } + +} diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/supported/JobSheetsSupported.java b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/JobSheetsSupported.java new file mode 100644 index 000000000..aeb86ff10 --- /dev/null +++ b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/JobSheetsSupported.java @@ -0,0 +1,148 @@ +/* JobSheetsSupported.java -- + Copyright (C) 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package gnu.javax.print.ipp.attribute.supported; + +import gnu.javax.print.ipp.attribute.defaults.JobSheetsDefault; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.Locale; +import java.util.Set; + +import javax.print.attribute.Attribute; +import javax.print.attribute.SupportedValuesAttribute; +import javax.print.attribute.TextSyntax; +import javax.print.attribute.standard.JobSheets; + +/** + * JobSheetsSupported attribute provides the supported values + * of the job-sheets attribute. + * + * @author Wolfgang Baer (WBaer@gmx.de) + */ +public final class JobSheetsSupported extends TextSyntax + implements SupportedValuesAttribute +{ + //a keyword/name based attribute in IPP + // can be extended by administrators + // standard values are predefined + + /** No job sheet is the default */ + public static final JobSheetsDefault NONE = + new JobSheetsDefault("none", Locale.getDefault()); + + /** A job sheet is the default */ + public static final JobSheetsDefault STANDARD = + new JobSheetsDefault("standard", Locale.getDefault()); + + /** + * Creates a JobSheetsSupported object with the + * given value and locale. + * + * @param value the value for this syntax + * @param locale the locale to use, if null the default + * locale is used. + * + * @throws NullPointerException if value is null + */ + public JobSheetsSupported(String value, Locale locale) + { + super(value, locale); + } + + /** + * Returns category of this class. + * + * @return The class JobSheetsSupported itself. + */ + public Class getCategory() + { + return JobSheetsSupported.class; + } + + /** + * Returns the name of this attribute. + * + * @return The name "job-sheets-supported". + */ + public String getName() + { + return "job-sheets-supported"; + } + + /** + * Returns the equally enum of the standard attribute class + * of this SupportedValuesAttribute enum. + *

May return null if no value exists in JPS API.

+ * + * @return The enum of the standard attribute class. + */ + public JobSheets getAssociatedAttribute() + { + if (this.equals(JobSheetsDefault.NONE)) + return JobSheets.NONE; + if (this.equals(JobSheetsDefault.STANDARD)) + return JobSheets.STANDARD; + + return null; + } + + /** + * Constructs an array from a set of -supported attributes. + * @param set set to process + * @return The constructed array. + * + * @see #getAssociatedAttribute() + */ + public static JobSheets[] + getAssociatedAttributeArray(Set set) + { + ArrayList result = new ArrayList(); + int j = 0; + for (Attribute tmp : set) + { + JobSheets att = ((JobSheetsSupported) tmp).getAssociatedAttribute(); + if (att != null) + result.add(att); + j++; + } + return result.toArray(new JobSheets[result.size()]); + } + +} diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/supported/MediaSupported.java b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/MediaSupported.java new file mode 100644 index 000000000..2684ebbec --- /dev/null +++ b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/MediaSupported.java @@ -0,0 +1,116 @@ +/* MediaSupported.java -- + Copyright (C) 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package gnu.javax.print.ipp.attribute.supported; + +import gnu.javax.print.ipp.IppUtilities; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.Locale; +import java.util.Set; + +import javax.print.attribute.Attribute; +import javax.print.attribute.SupportedValuesAttribute; +import javax.print.attribute.TextSyntax; +import javax.print.attribute.standard.Media; + +/** + * MediaSupported attribute provides the keyword values + * of the media types supported by the printer object. + * + * @author Wolfgang Baer (WBaer@gmx.de) + */ +public final class MediaSupported extends TextSyntax + implements SupportedValuesAttribute +{ + + /** + * Creates a MediaSupported object with the + * given value and locale. + * + * @param value the value for this syntax + * @param locale the locale to use, if null the default + * locale is used. + * + * @throws NullPointerException if value is null + */ + public MediaSupported(String value, Locale locale) + { + super(value, locale); + } + + /** + * Returns category of this class. + * + * @return The class MediaSupported itself. + */ + public Class getCategory() + { + return MediaSupported.class; + } + + /** + * Returns the name of this attribute. + * + * @return The name "media-supported". + */ + public String getName() + { + return "media-supported"; + } + + /** + * Constructs an array from a set of -supported attributes. + * @param set set to process + * @return The constructed array. + */ + public static Media[] getAssociatedAttributeArray(Set set) + { + Media tmp2; + ArrayList result = new ArrayList(); + for (Attribute tmp : set) + { + tmp2 = (Media) IppUtilities.getEnumAttribute("media", tmp.toString()); + if (tmp2 != null) + result.add(tmp2); + } + return result.toArray(new Media[result.size()]); + } + +} diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/supported/MultipleDocumentHandlingSupported.java b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/MultipleDocumentHandlingSupported.java new file mode 100644 index 000000000..73e5921f1 --- /dev/null +++ b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/MultipleDocumentHandlingSupported.java @@ -0,0 +1,176 @@ +/* MultipleDocumentHandlingSupported.java -- + Copyright (C) 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + +package gnu.javax.print.ipp.attribute.supported; + +import gnu.javax.print.ipp.IppUtilities; + +import java.util.Iterator; +import java.util.Set; + +import javax.print.attribute.Attribute; +import javax.print.attribute.EnumSyntax; +import javax.print.attribute.SupportedValuesAttribute; +import javax.print.attribute.standard.MultipleDocumentHandling; + + +/** + * MultipleDocumentHandlingSupported provides the + * supported values for the MultipleDocumentHandling attribute. + * + * @author Wolfgang Baer (WBaer@gmx.de) + */ +public final class MultipleDocumentHandlingSupported extends EnumSyntax + implements SupportedValuesAttribute +{ + + //a keyword based attribute in IPP - int values just starting at 0 + + /** + * Supports only multiple documents treated as a single document. This + * applies to attributes which specify treatment of multiple document jobs. + */ + public static final MultipleDocumentHandlingSupported SINGLE_DOCUMENT = + new MultipleDocumentHandlingSupported(0); + + /** Supports multiple documents as uncollated copies */ + public static final MultipleDocumentHandlingSupported SEPARATE_DOCUMENTS_UNCOLLATED_COPIES = + new MultipleDocumentHandlingSupported(1); + + /** Supports multiple documents as collated copies */ + public static final MultipleDocumentHandlingSupported SEPARATE_DOCUMENTS_COLLATED_COPIES = + new MultipleDocumentHandlingSupported(2); + + /** + * Supports multiple documents where every single document starts + * with a new sheet. + */ + public static final MultipleDocumentHandlingSupported SINGLE_DOCUMENT_NEW_SHEET = + new MultipleDocumentHandlingSupported(3); + + private static final String[] stringTable = { "single-document", + "separate-documents-uncollated-copies", + "separate-documents-collated-copies", + "single-document-new-sheet" }; + + private static final MultipleDocumentHandlingSupported[] enumValueTable = + { SINGLE_DOCUMENT, SEPARATE_DOCUMENTS_UNCOLLATED_COPIES, + SEPARATE_DOCUMENTS_COLLATED_COPIES, SINGLE_DOCUMENT_NEW_SHEET}; + + /** + * Constructs a MultipleDocumentHandlingSupported object. + * + * @param value the enum value + */ + protected MultipleDocumentHandlingSupported(int value) + { + super(value); + } + + /** + * Returns category of this class. + * + * @return The class MultipleDocumentHandlingSupported itself. + */ + public Class getCategory() + { + return MultipleDocumentHandlingSupported.class; + } + + /** + * Returns the name of this attribute. + * + * @return The name "multiple-document-handling-supported". + */ + public String getName() + { + return "multiple-document-handling-supported"; + } + + /** + * Returns a table with the enumeration values represented as strings + * for this object. + * + * @return The enumeration values as strings. + */ + protected String[] getStringTable() + { + return stringTable; + } + + /** + * Returns a table with the enumeration values for this object. + * + * @return The enumeration values. + */ + protected EnumSyntax[] getEnumValueTable() + { + return enumValueTable; + } + + /** + * Returns the equally enum of the standard attribute class + * of this SupportedValuesAttribute enum. + * + * @return The enum of the standard attribute class. + */ + public MultipleDocumentHandling getAssociatedAttribute() + { + return (MultipleDocumentHandling) IppUtilities.getEnumAttribute( + "multiple-document-handling", new Integer(getValue())); + } + + /** + * Constructs an array from a set of -supported attributes. + * @param set set to process + * @return The constructed array. + * + * @see #getAssociatedAttribute() + */ + public static MultipleDocumentHandling[] + getAssociatedAttributeArray(Set set) + { + MultipleDocumentHandling[] result = new MultipleDocumentHandling[set.size()]; + int j = 0; + for (Attribute tmp : set) + { + result[j] = ((MultipleDocumentHandlingSupported) tmp).getAssociatedAttribute(); + j++; + } + return result; + } +} diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/supported/MultipleDocumentJobsSupported.java b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/MultipleDocumentJobsSupported.java new file mode 100644 index 000000000..1b2998456 --- /dev/null +++ b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/MultipleDocumentJobsSupported.java @@ -0,0 +1,119 @@ +/* MultipleDocumentJobsSupported.java -- + Copyright (C) 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package gnu.javax.print.ipp.attribute.supported; + +import javax.print.attribute.Attribute; +import javax.print.attribute.EnumSyntax; +import javax.print.attribute.SupportedValuesAttribute; + +/** + * MultipleDocumentJobsSupported specifies if a printer + * supported multiple documents in one job. + * + * @author Wolfgang Baer (WBaer@gmx.de) + */ +public class MultipleDocumentJobsSupported extends EnumSyntax + implements SupportedValuesAttribute +{ + + /** Multiple documents per job are not supported. */ + public static final MultipleDocumentJobsSupported NOT_SUPPORTED = + new MultipleDocumentJobsSupported(0); + + /** Multiple documents per job are supported. */ + public static final MultipleDocumentJobsSupported SUPPORTED = + new MultipleDocumentJobsSupported(1); + + private static final String[] stringTable = { "not-supported", "supported" }; + + private static final MultipleDocumentJobsSupported[] enumValueTable = + { NOT_SUPPORTED, SUPPORTED }; + + /** + * Constructs a MultipleDocumentJobsSupported object. + * + * @param value the enum value + */ + protected MultipleDocumentJobsSupported(int value) + { + super(value); + } + + /** + * Returns category of this class. + * + * @return The class MultipleDocumentJobsSupported itself. + */ + public Class getCategory() + { + return MultipleDocumentJobsSupported.class; + } + + /** + * Returns the name of this attribute. + * + * @return The name "multiple-document-jobs-supported". + */ + public String getName() + { + return "multiple-document-jobs-supported"; + } + + /** + * Returns a table with the enumeration values represented as strings + * for this object. + * + * @return The enumeration values as strings. + */ + protected String[] getStringTable() + { + return stringTable; + } + + /** + * Returns a table with the enumeration values for this object. + * + * @return The enumeration values. + */ + protected EnumSyntax[] getEnumValueTable() + { + return enumValueTable; + } + +} diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/supported/OperationsSupported.java b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/OperationsSupported.java new file mode 100644 index 000000000..a059c89a5 --- /dev/null +++ b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/OperationsSupported.java @@ -0,0 +1,231 @@ +/* OperationsSupported.java -- + Copyright (C) 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package gnu.javax.print.ipp.attribute.supported; + +import javax.print.attribute.Attribute; +import javax.print.attribute.EnumSyntax; +import javax.print.attribute.SupportedValuesAttribute; + +/** + * OperationsSupported specifies the enums of the operations + * supported by a given printer or job object. The attribute is further + * specified in RFC 2911 section 4.4.15. + * + * @author Wolfgang Baer (WBaer@gmx.de) + */ +public final class OperationsSupported extends EnumSyntax + implements SupportedValuesAttribute +{ + /* + * Value Operation Name + ----------------- ------------------------------------- + 0x0000 reserved, not used + 0x0001 reserved, not used + 0x0002 Print-Job + 0x0003 Print-URI + 0x0004 Validate-Job + 0x0005 Create-Job + 0x0006 Send-Document + 0x0007 Send-URI + 0x0008 Cancel-Job + 0x0009 Get-Job-Attributes + 0x000A Get-Jobs + 0x000B Get-Printer-Attributes + 0x000C Hold-Job + 0x000D Release-Job + 0x000E Restart-Job + 0x000F reserved for a future operation + 0x0010 Pause-Printer + 0x0011 Resume-Printer + 0x0012 Purge-Jobs + 0x0013-0x3FFF reserved for future IETF standards track operations + 0x4000-0x8FFF reserved for vendor extensions + */ + + // standard ipp 1.1 operations + + /** + * Operation to print a job in one request/response. */ + public static final OperationsSupported PRINT_JOB = + new OperationsSupported(0x02); + + /** Operation to print a document from an URI */ + public static final OperationsSupported PRINT_URI = + new OperationsSupported(0x03); + + /** Operation to validate a job before submission. */ + public static final OperationsSupported VALIDATE_JOB = + new OperationsSupported(0x04); + + /** + * Operation to create an initial job for use with multiple document per job. + */ + public static final OperationsSupported CREATE_JOB = + new OperationsSupported(0x05); + + /** + * Operation to send a document to a multidoc job created via CREATE_JOB + */ + public static final OperationsSupported SEND_DOCUMENT = + new OperationsSupported(0x06); + + /** + * Operation to send a document uri to a multidoc job created + * via CREATE_JOB. The document accessible from this URI will be printed. + */ + public static final OperationsSupported SEND_URI = + new OperationsSupported(0x07); + + /** Operation to cancel a job by its ID or name. */ + public static final OperationsSupported CANCEL_JOB = + new OperationsSupported(0x08); + + /** Operation to get job attributes of a current job. */ + public static final OperationsSupported GET_JOB_ATTRIBUTES = + new OperationsSupported(0x09); + + /** Operation to pause a printer. */ + public static final OperationsSupported PAUSE_PRINTER = + new OperationsSupported(0x10); + + /** Operation to get all currently queued or processed jobs. */ + public static final OperationsSupported GET_JOBS = + new OperationsSupported(0x0A); + + /** Operation to get the attributes of a printer. */ + public static final OperationsSupported GET_PRINTER_ATTRIBUTES = + new OperationsSupported(0x0B); + + /** Operation to put a job on hold by its ID or name. */ + public static final OperationsSupported HOLD_JOB = + new OperationsSupported(0x0C); + + /** Operation to release a job by its ID or name. */ + public static final OperationsSupported RELEASE_JOB = + new OperationsSupported(0x0D); + + /** Operation to restart a job by its ID or name. */ + public static final OperationsSupported RESTART_JOB = + new OperationsSupported(0x0E); + + /** Not yet an operation - reserved for futher use. */ + public static final OperationsSupported RESERVED = + new OperationsSupported(0x0F); + + /** Operation to resume a printer. */ + public static final OperationsSupported RESUME_PRINTER = + new OperationsSupported(0x11); + + /** Operation to remove all jobs from a printer regardless of state. */ + public static final OperationsSupported PURGE_JOBS = + new OperationsSupported(0x12); + + + private static final String[] stringTable = { "print-job", "print-uri", + "validate-job", "create-job", + "send-document", "send-uri", + "cancel-job", "get-job-attributes", + "pause-printer", "get-jobs", + "get-printer-attributes", "hold-job", + "release-job", "restart-job", "reserved", + "resume-printer", "purge-job"}; + + private static final OperationsSupported[] enumValueTable = + { PRINT_JOB, PRINT_URI, VALIDATE_JOB, CREATE_JOB, SEND_DOCUMENT, SEND_URI, + CANCEL_JOB, GET_JOB_ATTRIBUTES, PAUSE_PRINTER, GET_JOBS, GET_PRINTER_ATTRIBUTES, + HOLD_JOB, RELEASE_JOB, RESTART_JOB, RESERVED, RESUME_PRINTER, PURGE_JOBS}; + + + /** + * Constructs a OperationsSupported object. + * + * @param value the enum value + */ + protected OperationsSupported(int value) + { + super(value); + } + + /** + * Returns category of this class. + * + * @return The class OperationsSupported itself. + */ + public Class getCategory() + { + return OperationsSupported.class; + } + + /** + * Returns the name of this attribute. + * + * @return The name "operations-supported". + */ + public String getName() + { + return "operations-supported"; + } + + /** + * Returns a table with the enumeration values represented as strings + * for this object. + * + * @return The enumeration values as strings. + */ + protected String[] getStringTable() + { + return stringTable; + } + + /** + * Returns a table with the enumeration values for this object. + * + * @return The enumeration values. + */ + protected EnumSyntax[] getEnumValueTable() + { + return enumValueTable; + } + + // we start with 2 + protected int getOffset() + { + return 2; + } +} diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/supported/OrientationRequestedSupported.java b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/OrientationRequestedSupported.java new file mode 100644 index 000000000..4b87c53a5 --- /dev/null +++ b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/OrientationRequestedSupported.java @@ -0,0 +1,178 @@ +/* OrientationRequestedSupported.java -- + Copyright (C) 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + +package gnu.javax.print.ipp.attribute.supported; + +import gnu.javax.print.ipp.IppUtilities; + +import java.util.Iterator; +import java.util.Set; + +import javax.print.attribute.Attribute; +import javax.print.attribute.EnumSyntax; +import javax.print.attribute.SupportedValuesAttribute; +import javax.print.attribute.standard.OrientationRequested; + + +/** + * The OrientationRequestedSupported attribute provides + * the supported values for the job attribute orientation-requested. + * + * @author Wolfgang Baer (WBaer@gmx.de) + */ +public final class OrientationRequestedSupported extends EnumSyntax + implements SupportedValuesAttribute +{ + + /** Orientation as portrait. */ + public static final OrientationRequestedSupported PORTRAIT = + new OrientationRequestedSupported(3); + + /** Orientation as landscape. */ + public static final OrientationRequestedSupported LANDSCAPE = + new OrientationRequestedSupported(4); + + /** Orientation as reversed landscape. */ + public static final OrientationRequestedSupported REVERSE_LANDSCAPE = + new OrientationRequestedSupported(5); + + /** Orientation as reversed portrait. */ + public static final OrientationRequestedSupported REVERSE_PORTRAIT = + new OrientationRequestedSupported(6); + + + private static final String[] stringTable = { "portrait", "landscape", + "reverse-landscape", + "reverse-portrait" }; + + private static final OrientationRequestedSupported[] + enumValueTable = { PORTRAIT, LANDSCAPE, + REVERSE_LANDSCAPE, REVERSE_PORTRAIT }; + + /** + * Constructs a OrientationRequestedSupported object. + * + * @param value the value + */ + protected OrientationRequestedSupported(int value) + { + super(value); + } + + /** + * Returns category of this class. + * + * @return The class OrientationRequestedSupported itself. + */ + public Class getCategory() + { + return OrientationRequestedSupported.class; + } + + /** + * Returns the name of this attribute. + * + * @return The name "orientation-requested-supported". + */ + public String getName() + { + return "orientation-requested-supported"; + } + + /** + * Returns a table with the enumeration values represented as strings + * for this object. + * + * @return The enumeration values as strings. + */ + protected String[] getStringTable() + { + return stringTable; + } + + /** + * Returns a table with the enumeration values for this object. + * + * @return The enumeration values. + */ + protected EnumSyntax[] getEnumValueTable() + { + return enumValueTable; + } + + /** + * Returns the lowest used value by the enumerations of this class. + * . + * @return The lowest value used. + */ + protected int getOffset() + { + return 3; + } + + /** + * Returns the equally enum of the standard attribute class + * of this SupportedValuesAttribute enum. + * + * @return The enum of the standard attribute class. + */ + public OrientationRequested getAssociatedAttribute() + { + return (OrientationRequested) IppUtilities.getEnumAttribute( + "orientation-requested", new Integer(getValue())); + } + + /** + * Constructs an array from a set of -supported attributes. + * @param set set to process + * @return The constructed array. + * + * @see #getAssociatedAttribute() + */ + public static OrientationRequested[] + getAssociatedAttributeArray(Set set) + { + OrientationRequested[] result = new OrientationRequested[set.size()]; + int j = 0; + for (Attribute tmp : set) + { + result[j] = ((OrientationRequestedSupported) tmp).getAssociatedAttribute(); + j++; + } + return result; + } +} diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/supported/PageRangesSupported.java b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/PageRangesSupported.java new file mode 100644 index 000000000..c58f76748 --- /dev/null +++ b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/PageRangesSupported.java @@ -0,0 +1,117 @@ +/* PageRangesSupported.java -- + Copyright (C) 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + +package gnu.javax.print.ipp.attribute.supported; + +import javax.print.attribute.Attribute; +import javax.print.attribute.EnumSyntax; +import javax.print.attribute.SupportedValuesAttribute; + +/** + * PageRangesSupported is a boolean typed + * attribute indicating (as EnumSyntax) if page ranges + * are supported. + * + * @author Wolfgang Baer (WBaer@gmx.de) + */ +public final class PageRangesSupported extends EnumSyntax + implements SupportedValuesAttribute +{ + /** Page ranges are not supported. */ + public static final PageRangesSupported NOT_SUPPORTED = + new PageRangesSupported(0); + + /** Page ranges are supported. */ + public static final PageRangesSupported SUPPORTED = + new PageRangesSupported(1); + + private static final String[] stringTable = { "not-supported", "supported" }; + + private static final PageRangesSupported[] enumValueTable = { NOT_SUPPORTED, + SUPPORTED }; + + /** + * Constructs a PageRangesSupported object. + * + * @param value the enum value + */ + protected PageRangesSupported(int value) + { + super(value); + } + + /** + * Returns category of this class. + * + * @return The class PageRangesSupported itself. + */ + public Class getCategory() + { + return PageRangesSupported.class; + } + + /** + * Returns the name of this attribute. + * + * @return The name "page-ranges-supported". + */ + public String getName() + { + return "page-ranges-supported"; + } + + /** + * Returns a table with the enumeration values represented as strings + * for this object. + * + * @return The enumeration values as strings. + */ + protected String[] getStringTable() + { + return stringTable; + } + + /** + * Returns a table with the enumeration values for this object. + * + * @return The enumeration values. + */ + protected EnumSyntax[] getEnumValueTable() + { + return enumValueTable; + } +} diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/supported/PrintQualitySupported.java b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/PrintQualitySupported.java new file mode 100644 index 000000000..25cbf9f0b --- /dev/null +++ b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/PrintQualitySupported.java @@ -0,0 +1,169 @@ +/* PrintQualitySupported.java -- + Copyright (C) 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + +package gnu.javax.print.ipp.attribute.supported; + +import gnu.javax.print.ipp.IppUtilities; + +import java.util.Iterator; +import java.util.Set; + +import javax.print.attribute.Attribute; +import javax.print.attribute.EnumSyntax; +import javax.print.attribute.SupportedValuesAttribute; +import javax.print.attribute.standard.PrintQuality; + + +/** + * PrintQualitySupported provides the + * supported values for the print-quality attribute. + * + * @author Wolfgang Baer (WBaer@gmx.de) + */ +public final class PrintQualitySupported extends EnumSyntax + implements SupportedValuesAttribute +{ + /** Draft quality of the printer. */ + public static final PrintQualitySupported DRAFT = + new PrintQualitySupported(3); + + /** Normal quality of the printer. */ + public static final PrintQualitySupported NORMAL = + new PrintQualitySupported(4); + + /** High quality of the printer. */ + public static final PrintQualitySupported HIGH = + new PrintQualitySupported(5); + + private static final String[] stringTable = { "draft", "normal", "high" }; + + private static final PrintQualitySupported[] enumValueTable = { DRAFT, + NORMAL, + HIGH }; + + /** + * Constructs a PrintQualitySupported object. + * + * @param value the value of the enum + */ + protected PrintQualitySupported(int value) + { + super(value); + } + + /** + * Returns category of this class. + * + * @return The class PrintQualitySupported itself. + */ + public Class getCategory() + { + return PrintQualitySupported.class; + } + + /** + * Returns the name of this attribute. + * + * @return The name "print-quality-supported". + */ + public String getName() + { + return "print-quality-supported"; + } + + /** + * Returns a table with the enumeration values represented as strings + * for this object. + * + * @return The enumeration values as strings. + */ + protected String[] getStringTable() + { + return stringTable; + } + + /** + * Returns a table with the enumeration values for this object. + * + * @return The enumeration values. + */ + protected EnumSyntax[] getEnumValueTable() + { + return enumValueTable; + } + + /** + * Returns the lowest used value by the enumerations of this class. + * . + * @return The lowest value used. + */ + protected int getOffset() + { + return 3; + } + + /** + * Returns the equally enum of the standard attribute class + * of this SupportedValuesAttribute enum. + * + * @return The enum of the standard attribute class. + */ + public PrintQuality getAssociatedAttribute() + { + return (PrintQuality) IppUtilities.getEnumAttribute( + "print-quality", new Integer(getValue())); + } + + /** + * Constructs an array from a set of -supported attributes. + * @param set set to process + * @return The constructed array. + * + * @see #getAssociatedAttribute() + */ + public static PrintQuality[] getAssociatedAttributeArray(Set set) + { + PrintQuality[] result = new PrintQuality[set.size()]; + int j = 0; + for (Attribute tmp : set) + { + result[j] = ((PrintQualitySupported) tmp).getAssociatedAttribute(); + j++; + } + return result; + } +} diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/supported/PrinterResolutionSupported.java b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/PrinterResolutionSupported.java new file mode 100644 index 000000000..eb50aaac5 --- /dev/null +++ b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/PrinterResolutionSupported.java @@ -0,0 +1,142 @@ +/* PrinterResolutionSupported.java -- + Copyright (C) 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + +package gnu.javax.print.ipp.attribute.supported; + +import java.util.Iterator; +import java.util.Set; + +import javax.print.attribute.Attribute; +import javax.print.attribute.ResolutionSyntax; +import javax.print.attribute.SupportedValuesAttribute; +import javax.print.attribute.standard.PrinterResolution; + + +/** + * The PrinterResolutionSupported attribute provides + * the supported values for the job attribute printer-resolution. + * + * @author Wolfgang Baer (WBaer@gmx.de) + */ +public final class PrinterResolutionSupported extends ResolutionSyntax + implements SupportedValuesAttribute +{ + + /** + * Creates a PrinterResolutionSupported object with the + * given arguments. + * + * @param crossFeedResolution the cross feed resolution + * @param feedResolution the feed resolution + * @param units the unit to use (e.g. {@link #DPCM} or {@link #DPI}) + * + * @exception IllegalArgumentException if preconditions fail + */ + public PrinterResolutionSupported(int crossFeedResolution, + int feedResolution, int units) + { + super(crossFeedResolution, feedResolution, units); + } + + /** + * Tests if the given object is equal to this object. + * + * @param obj the object to test + * + * @return true if both objects are equal, + * false otherwise. + */ + public boolean equals(Object obj) + { + if(! (obj instanceof PrinterResolutionSupported)) + return false; + + return super.equals(obj); + } + + /** + * Returns category of this class. + * + * @return The class PrinterResolutionSupported itself. + */ + public Class getCategory() + { + return PrinterResolutionSupported.class; + } + + /** + * Returns the name of this attribute. + * + * @return The name "printer-resolution-supported". + */ + public String getName() + { + return "printer-resolution-supported"; + } + + /** + * Returns the equally enum of the standard attribute class + * of this SupportedValuesAttribute enum. + * + * @return The enum of the standard attribute class. + */ + public PrinterResolution getAssociatedAttribute() + { + return new PrinterResolution(getCrossFeedResolutionDphi(), + getFeedResolutionDphi(), 1); + } + + /** + * Constructs an array from a set of -supported attributes. + * @param set set to process + * @return The constructed array. + * + * @see #getAssociatedAttribute() + */ + public static PrinterResolution[] + getAssociatedAttributeArray(Set set) + { + PrinterResolution[] result = new PrinterResolution[set.size()]; + int j = 0; + for (Attribute tmp : set) + { + result[j] = ((PrinterResolutionSupported) tmp).getAssociatedAttribute(); + j++; + } + return result; + } +} diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/supported/PrinterUriSupported.java b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/PrinterUriSupported.java new file mode 100644 index 000000000..0eed39c6c --- /dev/null +++ b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/PrinterUriSupported.java @@ -0,0 +1,89 @@ +/* PrinterUriSupported.java -- + Copyright (C) 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package gnu.javax.print.ipp.attribute.supported; + +import java.net.URI; + +import javax.print.attribute.Attribute; +import javax.print.attribute.SupportedValuesAttribute; +import javax.print.attribute.URISyntax; + +/** + * PrinterUriSupported attribute as described in RFC 2911 section + * 4.4.1 contains one of the URIs the printer supported for + * job processing (e.g. one with authentication). + * + * @author Wolfgang Baer (WBaer@gmx.de) + */ +public final class PrinterUriSupported extends URISyntax + implements SupportedValuesAttribute +{ + + /** + * Creates a PrinterUriSupported object. + * + * @param uri the URI value for the syntax + * @throws NullPointerException if uri is null + */ + public PrinterUriSupported(URI uri) + { + super(uri); + } + + /** + * Returns category of this class. + * + * @return The class PrinterUriSupported itself. + */ + public Class getCategory() + { + return PrinterUriSupported.class; + } + + /** + * Returns the name of this attribute. + * + * @return The name "printer-uri-supported". + */ + public String getName() + { + return "printer-uri-supported"; + } + +} diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/supported/SidesSupported.java b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/SidesSupported.java new file mode 100644 index 000000000..eff82c143 --- /dev/null +++ b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/SidesSupported.java @@ -0,0 +1,137 @@ +/* SidesSupported.java -- + Copyright (C) 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + +package gnu.javax.print.ipp.attribute.supported; + +import javax.print.attribute.Attribute; +import javax.print.attribute.EnumSyntax; +import javax.print.attribute.SupportedValuesAttribute; + + +/** + * SidesSupported provides the + * supported values for the sides attribute. + * + * @author Wolfgang Baer (WBaer@gmx.de) + */ +public final class SidesSupported extends EnumSyntax + implements SupportedValuesAttribute +{ + + /** Specifies that each page should be printed on one sheet. */ + public static final SidesSupported ONE_SIDED = new SidesSupported(0); + + /** + * Specifies that two following pages should be printed on the + * front and back of one sheet for binding on the long edge. + */ + public static final SidesSupported TWO_SIDED_LONG_EDGE = + new SidesSupported(1); + + /** + * Specifies that two following pages should be printed on the + * front and back of one sheet for binding on the short edge. + */ + public static final SidesSupported TWO_SIDED_SHORT_EDGE = + new SidesSupported(2); + + /** An alias constant for "two sided long edge". */ + public static final SidesSupported DUPLEX = new SidesSupported(1); + + /** An alias constant for "two sided short edge". */ + public static final SidesSupported TUMBLE = new SidesSupported(2); + + private static final String[] stringTable = { "one-sided", + "two-sided-long-edge", + "two-sided-short-edge" }; + + private static final SidesSupported[] + enumValueTable = { ONE_SIDED, TWO_SIDED_LONG_EDGE, + TWO_SIDED_SHORT_EDGE }; + + + /** + * Creates a SidesSupported object. + * + * @param value the value of the enum + */ + protected SidesSupported(int value) + { + super(value); + } + + /** + * Returns category of this class. + * + * @return The class SidesSupported itself. + */ + public Class getCategory() + { + return SidesSupported.class; + } + + /** + * Returns the name of this attribute. + * + * @return The name "sides-supported". + */ + public String getName() + { + return "sides-supported"; + } + + /** + * Returns a table with the enumeration values represented as strings + * for this object. + * + * @return The enumeration values as strings. + */ + protected String[] getStringTable() + { + return stringTable; + } + + /** + * Returns a table with the enumeration values for this object. + * + * @return The enumeration values. + */ + protected EnumSyntax[] getEnumValueTable() + { + return enumValueTable; + } +} diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/supported/UriAuthenticationSupported.java b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/UriAuthenticationSupported.java new file mode 100644 index 000000000..dc1a29f5c --- /dev/null +++ b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/UriAuthenticationSupported.java @@ -0,0 +1,142 @@ +/* UriAuthenticationSupported.java -- + Copyright (C) 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package gnu.javax.print.ipp.attribute.supported; + +import javax.print.attribute.Attribute; +import javax.print.attribute.EnumSyntax; +import javax.print.attribute.SupportedValuesAttribute; + +/** + * UriAuthenticationSupported attribute as described in RFC 2911 section + * 4.4.2 provides the keywords (implemented as EnumSyntax) which + * authentication methods are supported by the printer object. This + * includes a value of none. + * + * @author Wolfgang Baer (WBaer@gmx.de) + */ +public final class UriAuthenticationSupported extends EnumSyntax + implements SupportedValuesAttribute +{ + + // a keyword based attribute in IPP - int values just starting at 0 + + /** Supports no authentication - assumes anonymous process */ + public static final UriAuthenticationSupported NONE = + new UriAuthenticationSupported(0); + + /** + * The authenticated user assumed is the value of the + * "requesting-user-name" operation attribute supplied + * with the operation. + */ + public static final UriAuthenticationSupported REQUESTING_USER_NAME = + new UriAuthenticationSupported(1); + + /** Supports HTTP basic authentication (RFC 2617) */ + public static final UriAuthenticationSupported BASIC = + new UriAuthenticationSupported(2); + + /** Supports HTTP digest authentication (RFC 2617) */ + public static final UriAuthenticationSupported DIGEST = + new UriAuthenticationSupported(3); + + /** Supports authentication through a client provided certificate */ + public static final UriAuthenticationSupported CERTIFICATE = + new UriAuthenticationSupported(4); + + private static final String[] stringTable = { "none", + "requesting-user-name", + "basic", "digest", + "certificate" }; + + private static final UriAuthenticationSupported[] enumValueTable = + { NONE, REQUESTING_USER_NAME, BASIC, DIGEST, CERTIFICATE }; + + /** + * Constructs a UriAuthenticationSupported object. + * + * @param value the enum value + */ + public UriAuthenticationSupported(int value) + { + super(value); + } + + /** + * Returns category of this class. + * + * @return The class UriAuthenticationSupported itself. + */ + public Class getCategory() + { + return UriAuthenticationSupported.class; + } + + /** + * Returns the name of this attribute. + * + * @return The name "uri-authentication-supported". + */ + public String getName() + { + return "uri-authentication-supported"; + } + + /** + * Returns a table with the enumeration values represented as strings + * for this object. + * + * @return The enumeration values as strings. + */ + protected String[] getStringTable() + { + return stringTable; + } + + /** + * Returns a table with the enumeration values for this object. + * + * @return The enumeration values. + */ + protected EnumSyntax[] getEnumValueTable() + { + return enumValueTable; + } + +} diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/supported/UriSecuritySupported.java b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/UriSecuritySupported.java new file mode 100644 index 000000000..03396978f --- /dev/null +++ b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/UriSecuritySupported.java @@ -0,0 +1,127 @@ +/* UriSecuritySupported.java -- + Copyright (C) 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package gnu.javax.print.ipp.attribute.supported; + +import javax.print.attribute.Attribute; +import javax.print.attribute.EnumSyntax; +import javax.print.attribute.SupportedValuesAttribute; + +/** + * UriSecuritySupported attribute as described in RFC 2911 section + * 4.4.3 provides the keywords (implemented as EnumSyntax) for + * the security mechanisms supported by the corresponding uri's + * supported (same place in setOf). + * + * @author Wolfgang Baer (WBaer@gmx.de) + */ +public final class UriSecuritySupported extends EnumSyntax + implements SupportedValuesAttribute +{ + + // a keyword based attribute in IPP - int values just starting at 0 + + /** The URI has no secure communication */ + public static final UriSecuritySupported NONE = + new UriSecuritySupported(0); + + /** The URI has SSL3 communication */ + public static final UriSecuritySupported SSL3 = + new UriSecuritySupported(1); + + /** The URI has TLS (RFC 2246) communication */ + public static final UriSecuritySupported TLS = + new UriSecuritySupported(2); + + private static final String[] stringTable = { "none", "ssl3", "tls" }; + + private static final UriSecuritySupported[] enumValueTable = { NONE, + SSL3, TLS }; + + /** + * Constructs a UriSecuritySupported object. + * + * @param value the enum value + */ + public UriSecuritySupported(int value) + { + super(value); + } + + /** + * Returns category of this class. + * + * @return The class UriSecuritySupported itself. + */ + public Class getCategory() + { + return UriSecuritySupported.class; + } + + /** + * Returns the name of this attribute. + * + * @return The name "uri-security-supported". + */ + public String getName() + { + return "uri-security-supported"; + } + + /** + * Returns a table with the enumeration values represented as strings + * for this object. + * + * @return The enumeration values as strings. + */ + protected String[] getStringTable() + { + return stringTable; + } + + /** + * Returns a table with the enumeration values for this object. + * + * @return The enumeration values. + */ + protected EnumSyntax[] getEnumValueTable() + { + return enumValueTable; + } + +} -- cgit v1.2.3