01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: /**
18: * @author Igor A. Pyankov
19: * @version $Revision: 1.2 $
20: */package org.apache.harmony.x.print;
21:
22: import javax.print.Doc;
23: import javax.print.DocFlavor;
24: import javax.print.PrintException;
25: import javax.print.attribute.Attribute;
26: import javax.print.attribute.AttributeSet;
27: import javax.print.attribute.PrintRequestAttributeSet;
28: import javax.print.attribute.PrintServiceAttributeSet;
29:
30: public interface PrintClient {
31:
32: /**
33: * Prints document.
34: * @param doc - document to print
35: * @param set - set of printing request attributes.
36: */
37: public void print(Doc doc, PrintRequestAttributeSet has)
38: throws PrintException;
39:
40: /**
41: * Retrieves a list of doc flavors which are supported by
42: * particular client.
43: * @return an array of DocFlavor instances.
44: */
45: public DocFlavor[] getSupportedDocFlavors();
46:
47: /**
48: * Retrieves attributes of client's print service.
49: * @return set of print service attributes.
50: */
51: public PrintServiceAttributeSet getAttributes();
52:
53: /**
54: * Retrieves categories of print request attributes
55: * supported by client.
56: * @return an array of print request attribute categories.
57: */
58: public Class[] getSupportedAttributeCategories();
59:
60: /**
61: * Retrieves default value of print request attribute
62: * supported by client.
63: * @param category category of print request attribute.
64: * @return instance of print request attribute of specified
65: * category, which describes its default value.
66: */
67: public Object getDefaultAttributeValue(Class category);
68:
69: /**
70: * Checks whether print request attribute value is supported
71: * by client in combination with doc's flavor and set of
72: * other attributes.
73: * @param attribute print request attribute to check.
74: * @param flavor flavor of document, for which check should
75: * be performed.
76: * @param attributes set of doc's print request attributes.
77: * @return true if attribute value is supported, and otherwise
78: * false.
79: */
80: boolean isAttributeValueSupported(Attribute attribute,
81: DocFlavor flavor, AttributeSet attributes);
82:
83: /**
84: * Retrieves all supported print request attribute values of
85: * specified category in combination with specified doc's
86: * flavor and set of print request attributes.
87: * @param category category for which values should be
88: * returned.
89: * @param flavor flavor of document, for which check should
90: * be performed.
91: * @param attributes set of doc's print request attributes.
92: * @return
93: */
94: public Object getSupportedAttributeValues(Class category,
95: DocFlavor flavor, AttributeSet attributes);
96: }
|