Mercurial > projects > dwt-win
annotate dwt/custom/StyledTextPrintOptions.d @ 212:ab60f3309436
reverted the char[] to String and use the an alias.
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Mon, 05 May 2008 00:12:38 +0200 |
parents | a5afe31f5cdd |
children | 36f5cb12e1a2 |
rev | line source |
---|---|
212
ab60f3309436
reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents:
155
diff
changeset
|
1 /******************************************************************************* |
155 | 2 * Copyright (c) 2000, 2006 IBM Corporation and others. |
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> | |
34 * @since 2.1 | |
35 */ | |
36 public class StyledTextPrintOptions { | |
37 /** | |
38 * Page number placeholder constant for use in <code>header</code> | |
39 * and <code>footer</code>. Value is <code><page></code> | |
40 */ | |
212
ab60f3309436
reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents:
155
diff
changeset
|
41 public static final String PAGE_TAG = "<page>"; |
155 | 42 /** |
43 * Separator constant for use in <code>header</code> and | |
44 * <code>footer</code>. Value is <code>\t</code> | |
45 */ | |
212
ab60f3309436
reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents:
155
diff
changeset
|
46 public static final String SEPARATOR = "\t"; |
155 | 47 /** |
48 * Formatted text to print in the header of each page. | |
49 * <p>"left '\t' center '\t' right"</p> | |
50 * <p>left, center, right = <page> | #CDATA</p> | |
51 * <p>Header and footer are defined as three separate regions for arbitrary | |
52 * text or the page number placeholder <page> | |
53 * (<code>StyledTextPrintOptions.PAGE_TAG</code>). The three regions are | |
54 * left aligned, centered and right aligned. They are separated by a tab | |
55 * character (<code>StyledTextPrintOptions.SEPARATOR</code>). | |
56 */ | |
212
ab60f3309436
reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents:
155
diff
changeset
|
57 public String header = null; |
155 | 58 /** |
59 * Formatted text to print in the footer of each page. | |
60 * <p>"left '\t' center '\t' right"</p> | |
61 * <p>left, center, right = <page> | #CDATA</p> | |
62 * <p>Header and footer are defined as three separate regions for arbitrary | |
63 * text or the page number placeholder <page> | |
64 * (<code>StyledTextPrintOptions.PAGE_TAG</code>). The three regions are | |
65 * left aligned, centered and right aligned. They are separated by a tab | |
66 * character (<code>StyledTextPrintOptions.SEPARATOR</code>). | |
67 */ | |
212
ab60f3309436
reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents:
155
diff
changeset
|
68 public String footer = null; |
155 | 69 /** |
70 * Name of the print job. | |
71 */ | |
212
ab60f3309436
reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents:
155
diff
changeset
|
72 public String jobName = null; |
155 | 73 |
74 /** | |
75 * Print the text foreground color. Default value is <code>false</code>. | |
76 */ | |
77 public bool printTextForeground = false; | |
78 /** | |
79 * Print the text background color. Default value is <code>false</code>. | |
80 */ | |
81 public bool printTextBackground = false; | |
82 /** | |
83 * Print the font styles. Default value is <code>false</code>. | |
84 */ | |
85 public bool printTextFontStyle = false; | |
86 /** | |
87 * Print the line background color. Default value is <code>false</code>. | |
88 */ | |
89 public bool printLineBackground = false; | |
90 | |
91 /** | |
92 * Print line numbers. Default value is <code>false</code>. | |
93 * | |
94 * @since 3.3 | |
95 */ | |
96 public bool printLineNumbers = false; | |
97 | |
98 | |
99 } |