fixes for host gcc 4.6.1
[zpugcc/jano.git] / toolchain / gcc / libjava / java / awt / print / PrinterJob.java
blob3ad456788e45517695ed378f40939d05466dbadd
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 setCopies (int copies);
103 /*************************************************************************/
106 * Returns the name of the print job.
108 * @return The name of the print job.
110 public abstract String
111 getJobName();
113 /*************************************************************************/
116 * Sets the name of the print job.
118 * @param job_name The name of the print job.
120 public abstract void setJobName (String job_name);
122 /*************************************************************************/
125 * Returns the printing user name.
127 * @return The printing username.
129 public abstract String
130 getUserName();
132 /*************************************************************************/
135 * Cancels an in progress print job.
137 public abstract void
138 cancel();
140 /*************************************************************************/
143 * Tests whether or not this job has been cancelled.
145 * @param <code>true</code> if this job has been cancelled, <code>false</code>
146 * otherwise.
148 public abstract boolean
149 isCancelled();
151 /*************************************************************************/
154 * Returns an instance of the default page which will have the default
155 * paper and orientation.
157 * @return A default instance of <code>PageFormat</code>.
159 public PageFormat
160 defaultPage()
162 return(new PageFormat());
165 /*************************************************************************/
168 * Clones the specified <code>PageFormat</code> object then alters the
169 * clone so that it represents the default page format.
171 * @param page_format The <code>PageFormat</code> to clone.
173 * @return A new default page format.
175 public abstract PageFormat
176 defaultPage(PageFormat page_format);
178 /*************************************************************************/
181 * Displays a dialog box to the user which allows the page format
182 * attributes to be modified.
184 * @param page_format The <code>PageFormat</code> object to modify.
186 * @return The modified <code>PageFormat</code>.
188 public abstract PageFormat
189 pageDialog(PageFormat page_format);
191 /*************************************************************************/
194 * Prints the pages.
196 public abstract void print () throws PrinterException;
199 * Displays a dialog box to the user which allows the print job
200 * attributes to be modified.
202 * @return <code>false</code> if the user cancels the dialog box,
203 * <code>true</code> otherwise.
205 public abstract boolean
206 printDialog();
208 /*************************************************************************/
211 * This sets the pages that are to be printed.
213 * @param pageable The pages to be printed, which may not be <code>null</code>.
215 public abstract void
216 setPageable(Pageable pageable);
218 /*************************************************************************/
221 * Sets this specified <code>Printable</code> as the one to use for
222 * rendering the pages on the print device.
224 * @param printable The <code>Printable</code> for the print job.
226 public abstract void
227 setPrintable(Printable printable);
229 /*************************************************************************/
232 * Sets the <code>Printable</code> and the page format for the pages
233 * to be printed.
235 * @param printable The <code>Printable</code> for the print job.
236 * @param page_format The <code>PageFormat</code> for the print job.
238 public abstract void
239 setPrintable(Printable printable, PageFormat page_format);
241 /*************************************************************************/
244 * Makes any alterations to the specified <code>PageFormat</code>
245 * necessary to make it work with the current printer. The alterations
246 * are made to a clone of the input object, which is then returned.
248 * @param page_format The <code>PageFormat</code> to validate.
250 * @return The validated <code>PageFormat</code>.
252 public abstract PageFormat
253 validatePage(PageFormat page);
255 } // class PrinterJob