2 * Copyright (C) 2003 <a href="http://www.lohndirekt.de/">lohndirekt.de</a>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 package de
.lohndirekt
.print
.attribute
.cups
;
21 import javax
.print
.attribute
.IntegerSyntax
;
22 import javax
.print
.attribute
.PrintServiceAttribute
;
24 public class PrinterType
extends IntegerSyntax
implements PrintServiceAttribute
{
26 public static final int IS_PRINTER_CLASS
= 1 << 0;
27 public static final int IS_REMOTE_DESTINATION
= 1 << 1;
28 public static final int CAN_BLACK
= 1 << 2;
29 public static final int CAN_COLOR
= 1 << 3;
30 public static final int CAN_DUPLEX
= 1 << 4;
31 public static final int CAN_STAPLE
= 1 << 5;
32 public static final int CAN_UNCOLLATED
= 1 << 6;
33 public static final int CAN_COLLATED
= 1 << 7;
34 public static final int CAN_PUNCH
= 1 << 8;
35 public static final int CAN_COVER
= 1 << 9;
36 public static final int CAN_BIND
= 1 << 10;
37 public static final int CAN_SORT
= 1 << 11;
38 public static final int CAN_A4
= 1 << 12;
39 public static final int CAN_A2
= 1 << 13;
40 public static final int CAN_LARGER_A2
= 1 << 14;
41 public static final int CAN_USER_DEFINED_MEDIA_SIZE
= 1 << 15;
42 public static final int IS_IMPLICIT_CLASS
= 1 << 16;
44 public boolean isPrinterClass() {
45 return (getValue() & IS_PRINTER_CLASS
) == 1;
48 public boolean isRemoteDestination() {
49 return (getValue() & IS_REMOTE_DESTINATION
) == 1;
52 public boolean canPrintBlack() {
53 return (getValue() & CAN_BLACK
) == 1;
56 public boolean canPrintColor() {
57 return (getValue() & CAN_COLOR
) == 1;
60 public boolean canDuplex() {
61 return (getValue() & CAN_DUPLEX
) == 1;
64 public boolean canStaple() {
65 return (getValue() & CAN_STAPLE
) == 1;
68 public boolean canUncollated() {
69 return (getValue() & CAN_UNCOLLATED
) == 1;
72 public boolean canCollated() {
73 return (getValue() & CAN_COLLATED
) == 1;
76 public boolean canPunch() {
77 return (getValue() & CAN_PUNCH
) == 1;
80 public boolean canCover() {
81 return (getValue() & CAN_COVER
) == 1;
84 public boolean canBind() {
85 return (getValue() & CAN_BIND
) == 1;
88 public boolean canSort() {
89 return (getValue() & CAN_SORT
) == 1;
92 public boolean canA4() {
93 return (getValue() & CAN_A4
) == 1;
96 public boolean canA2() {
97 return (getValue() & CAN_A2
) == 1;
99 public boolean canLargerA2() {
100 return (getValue() & CAN_LARGER_A2
) == 1;
103 public boolean canUserDefinedMediaSize() {
104 return (getValue() & CAN_USER_DEFINED_MEDIA_SIZE
) == 1;
106 public boolean isImplicitClass() {
107 return (getValue() & IS_IMPLICIT_CLASS
) == 1;
114 public PrinterType(int value
) {
122 public Class
getCategory() {
123 return this.getClass();
130 public String
getName() {
131 return PrinterType
.getIppName();
137 public static final String
getIppName() {
138 return "printer-type";