1 /*******************************************************************************
2  * Copyright (c) 2000, 2008 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 org.eclipse.swt.custom.StyledTextPrintOptions;
14 
15 import java.lang.all;
16 
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&lt;page&gt;";
28  * options.jobName = "Example";
29  * options.printLineBackground = true;
30  *
31  * Runnable runnable = styledText.print(new Printer(), options);
32  * runnable.run();
33  * </pre>
34  *
35  * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
36  *
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>&lt;page&gt;</code>
43      */
44     public static const String PAGE_TAG = "<page>";
45     /**
46      * Separator constant for use in <code>header</code> and
47      * <code>footer</code>. Value is <code>\t</code>
48      */
49     public static const String SEPARATOR = "\t";
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 = &lt;page&gt; | #CDATA</p>
54      * <p>Header and footer are defined as three separate regions for arbitrary
55      * text or the page number placeholder &lt;page&gt;
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      */
60     public String header = null;
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 = &lt;page&gt; | #CDATA</p>
65      * <p>Header and footer are defined as three separate regions for arbitrary
66      * text or the page number placeholder &lt;page&gt;
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      */
71     public String footer = null;
72     /**
73      * Name of the print job.
74      */
75     public String jobName = null;
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 
101     /**
102      * Labels used for printing line numbers.
103      * 
104      * @since 3.4
105      */
106     public String[] lineLabels = null;
107 
108 }