1. /*
  2. * @(#)PrintJobListener.java 1.6 03/01/23
  3. *
  4. * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package javax.print.event;
  8. /**
  9. * Implementations of this listener interface should be attached to a
  10. * {@link javax.print.DocPrintJob DocPrintJob} to monitor the status of
  11. * the printer job.
  12. * These callback methods may be invoked on the thread processing the
  13. * print job, or a service created notification thread. In either case
  14. * the client should not perform lengthy processing in these callbacks.
  15. */
  16. public interface PrintJobListener {
  17. /**
  18. * Called to notify the client that data has been successfully
  19. * transferred to the print service, and the client may free
  20. * local resources allocated for that data. The client should
  21. * not assume that the data has been completely printed after
  22. * receiving this event.
  23. * If this event is not received the client should wait for a terminal
  24. * event (completed/canceled/failed) before freeing the resources.
  25. * @param pje the job generating this event
  26. */
  27. public void printDataTransferCompleted(PrintJobEvent pje) ;
  28. /**
  29. * Called to notify the client that the job completed successfully.
  30. * @param pje the job generating this event
  31. */
  32. public void printJobCompleted(PrintJobEvent pje) ;
  33. /**
  34. * Called to notify the client that the job failed to complete
  35. * successfully and will have to be resubmitted.
  36. * @param pje the job generating this event
  37. */
  38. public void printJobFailed(PrintJobEvent pje) ;
  39. /**
  40. * Called to notify the client that the job was canceled
  41. * by a user or a program.
  42. * @param pje the job generating this event
  43. */
  44. public void printJobCanceled(PrintJobEvent pje) ;
  45. /**
  46. * Called to notify the client that no more events will be delivered.
  47. * One cause of this event being generated is if the job
  48. * has successfully completed, but the printing system
  49. * is limited in capability and cannot verify this.
  50. * This event is required to be delivered if none of the other
  51. * terminal events (completed/failed/canceled) are delivered.
  52. * @param pje the job generating this event
  53. */
  54. public void printJobNoMoreEvents(PrintJobEvent pje) ;
  55. /**
  56. * Called to notify the client that an error has occurred that the
  57. * user might be able to fix. One example of an error that can
  58. * generate this event is when the printer runs out of paper.
  59. * @param pje the job generating this event
  60. */
  61. public void printJobRequiresAttention(PrintJobEvent pje) ;
  62. }