1 /* 2 * This file is part of EvinceD. 3 * EvinceD is based on GtkD. 4 * 5 * EvinceD is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU Lesser General Public License 7 * as published by the Free Software Foundation; either version 3 8 * of the License, or (at your option) any later version, with 9 * some exceptions, please read the COPYING file. 10 * 11 * EvinceD is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU Lesser General Public License for more details. 15 * 16 * You should have received a copy of the GNU Lesser General Public License 17 * along with EvinceD; if not, write to the Free Software 18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA 19 */ 20 21 // generated automatically - do not change 22 // find conversion definition on APILookup.txt 23 24 25 module evince.view.ViewPresentation; 26 27 private import evince.document.Document; 28 private import evince.view.c.functions; 29 public import evince.view.c.types; 30 private import glib.ConstructionException; 31 private import gobject.ObjectG; 32 private import gobject.Signals; 33 private import gtk.BuildableIF; 34 private import gtk.BuildableT; 35 private import gtk.Widget; 36 private import std.algorithm; 37 38 39 /** */ 40 public class ViewPresentation : Widget 41 { 42 /** the main Gtk struct */ 43 protected EvViewPresentation* evViewPresentation; 44 45 /** Get the main Gtk struct */ 46 public EvViewPresentation* getViewPresentationStruct(bool transferOwnership = false) 47 { 48 if (transferOwnership) 49 ownedRef = false; 50 return evViewPresentation; 51 } 52 53 /** the main Gtk struct as a void* */ 54 protected override void* getStruct() 55 { 56 return cast(void*)evViewPresentation; 57 } 58 59 /** 60 * Sets our main struct and passes it to the parent class. 61 */ 62 public this (EvViewPresentation* evViewPresentation, bool ownedRef = false) 63 { 64 this.evViewPresentation = evViewPresentation; 65 super(cast(GtkWidget*)evViewPresentation, ownedRef); 66 } 67 68 69 /** */ 70 public static GType getType() 71 { 72 return ev_view_presentation_get_type(); 73 } 74 75 /** */ 76 public this(Document document, uint currentPage, uint rotation, bool invertedColors) 77 { 78 auto __p = ev_view_presentation_new((document is null) ? null : document.getDocumentStruct(), currentPage, rotation, invertedColors); 79 80 if(__p is null) 81 { 82 throw new ConstructionException("null returned by new"); 83 } 84 85 this(cast(EvViewPresentation*) __p); 86 } 87 88 /** */ 89 public uint getCurrentPage() 90 { 91 return ev_view_presentation_get_current_page(evViewPresentation); 92 } 93 94 /** */ 95 public uint getRotation() 96 { 97 return ev_view_presentation_get_rotation(evViewPresentation); 98 } 99 100 /** */ 101 public void nextPage() 102 { 103 ev_view_presentation_next_page(evViewPresentation); 104 } 105 106 /** */ 107 public void previousPage() 108 { 109 ev_view_presentation_previous_page(evViewPresentation); 110 } 111 112 /** */ 113 public void setRotation(int rotation) 114 { 115 ev_view_presentation_set_rotation(evViewPresentation, rotation); 116 } 117 118 /** */ 119 gulong addOnChangePage(void delegate(GtkScrollType, ViewPresentation) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 120 { 121 return Signals.connect(this, "change-page", dlg, connectFlags ^ ConnectFlags.SWAPPED); 122 } 123 124 /** */ 125 gulong addOnExternalLink(void delegate(ObjectG, ViewPresentation) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 126 { 127 return Signals.connect(this, "external-link", dlg, connectFlags ^ ConnectFlags.SWAPPED); 128 } 129 130 /** */ 131 gulong addOnFinished(void delegate(ViewPresentation) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 132 { 133 return Signals.connect(this, "finished", dlg, connectFlags ^ ConnectFlags.SWAPPED); 134 } 135 }