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 module gtk.PrintOperationPreviewT;
26 
27 public  import gobject.Signals;
28 public  import gtk.PageSetup;
29 public  import gtk.PrintContext;
30 public  import gtk.c.functions;
31 public  import gtk.c.types;
32 public  import gtkc.gtktypes;
33 public  import std.algorithm;
34 
35 
36 /** */
37 public template PrintOperationPreviewT(TStruct)
38 {
39 	/** Get the main Gtk struct */
40 	public GtkPrintOperationPreview* getPrintOperationPreviewStruct(bool transferOwnership = false)
41 	{
42 		if (transferOwnership)
43 			ownedRef = false;
44 		return cast(GtkPrintOperationPreview*)getStruct();
45 	}
46 
47 
48 	/**
49 	 * Ends a preview.
50 	 *
51 	 * This function must be called to finish a custom print preview.
52 	 *
53 	 * Since: 2.10
54 	 */
55 	public void endPreview()
56 	{
57 		gtk_print_operation_preview_end_preview(getPrintOperationPreviewStruct());
58 	}
59 
60 	/**
61 	 * Returns whether the given page is included in the set of pages that
62 	 * have been selected for printing.
63 	 *
64 	 * Params:
65 	 *     pageNr = a page number
66 	 *
67 	 * Returns: %TRUE if the page has been selected for printing
68 	 *
69 	 * Since: 2.10
70 	 */
71 	public bool isSelected(int pageNr)
72 	{
73 		return gtk_print_operation_preview_is_selected(getPrintOperationPreviewStruct(), pageNr) != 0;
74 	}
75 
76 	/**
77 	 * Renders a page to the preview, using the print context that
78 	 * was passed to the #GtkPrintOperation::preview handler together
79 	 * with @preview.
80 	 *
81 	 * A custom iprint preview should use this function in its ::expose
82 	 * handler to render the currently selected page.
83 	 *
84 	 * Note that this function requires a suitable cairo context to
85 	 * be associated with the print context.
86 	 *
87 	 * Params:
88 	 *     pageNr = the page to render
89 	 *
90 	 * Since: 2.10
91 	 */
92 	public void renderPage(int pageNr)
93 	{
94 		gtk_print_operation_preview_render_page(getPrintOperationPreviewStruct(), pageNr);
95 	}
96 
97 	/**
98 	 * The ::got-page-size signal is emitted once for each page
99 	 * that gets rendered to the preview.
100 	 *
101 	 * A handler for this signal should update the @context
102 	 * according to @page_setup and set up a suitable cairo
103 	 * context, using gtk_print_context_set_cairo_context().
104 	 *
105 	 * Params:
106 	 *     context = the current #GtkPrintContext
107 	 *     pageSetup = the #GtkPageSetup for the current page
108 	 */
109 	gulong addOnGotPageSize(void delegate(PrintContext, PageSetup, PrintOperationPreviewIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
110 	{
111 		return Signals.connect(this, "got-page-size", dlg, connectFlags ^ ConnectFlags.SWAPPED);
112 	}
113 
114 	/**
115 	 * The ::ready signal gets emitted once per preview operation,
116 	 * before the first page is rendered.
117 	 *
118 	 * A handler for this signal can be used for setup tasks.
119 	 *
120 	 * Params:
121 	 *     context = the current #GtkPrintContext
122 	 */
123 	gulong addOnReady(void delegate(PrintContext, PrintOperationPreviewIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
124 	{
125 		return Signals.connect(this, "ready", dlg, connectFlags ^ ConnectFlags.SWAPPED);
126 	}
127 }