FSF GCC merge 02/23/03
[official-gcc.git] / libjava / java / awt / print / PrinterJob.java
blobccaf5dcb782c8e35759ba77e565afd68852450c9
1 /* PrinterJob.java -- This job is the printer control class
2 Copyright (C) 1999 Free Software Foundation, Inc.
4 This file is part of GNU Classpath.
6 GNU Classpath is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
11 GNU Classpath is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU Classpath; see the file COPYING. If not, write to the
18 Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19 02111-1307 USA.
21 Linking this library statically or dynamically with other modules is
22 making a combined work based on this library. Thus, the terms and
23 conditions of the GNU General Public License cover the whole
24 combination.
26 As a special exception, the copyright holders of this library give you
27 permission to link this library with independent modules to produce an
28 executable, regardless of the license terms of these independent
29 modules, and to copy and distribute the resulting executable under
30 terms of your choice, provided that you also meet, for each linked
31 independent module, the terms and conditions of the license of that
32 module. An independent module is a module which is not derived from
33 or based on this library. If you modify this library, you may extend
34 this exception to your version of the library, but you are not
35 obligated to do so. If you do not wish to do so, delete this
36 exception statement from your version. */
39 package java.awt.print;
41 /**
42 * This class controls printing.
44 * @author Aaron M. Renn (arenn@urbanophile.com)
46 public abstract class PrinterJob
50 * Class Methods
53 /**
54 * Creates a new print job.
56 * @return A <code>PrinterJob</code> object for the newly created print job.
58 public static PrinterJob
59 getPrinterJob()
61 // FIXME: Need to fix this to load a default implementation instance.
62 return(null);
65 /*************************************************************************/
68 * Constructors
71 /**
72 * Initializes a new instance of <code>PrinterJob</code>.
74 public
75 PrinterJob()
80 /*************************************************************************/
83 * Instance Methods
86 /**
87 * Returns the number of copies to be printed.
89 * @return The number of copies to be printed.
91 public abstract int
92 getCopies();
94 /*************************************************************************/
96 /**
97 * Sets the number of copies to be printed.
99 * @param copies The number of copies to be printed.
101 public abstract void
102 setCopies();
104 /*************************************************************************/
107 * Returns the name of the print job.
109 * @return The name of the print job.
111 public abstract String
112 getJobName();
114 /*************************************************************************/
117 * Sets the name of the print job.
119 * @param job_name The name of the print job.
121 public abstract void setJobName (String job_name);
123 /*************************************************************************/
126 * Returns the printing user name.
128 * @return The printing username.
130 public abstract String
131 getUserName();
133 /*************************************************************************/
136 * Cancels an in progress print job.
138 public abstract void
139 cancel();
141 /*************************************************************************/
144 * Tests whether or not this job has been cancelled.
146 * @param <code>true</code> if this job has been cancelled, <code>false</code>
147 * otherwise.
149 public abstract boolean
150 isCancelled();
152 /*************************************************************************/
155 * Returns an instance of the default page which will have the default
156 * paper and orientation.
158 * @return A default instance of <code>PageFormat</code>.
160 public PageFormat
161 defaultPage()
163 return(new PageFormat());
166 /*************************************************************************/
169 * Clones the specified <code>PageFormat</code> object then alters the
170 * clone so that it represents the default page format.
172 * @param page_format The <code>PageFormat</code> to clone.
174 * @return A new default page format.
176 public abstract PageFormat
177 defaultPage(PageFormat page_format);
179 /*************************************************************************/
182 * Displays a dialog box to the user which allows the page format
183 * attributes to be modified.
185 * @param page_format The <code>PageFormat</code> object to modify.
187 * @return The modified <code>PageFormat</code>.
189 public abstract PageFormat
190 pageDialog(PageFormat page_format);
192 /*************************************************************************/
195 * Prints the pages.
197 public abstract void print () throws PrinterException;
200 * Displays a dialog box to the user which allows the print job
201 * attributes to be modified.
203 * @return <code>false</code> if the user cancels the dialog box,
204 * <code>true</code> otherwise.
206 public abstract boolean
207 printDialog();
209 /*************************************************************************/
212 * This sets the pages that are to be printed.
214 * @param pageable The pages to be printed, which may not be <code>null</code>.
216 public abstract void
217 setPageable(Pageable pageable);
219 /*************************************************************************/
222 * Sets this specified <code>Printable</code> as the one to use for
223 * rendering the pages on the print device.
225 * @param printable The <code>Printable</code> for the print job.
227 public abstract void
228 setPrintable(Printable printable);
230 /*************************************************************************/
233 * Sets the <code>Printable</code> and the page format for the pages
234 * to be printed.
236 * @param printable The <code>Printable</code> for the print job.
237 * @param page_format The <code>PageFormat</code> for the print job.
239 public abstract void
240 setPrintable(Printable printable, PageFormat page_format);
242 /*************************************************************************/
245 * Makes any alterations to the specified <code>PageFormat</code>
246 * necessary to make it work with the current printer. The alterations
247 * are made to a clone of the input object, which is then returned.
249 * @param page_format The <code>PageFormat</code> to validate.
251 * @return The validated <code>PageFormat</code>.
253 public abstract PageFormat
254 validatePage(PageFormat page);
256 } // class PrinterJob