PrintDialog

Instances of this class allow the user to select a printer and various print-related parameters prior to starting a print job. <p> IMPORTANT: This class is intended to be subclassed <em>only</em> within the SWT implementation. </p>

@see <a href="http://www.eclipse.org/swt/snippets/#printing">Printing snippets</a> @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: ControlExample, Dialog tab</a> @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>

Constructors

this
this(Shell parent)

Constructs a new instance of this class given only its parent.

this
this(Shell parent, int style)

Constructs a new instance of this class given its parent and a style value describing its behavior and appearance. <p> The style value is either one of the style constants defined in class <code>SWT</code> which is applicable to instances of this class, or must be built by <em>bitwise OR</em>'ing together (that is, using the <code>int</code> "|" operator) two or more of those <code>SWT</code> style constants. The class description lists the style constants that are applicable to the class. Style bits are also inherited from superclasses. </p>

Members

Functions

GtkPrintSettingsMeth
void GtkPrintSettingsMeth(char* key, char* value)
Undocumented in source. Be warned that the author may not have intended to support it.
getEndPage
int getEndPage()

Returns the end page setting that the user selected before pressing OK in the dialog. <p> This value can be from 1 to the maximum number of pages for the platform. Note that it is only valid if the scope is <code>PrinterData.PAGE_RANGE</code>. </p>

getPrintToFile
bool getPrintToFile()

Returns the 'Print to file' setting that the user selected before pressing OK in the dialog.

getPrinterData
PrinterData getPrinterData()

Returns the printer data that will be used when the dialog is opened.

getScope
int getScope()

Returns the print job scope that the user selected before pressing OK in the dialog. This will be one of the following values: <dl> <dt><code>PrinterData.ALL_PAGES</code></dt> <dd>Print all pages in the current document</dd> <dt><code>PrinterData.PAGE_RANGE</code></dt> <dd>Print the range of pages specified by startPage and endPage</dd> <dt><code>PrinterData.SELECTION</code></dt> <dd>Print the current selection</dd> </dl>

getStartPage
int getStartPage()

Returns the start page setting that the user selected before pressing OK in the dialog. <p> This value can be from 1 to the maximum number of pages for the platform. Note that it is only valid if the scope is <code>PrinterData.PAGE_RANGE</code>. </p>

open
PrinterData open()

Makes the receiver visible and brings it to the front of the display.

setEndPage
void setEndPage(int endPage)

Sets the end page that the user will see when the dialog is opened. <p> This value can be from 1 to the maximum number of pages for the platform. Note that it is only valid if the scope is <code>PrinterData.PAGE_RANGE</code>. </p>

setPrintToFile
void setPrintToFile(bool printToFile)

Sets the 'Print to file' setting that the user will see when the dialog is opened.

setPrinterData
void setPrinterData(PrinterData data)

Sets the printer data that will be used when the dialog is opened.

setScope
void setScope(int scope_)

Sets the scope of the print job. The user will see this setting when the dialog is opened. This can have one of the following values: <dl> <dt><code>PrinterData.ALL_PAGES</code></dt> <dd>Print all pages in the current document</dd> <dt><code>PrinterData.PAGE_RANGE</code></dt> <dd>Print the range of pages specified by startPage and endPage</dd> <dt><code>PrinterData.SELECTION</code></dt> <dd>Print the current selection</dd> </dl>

setStartPage
void setStartPage(int startPage)

Sets the start page that the user will see when the dialog is opened. <p> This value can be from 1 to the maximum number of pages for the platform. Note that it is only valid if the scope is <code>PrinterData.PAGE_RANGE</code>. </p>

store
void store(String key, int value)
Undocumented in source. Be warned that the author may not have intended to support it.
store
void store(String key, double value)
Undocumented in source. Be warned that the author may not have intended to support it.
store
void store(String key, bool value)
Undocumented in source. Be warned that the author may not have intended to support it.
store
void store(String key, String value)
Undocumented in source. Be warned that the author may not have intended to support it.
storeBytes
void storeBytes(String key, char* value)
Undocumented in source. Be warned that the author may not have intended to support it.

Static functions

checkBits
int checkBits(int style, int int0, int int1, int int2, int int3, int int4, int int5)
Undocumented in source. Be warned that the author may not have intended to support it.
checkStyleBit
int checkStyleBit(Shell parent, int style)
Undocumented in source. Be warned that the author may not have intended to support it.

Static variables

ADD_IDLE_PROC_KEY
String ADD_IDLE_PROC_KEY;
Undocumented in source.
GET_EMISSION_PROC_KEY
String GET_EMISSION_PROC_KEY;
Undocumented in source.
GET_MODAL_DIALOG
String GET_MODAL_DIALOG;
Undocumented in source.
REMOVE_IDLE_PROC_KEY
String REMOVE_IDLE_PROC_KEY;
Undocumented in source.
SET_MODAL_DIALOG
String SET_MODAL_DIALOG;
endPage
int endPage;
Undocumented in source.

Variables

handle
GtkPrintUnixDialog* handle;
Undocumented in source.
index
int index;
Undocumented in source.
printToFile
bool printToFile;
Undocumented in source.
printerData
PrinterData printerData;
Undocumented in source.
scope_
int scope_;
Undocumented in source.
settingsData
char[] settingsData;
Undocumented in source.
startPage
int startPage;
Undocumented in source.

Inherited Members

From Dialog

style
int style;
Undocumented in source.
parent
Shell parent;
Undocumented in source.
title
String title;
Undocumented in source.
checkSubclass
void checkSubclass()

Checks that this class can be subclassed. <p> IMPORTANT: See the comment in <code>Widget.checkSubclass()</code>. </p>

checkParent
void checkParent(Shell parent)

Throws an exception if the specified widget can not be used as a parent for the receiver.

checkStyle
int checkStyle(Shell parent, int style)
Undocumented in source. Be warned that the author may not have intended to support it.
error
void error(int code)

Does whatever dialog specific cleanup is required, and then uses the code in <code>SWTError.error</code> to handle the error.

getParent
Shell getParent()

Returns the receiver's parent, which must be a <code>Shell</code> or null.

getStyle
int getStyle()

Returns the receiver's style information. <p> Note that, the value which is returned by this method <em>may not match</em> the value which was provided to the constructor when the receiver was created. </p>

getText
String getText()

Returns the receiver's text, which is the string that the window manager will typically display as the receiver's <em>title</em>. If the text has not previously been set, returns an empty string.

setText
void setText(String string)

Sets the receiver's text, which is the string that the window manager will typically display as the receiver's <em>title</em>, to the argument, which must not be null.

Meta