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