Mercurial > projects > dwt-win
annotate dwt/custom/StyledTextPrintOptions.d @ 316:7cffa1a2985c
Add 'all.d' for package import, dwt.all for everything, dwt.std for the most essential.
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sat, 18 Oct 2008 22:15:57 +0200 |
parents | fd9c62a2998e |
children |
rev | line source |
---|---|
316
7cffa1a2985c
Add 'all.d' for package import, dwt.all for everything, dwt.std for the most essential.
Frank Benoit <benoit@tionex.de>
parents:
246
diff
changeset
|
1 /******************************************************************************* |
246 | 2 * Copyright (c) 2000, 2008 IBM Corporation and others. |
155 | 3 * All rights reserved. This program and the accompanying materials |
4 * are made available under the terms of the Eclipse Public License v1.0 | |
5 * which accompanies this distribution, and is available at | |
6 * http://www.eclipse.org/legal/epl-v10.html | |
7 * | |
8 * Contributors: | |
9 * IBM Corporation - initial API and implementation | |
10 * Port to the D programming language: | |
11 * Frank Benoit <benoit@tionex.de> | |
12 *******************************************************************************/ | |
13 module dwt.custom.StyledTextPrintOptions; | |
14 | |
212
ab60f3309436
reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents:
155
diff
changeset
|
15 import dwt.dwthelper.utils; |
ab60f3309436
reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents:
155
diff
changeset
|
16 |
155 | 17 /** |
18 * Use StyledTextPrintOptions to specify printing options for the | |
19 * StyledText.print(Printer, StyledTextPrintOptions) API. | |
20 * <p> | |
21 * The following example prints a right aligned page number in the footer, | |
22 * sets the job name to "Example" and prints line background colors but no other | |
23 * formatting: | |
24 * </p> | |
25 * <pre> | |
26 * StyledTextPrintOptions options = new StyledTextPrintOptions(); | |
27 * options.footer = "\t\t<page>"; | |
28 * options.jobName = "Example"; | |
29 * options.printLineBackground = true; | |
30 * | |
31 * Runnable runnable = styledText.print(new Printer(), options); | |
32 * runnable.run(); | |
33 * </pre> | |
246 | 34 * |
35 * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> | |
36 * | |
155 | 37 * @since 2.1 |
38 */ | |
39 public class StyledTextPrintOptions { | |
40 /** | |
41 * Page number placeholder constant for use in <code>header</code> | |
42 * and <code>footer</code>. Value is <code><page></code> | |
43 */ | |
212
ab60f3309436
reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents:
155
diff
changeset
|
44 public static final String PAGE_TAG = "<page>"; |
155 | 45 /** |
46 * Separator constant for use in <code>header</code> and | |
47 * <code>footer</code>. Value is <code>\t</code> | |
48 */ | |
212
ab60f3309436
reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents:
155
diff
changeset
|
49 public static final String SEPARATOR = "\t"; |
155 | 50 /** |
51 * Formatted text to print in the header of each page. | |
52 * <p>"left '\t' center '\t' right"</p> | |
53 * <p>left, center, right = <page> | #CDATA</p> | |
54 * <p>Header and footer are defined as three separate regions for arbitrary | |
55 * text or the page number placeholder <page> | |
56 * (<code>StyledTextPrintOptions.PAGE_TAG</code>). The three regions are | |
57 * left aligned, centered and right aligned. They are separated by a tab | |
58 * character (<code>StyledTextPrintOptions.SEPARATOR</code>). | |
59 */ | |
212
ab60f3309436
reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents:
155
diff
changeset
|
60 public String header = null; |
155 | 61 /** |
62 * Formatted text to print in the footer of each page. | |
63 * <p>"left '\t' center '\t' right"</p> | |
64 * <p>left, center, right = <page> | #CDATA</p> | |
65 * <p>Header and footer are defined as three separate regions for arbitrary | |
66 * text or the page number placeholder <page> | |
67 * (<code>StyledTextPrintOptions.PAGE_TAG</code>). The three regions are | |
68 * left aligned, centered and right aligned. They are separated by a tab | |
69 * character (<code>StyledTextPrintOptions.SEPARATOR</code>). | |
70 */ | |
212
ab60f3309436
reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents:
155
diff
changeset
|
71 public String footer = null; |
155 | 72 /** |
73 * Name of the print job. | |
74 */ | |
212
ab60f3309436
reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents:
155
diff
changeset
|
75 public String jobName = null; |
155 | 76 |
77 /** | |
78 * Print the text foreground color. Default value is <code>false</code>. | |
79 */ | |
80 public bool printTextForeground = false; | |
81 /** | |
82 * Print the text background color. Default value is <code>false</code>. | |
83 */ | |
84 public bool printTextBackground = false; | |
85 /** | |
86 * Print the font styles. Default value is <code>false</code>. | |
87 */ | |
88 public bool printTextFontStyle = false; | |
89 /** | |
90 * Print the line background color. Default value is <code>false</code>. | |
91 */ | |
92 public bool printLineBackground = false; | |
93 | |
94 /** | |
95 * Print line numbers. Default value is <code>false</code>. | |
96 * | |
97 * @since 3.3 | |
98 */ | |
99 public bool printLineNumbers = false; | |
100 | |
213 | 101 /** |
102 * Labels used for printing line numbers. | |
103 * | |
104 * @since 3.4 | |
105 */ | |
106 public String[] lineLabels = null; | |
155 | 107 |
108 } |