1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19  
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 /*
25  * Conversion parameters:
26  * inFile  = 
27  * outPack = gtk
28  * outFile = PrintOperationPreviewIF
29  * strct   = GtkPrintOperationPreview
30  * realStrct=
31  * ctorStrct=
32  * clss    = PrintOperationPreviewT
33  * interf  = PrintOperationPreviewIF
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- gtk_print_operation_preview_
41  * omit structs:
42  * omit prefixes:
43  * omit code:
44  * omit signals:
45  * 	- begin-print
46  * 	- create-custom-widget
47  * 	- custom-widget-apply
48  * 	- done
49  * 	- draw-page
50  * 	- end-print
51  * 	- paginate
52  * 	- preview
53  * 	- request-page-setup
54  * 	- status-changed
55  * 	- update-custom-widget
56  * imports:
57  * 	- gtk.PageSetup
58  * 	- gtk.PrintContext
59  * structWrap:
60  * 	- GtkPageSetup* -> PageSetup
61  * 	- GtkPrintContext* -> PrintContext
62  * module aliases:
63  * local aliases:
64  * overrides:
65  */
66 
67 module gtk.PrintOperationPreviewIF;
68 
69 public  import gtkc.gtktypes;
70 
71 private import gtkc.gtk;
72 private import glib.ConstructionException;
73 private import gobject.ObjectG;
74 
75 private import gobject.Signals;
76 public  import gtkc.gdktypes;
77 private import gtk.PageSetup;
78 private import gtk.PrintContext;
79 
80 
81 
82 /**
83  * GtkPrintOperation is the high-level, portable printing API.
84  * It looks a bit different than other GTK+ dialogs such as the
85  * GtkFileChooser, since some platforms don't expose enough
86  * infrastructure to implement a good print dialog. On such
87  * platforms, GtkPrintOperation uses the native print dialog.
88  * On platforms which do not provide a native print dialog, GTK+
89  * uses its own, see GtkPrintUnixDialog.
90  *
91  * The typical way to use the high-level printing API is to create
92  * a GtkPrintOperation object with gtk_print_operation_new() when
93  * the user selects to print. Then you set some properties on it,
94  * e.g. the page size, any GtkPrintSettings from previous print
95  * operations, the number of pages, the current page, etc.
96  *
97  * Then you start the print operation by calling gtk_print_operation_run().
98  * It will then show a dialog, let the user select a printer and
99  * options. When the user finished the dialog various signals will
100  * be emitted on the GtkPrintOperation, the main one being
101  * "draw-page", which you are supposed to catch
102  * and render the page on the provided GtkPrintContext using Cairo.
103  *
104  * $(DDOC_COMMENT example)
105  *
106  * By default GtkPrintOperation uses an external application to do
107  * print preview. To implement a custom print preview, an application
108  * must connect to the preview signal. The functions
109  * gtk_print_operation_preview_render_page(),
110  * gtk_print_operation_preview_end_preview() and
111  * gtk_print_operation_preview_is_selected()
112  * are useful when implementing a print preview.
113  */
114 public interface PrintOperationPreviewIF
115 {
116 	
117 	
118 	/** Get the main Gtk struct */
119 	public GtkPrintOperationPreview* getPrintOperationPreviewTStruct();
120 	
121 	/** the main Gtk struct as a void* */
122 	protected void* getStruct();
123 	
124 	
125 	/**
126 	 */
127 	
128 	@property void delegate(PrintContext, PageSetup, PrintOperationPreviewIF)[] onGotPageSizeListeners();
129 	/**
130 	 * The ::got-page-size signal is emitted once for each page
131 	 * that gets rendered to the preview.
132 	 * A handler for this signal should update the context
133 	 * according to page_setup and set up a suitable cairo
134 	 * context, using gtk_print_context_set_cairo_context().
135 	 */
136 	void addOnGotPageSize(void delegate(PrintContext, PageSetup, PrintOperationPreviewIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0);
137 	@property void delegate(PrintContext, PrintOperationPreviewIF)[] onReadyListeners();
138 	/**
139 	 * The ::ready signal gets emitted once per preview operation,
140 	 * before the first page is rendered.
141 	 * A handler for this signal can be used for setup tasks.
142 	 * See Also
143 	 * GtkPrintContext, GtkPrintUnixDialog
144 	 */
145 	void addOnReady(void delegate(PrintContext, PrintOperationPreviewIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0);
146 	
147 	/**
148 	 * Ends a preview.
149 	 * This function must be called to finish a custom print preview.
150 	 * Since 2.10
151 	 */
152 	public void endPreview();
153 	
154 	/**
155 	 * Returns whether the given page is included in the set of pages that
156 	 * have been selected for printing.
157 	 * Since 2.10
158 	 * Params:
159 	 * pageNr = a page number
160 	 * Returns: TRUE if the page has been selected for printing
161 	 */
162 	public int isSelected(int pageNr);
163 	
164 	/**
165 	 * Renders a page to the preview, using the print context that
166 	 * was passed to the "preview" handler together
167 	 * with preview.
168 	 * A custom iprint preview should use this function in its ::expose
169 	 * handler to render the currently selected page.
170 	 * Note that this function requires a suitable cairo context to
171 	 * be associated with the print context.
172 	 * Since 2.10
173 	 * Params:
174 	 * pageNr = the page to render
175 	 */
176 	public void renderPage(int pageNr);
177 }