comparison dwt/printing/PrinterData.d @ 118:10760eb00d08

Ported dwt.printing.PrinterData
author Jacob Carlborg <doob@me.com>
date Wed, 31 Dec 2008 15:51:54 +0100
parents d8635bb48c7c
children 2e671fa40eec
comparison
equal deleted inserted replaced
117:bb00974d5ded 118:10760eb00d08
5 * which accompanies this distribution, and is available at 5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html 6 * http://www.eclipse.org/legal/epl-v10.html
7 * 7 *
8 * Contributors: 8 * Contributors:
9 * IBM Corporation - initial API and implementation 9 * IBM Corporation - initial API and implementation
10 *
11 * Port to the D programming language:
12 * Jacob Carlborg <doob@me.com>
10 *******************************************************************************/ 13 *******************************************************************************/
11 module dwt.printing.PrinterData; 14 module dwt.printing.PrinterData;
12 15
13 import dwt.dwthelper.utils; 16 import dwt.dwthelper.utils;
14 17
32 * @see PrintDialog#open 35 * @see PrintDialog#open
33 * @see <a href="http://www.eclipse.org/swt/snippets/#printing">Printing snippets</a> 36 * @see <a href="http://www.eclipse.org/swt/snippets/#printing">Printing snippets</a>
34 * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> 37 * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
35 */ 38 */
36 39
37 public final class PrinterData extends DeviceData { 40 public final class PrinterData : DeviceData {
38 41
39 /** 42 /**
40 * the printer driver 43 * the printer driver
41 * On Windows systems, this is the name of the driver (often "winspool"). 44 * On Windows systems, this is the name of the driver (often "winspool").
42 * On Mac OSX, this is the destination type ("Printer", "Fax", "File", or "Preview"). 45 * On Mac OSX, this is the destination type ("Printer", "Fax", "File", or "Preview").
63 * <dd>Print the range of pages specified by startPage and endPage</dd> 66 * <dd>Print the range of pages specified by startPage and endPage</dd>
64 * <dt><code>SELECTION</code></dt> 67 * <dt><code>SELECTION</code></dt>
65 * <dd>Print the current selection</dd> 68 * <dd>Print the current selection</dd>
66 * </dl> 69 * </dl>
67 */ 70 */
68 public int scope = ALL_PAGES; 71 public int scope_ = ALL_PAGES;
69 72
70 /** 73 /**
71 * the start page of a page range, used when scope is PAGE_RANGE. 74 * the start page of a page range, used when scope is PAGE_RANGE.
72 * This value can be from 1 to the maximum number of pages for the platform. 75 * This value can be from 1 to the maximum number of pages for the platform.
73 */ 76 */
141 * Constructs an instance of this class that can be 144 * Constructs an instance of this class that can be
142 * used to print to the default printer. 145 * used to print to the default printer.
143 * 146 *
144 * @see Printer#getDefaultPrinterData 147 * @see Printer#getDefaultPrinterData
145 */ 148 */
146 public PrinterData() { 149 public this() {
147 } 150 }
148 151
149 /** 152 /**
150 * Constructs an instance of this class with the given 153 * Constructs an instance of this class with the given
151 * printer driver and printer name. 154 * printer driver and printer name.
154 * @param name the name of the printer 157 * @param name the name of the printer
155 * 158 *
156 * @see #driver 159 * @see #driver
157 * @see #name 160 * @see #name
158 */ 161 */
159 public PrinterData(String driver, String name) { 162 public this(String driver, String name) {
160 this.driver = driver; 163 this.driver = driver;
161 this.name = name; 164 this.name = name;
162 } 165 }
163 166
164 /** 167 /**
166 * description of the receiver. 169 * description of the receiver.
167 * 170 *
168 * @return a string representation of the receiver 171 * @return a string representation of the receiver
169 */ 172 */
170 public String toString() { 173 public String toString() {
171 return "PrinterData {" + "driver = " + driver + ", name = " + name + "}"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ 174 return "PrinterData {" ~ "driver = " ~ driver ~ ", name = " ~ name ~ "}"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
172 } 175 }
173 } 176 }