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 * imports: 56 * - gtk.Widget 57 * - gtk.PageSetup 58 * - gtk.PrintSettings 59 * structWrap: 60 * - GtkPageSetup* -> PageSetup 61 * - GtkPrintSettings* -> PrintSettings 62 * - GtkWidget* -> Widget 63 * module aliases: 64 * local aliases: 65 * overrides: 66 */ 67 68 module gtk.PrintOperationPreviewIF; 69 70 public import gtkc.gtktypes; 71 72 private import gtkc.gtk; 73 private import glib.ConstructionException; 74 private import gobject.ObjectG; 75 76 private import gobject.Signals; 77 public import gtkc.gdktypes; 78 79 private import gtk.Widget; 80 private import gtk.PageSetup; 81 private import gtk.PrintSettings; 82 83 84 85 86 /** 87 * Description 88 * GtkPrintOperation is the high-level, portable printing API. It looks 89 * a bit different than other GTK+ dialogs such as the GtkFileChooser, 90 * since some platforms don't expose enough infrastructure to implement 91 * a good print dialog. On such platforms, GtkPrintOperation uses the 92 * native print dialog. On platforms which do not provide a native 93 * print dialog, GTK+ uses its own, see GtkPrintUnixDialog. 94 * The typical way to use the high-level printing API is to create a 95 * GtkPrintOperation object with gtk_print_operation_new() when the user 96 * selects to print. Then you set some properties on it, e.g. the page size, 97 * any GtkPrintSettings from previous print operations, the number of pages, 98 * the current page, etc. 99 * Then you start the print operation by calling gtk_print_operation_run(). 100 * It will then show a dialog, let the user select a printer and options. 101 * When the user finished the dialog various signals will be emitted on the 102 * GtkPrintOperation, the main one being ::draw-page, which you are supposed 103 * to catch and render the page on the provided GtkPrintContext using Cairo. 104 * $(DDOC_COMMENT example) 105 * By default GtkPrintOperation uses an external application to do 106 * print preview. To implement a custom print preview, an application 107 * must connect to the preview signal. The functions 108 * gtk_print_operation_print_preview_render_page(), 109 * gtk_print_operation_preview_end_preview() and 110 * gtk_print_operation_preview_is_selected() are useful 111 * when implementing a print preview. 112 * Printing support was added in GTK+ 2.10. 113 */ 114 public interface PrintOperationPreviewIF 115 { 116 117 118 public GtkPrintOperationPreview* getPrintOperationPreviewTStruct(); 119 120 /** the main Gtk struct as a void* */ 121 protected void* getStruct(); 122 123 124 /** 125 */ 126 127 void delegate(Widget, PageSetup, PrintSettings, PrintOperationPreviewIF)[] onUpdateCustomWidgetListeners(); 128 /** 129 * Emitted after change of selected printer. The actual page setup and 130 * print settings are passed to the custom widget, which can actualize 131 * itself according to this change. 132 * Since 2.18 133 */ 134 void addOnUpdateCustomWidget(void delegate(Widget, PageSetup, PrintSettings, PrintOperationPreviewIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0); 135 void delegate(GtkPrintContext*, PageSetup, PrintOperationPreviewIF)[] onGotPageSizeListeners(); 136 /** 137 * The ::got-page-size signal is emitted once for each page 138 * that gets rendered to the preview. 139 * A handler for this signal should update the context 140 * according to page_setup and set up a suitable cairo 141 * context, using gtk_print_context_set_cairo_context(). 142 */ 143 void addOnGotPageSize(void delegate(GtkPrintContext*, PageSetup, PrintOperationPreviewIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0); 144 void delegate(GtkPrintContext*, PrintOperationPreviewIF)[] onReadyListeners(); 145 /** 146 * The ::ready signal gets emitted once per preview operation, 147 * before the first page is rendered. 148 * A handler for this signal can be used for setup tasks. 149 * See Also 150 * GtkPrintContext, GtkPrintUnixDialog 151 */ 152 void addOnReady(void delegate(GtkPrintContext*, PrintOperationPreviewIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0); 153 154 /** 155 * Ends a preview. 156 * This function must be called to finish a custom print preview. 157 * Since 2.10 158 */ 159 public void endPreview(); 160 161 /** 162 * Returns whether the given page is included in the set of pages that 163 * have been selected for printing. 164 * Since 2.10 165 * Params: 166 * pageNr = a page number 167 * Returns: TRUE if the page has been selected for printing 168 */ 169 public int isSelected(int pageNr); 170 171 /** 172 * Renders a page to the preview, using the print context that 173 * was passed to the "preview" handler together 174 * with preview. 175 * A custom iprint preview should use this function in its ::expose 176 * handler to render the currently selected page. 177 * Note that this function requires a suitable cairo context to 178 * be associated with the print context. 179 * Since 2.10 180 * Params: 181 * pageNr = the page to render 182 */ 183 public void renderPage(int pageNr); 184 }