0N/A/*
2362N/A * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/A
0N/Apackage javax.print.event;
0N/A
0N/Aimport javax.print.DocPrintJob;
0N/A
0N/A/**
0N/A *
0N/A * Class <code>PrintJobEvent</code> encapsulates common events a print job
0N/A * reports to let a listener know of progress in the processing of the
0N/A * {@link DocPrintJob}.
0N/A *
0N/A */
0N/A
0N/Apublic class PrintJobEvent extends PrintEvent {
0N/A
0N/A private static final long serialVersionUID = -1711656903622072997L;
0N/A
0N/A private int reason;
0N/A
0N/A /**
0N/A * The job was canceled by the {@link javax.print.PrintService PrintService}.
0N/A */
0N/A public static final int JOB_CANCELED = 101;
0N/A
0N/A /**
0N/A * The document cis completely printed.
0N/A */
0N/A public static final int JOB_COMPLETE = 102;
0N/A
0N/A /**
0N/A * The print service reports that the job cannot be completed.
0N/A * The application must resubmit the job.
0N/A */
0N/A
0N/A public static final int JOB_FAILED = 103;
0N/A
0N/A /**
0N/A * The print service indicates that a - possibly transient - problem
0N/A * may require external intervention before the print service can
0N/A * continue. One example of an event that can
0N/A * generate this message is when the printer runs out of paper.
0N/A */
0N/A public static final int REQUIRES_ATTENTION = 104;
0N/A
0N/A /**
0N/A * Not all print services may be capable of delivering interesting
0N/A * events, or even telling when a job is complete. This message indicates
0N/A * the print job has no further information or communication
0N/A * with the print service. This message should always be delivered
0N/A * if a terminal event (completed/failed/canceled) is not delivered.
0N/A * For example, if messages such as JOB_COMPLETE have NOT been received
0N/A * before receiving this message, the only inference that should be drawn
0N/A * is that the print service does not support delivering such an event.
0N/A */
0N/A public static final int NO_MORE_EVENTS = 105;
0N/A
0N/A /**
0N/A * The job is not necessarily printed yet, but the data has been transferred
0N/A * successfully from the client to the print service. The client may
0N/A * free data resources.
0N/A */
0N/A public static final int DATA_TRANSFER_COMPLETE = 106;
0N/A
0N/A /**
0N/A * Constructs a <code>PrintJobEvent</code> object.
0N/A *
0N/A * @param source a <code>DocPrintJob</code> object
0N/A * @param reason an int specifying the reason.
0N/A * @throws IllegalArgumentException if <code>source</code> is
0N/A * <code>null</code>.
0N/A */
0N/A
0N/A public PrintJobEvent( DocPrintJob source, int reason) {
0N/A
0N/A super(source);
0N/A this.reason = reason;
0N/A }
0N/A
0N/A /**
0N/A * Gets the reason for this event.
0N/A * @return reason int.
0N/A */
0N/A public int getPrintEventType() {
0N/A return reason;
0N/A }
0N/A
0N/A /**
0N/A * Determines the <code>DocPrintJob</code> to which this print job
0N/A * event pertains.
0N/A *
0N/A * @return the <code>DocPrintJob</code> object that represents the
0N/A * print job that reports the events encapsulated by this
0N/A * <code>PrintJobEvent</code>.
0N/A *
0N/A */
0N/A public DocPrintJob getPrintJob() {
0N/A return (DocPrintJob) getSource();
0N/A }
0N/A
0N/A
0N/A}