From 554fd8c5195424bdbcabf5de30fdc183aba391bd Mon Sep 17 00:00:00 2001
From: upstream source tree
+ * The print service hereby may be a real physical printer device, a printer
+ * group with same capabilities or a logical print service (like for example
+ * a PDF writer). The print service is used to query the capabilities of the
+ * represented printer instance. If a suitable print service is found it is
+ * used to create a print job for the actual printing process.
+ *
+ * A return value of
+ * The returned object may be one of the following types:
+ * PrintService
represents a printer available for printing.
+ * true
if both services refer to the same underlying
+ * service, false
otherwise.
+ */
+ boolean equals(Object obj);
+
+ /**
+ * Returns the value of the single specified attribute.
+ *
+ * @param category the category of a PrintServiceAttribute
+ *
+ * @return The value of the attribute, or null
if the attribute
+ * category is not supported by this print service implementation.
+ *
+ * @throws NullPointerException if category is null
.
+ * @throws IllegalArgumentException if category is not a class that
+ * implements PrintServiceAttribute
.
+ */
+ PrintServiceAttributeListener
may be registered.
+ *
+ * @return All the description attributes of this print service.
+ * @see #addPrintServiceAttributeListener(PrintServiceAttributeListener)
+ */
+ PrintServiceAttributeSet getAttributes();
+
+ /**
+ * Determines and returns the default value for a given attribute category
+ * of this print service.
+ * null
means either that the print service
+ * does not support the attribute category or there is no default value
+ * available for this category. To distinguish these two case one can test
+ * with {@link #isAttributeCategorySupported(Class)} if the category is
+ * supported.
+ * null
.
+ *
+ * @throws NullPointerException if category
is null
+ * @throws IllegalArgumentException if category
is a class
+ * not implementing Attribute
+ */
+ Object getDefaultAttributeValue(Class extends Attribute> category);
+
+ /**
+ * Returns the name of this print service.
+ * This may be the value of the PrinterName
attribute.
+ *
+ * @return The print service name.
+ */
+ String getName();
+
+ /**
+ * Returns a factory for UI components if supported by the print service.
+ *
+ * @return A factory for UI components or null
.
+ */
+ ServiceUIFactory getServiceUIFactory();
+
+ /**
+ * Returns all supported attribute categories.
+ *
+ * @return The class array of all supported attribute categories.
+ */
+ Class>[] getSupportedAttributeCategories();
+
+ /**
+ * Determines and returns all supported attribute values of a given
+ * attribute category a client can use when setting up a print job
+ * for this print service.
+ *
+ *
+ *
null
+ * @param attributes set of attributes for a supposed job,
+ * or null
+ *
+ * @return A object (as defined above) indicating the supported values
+ * for the given attribute category, or null
if this print
+ * service doesn't support the given attribute category at all.
+ *
+ * @throws NullPointerException if category
is null
+ * @throws IllegalArgumentException if category
is a class not
+ * implementing Attribute
, or if flavor
is not
+ * supported
+ */
+ Object getSupportedAttributeValues(Class extends Attribute> category,
+ DocFlavor flavor,
+ AttributeSet attributes);
+
+ /**
+ * Determines and returns an array of all supported document flavors which
+ * can be used to supply print data to this print service.
+ * + * The supported attribute categories may differ between the supported + * document flavors. To test for supported attributes one can use the + * {@link #getUnsupportedAttributes(DocFlavor, AttributeSet)} method with + * the specific doc flavor and attributes set. + *
+ * + * @return the supported document flavors + */ + DocFlavor[] getSupportedDocFlavors(); + + /** + * Identifies all the unsupported attributes of the given set of attributes + * in the context of the specified document flavor. + *
+ * The given flavor has to be supported by the print service (use
+ * {@link #isDocFlavorSupported(DocFlavor)} to verify). The method will
+ * return null
if all given attributes are supported. Otherwise
+ * a set of unsupported attributes are returned. The attributes in the
+ * returned set may be completely unsupported or only the specific requested
+ * value. If flavor is null
the default document flavor of the
+ * print service is used in the identification process.
+ *
null
.
+ * @param attributes set of printing attributes for a supposed job
+ *
+ * @return null
if this print service supports all the given
+ * attributes for the specified doc flavor. Otherwise the set of unsupported
+ * attributes are returned.
+ *
+ * @throws IllegalArgumentException if flavor
is unsupported
+ */
+ AttributeSet getUnsupportedAttributes(DocFlavor flavor, AttributeSet attributes);
+
+
+ /**
+ * Returns a hashcode for this print service.
+ *
+ * @return The hashcode.
+ */
+ int hashCode();
+
+ /**
+ * Determines a given attribute category is supported by this
+ * print service implementation. This only tests for the category
+ * not for any specific values of this category nor in the context
+ * of a specific document flavor.
+ *
+ * @param category the category to check
+ *
+ * @return true
if category
is supported,
+ * false
otherwise.
+ *
+ * @throws NullPointerException if category
is null
+ * @throws IllegalArgumentException if category
is a class not
+ * implementing Attribute
.
+ */
+ boolean isAttributeCategorySupported(Class extends Attribute> category);
+
+ /**
+ * Determines if a given attribute value is supported when creating a print
+ * job for this print service.
+ *
+ * If either the document flavor or the provided attributes are
+ * null
it is determined if the given attribute value is
+ * supported in some combination of the available document flavors and
+ * attributes of the print service. Otherwise it is checked for the
+ * specific context of the given document flavor/attributes set.
+ *
null
.
+ * @param attributes set of attributes to use, or null
.
+ *
+ * @return true
if the attribute value is supported in the
+ * requested context, false
otherwise.
+ *
+ * @throws NullPointerException if attrval
is null
.
+ * @throws IllegalArgumentException if flavor
is not supported
+ * by this print service
+ */
+ boolean isAttributeValueSupported(Attribute attrval, DocFlavor flavor, AttributeSet attributes);
+
+ /**
+ * Determines if a given document flavor is supported or not.
+ *
+ * @param flavor the document flavor to check
+ *
+ * @return true
if flavor
is supported,
+ * false
otherwise.
+ *
+ * @throws NullPointerException if flavor
is null.
+ */
+ boolean isDocFlavorSupported(DocFlavor flavor);
+
+ /**
+ * Registers a print service attribute listener to this print service.
+ *
+ * @param listener the listener to add
+ */
+ void addPrintServiceAttributeListener(PrintServiceAttributeListener listener);
+
+ /**
+ * De-registers a print service attribute listener from this print service.
+ *
+ * @param listener the listener to remove
+ */
+ void removePrintServiceAttributeListener(PrintServiceAttributeListener listener);
+}
--
cgit v1.2.3