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.document.DocumentLicense; 26 27 private import evince.document.c.functions; 28 public import evince.document.c.types; 29 private import glib.ConstructionException; 30 private import glib.MemorySlice; 31 private import glib.Str; 32 private import gobject.ObjectG; 33 private import gtkd.Loader; 34 35 36 /** */ 37 public final class DocumentLicense 38 { 39 /** the main Gtk struct */ 40 protected EvDocumentLicense* evDocumentLicense; 41 protected bool ownedRef; 42 43 /** Get the main Gtk struct */ 44 public EvDocumentLicense* getDocumentLicenseStruct(bool transferOwnership = false) 45 { 46 if (transferOwnership) 47 ownedRef = false; 48 return evDocumentLicense; 49 } 50 51 /** the main Gtk struct as a void* */ 52 protected void* getStruct() 53 { 54 return cast(void*)evDocumentLicense; 55 } 56 57 /** 58 * Sets our main struct and passes it to the parent class. 59 */ 60 public this (EvDocumentLicense* evDocumentLicense, bool ownedRef = false) 61 { 62 this.evDocumentLicense = evDocumentLicense; 63 this.ownedRef = ownedRef; 64 } 65 66 ~this () 67 { 68 if ( Linker.isLoaded(LIBRARY_EVINCEDOCUMENT) && ownedRef ) 69 ev_document_license_free(evDocumentLicense); 70 } 71 72 73 /** */ 74 public @property string text() 75 { 76 return Str.toString(evDocumentLicense.text); 77 } 78 79 /** Ditto */ 80 public @property void text(string value) 81 { 82 evDocumentLicense.text = Str.toStringz(value); 83 } 84 85 /** */ 86 public @property string uri() 87 { 88 return Str.toString(evDocumentLicense.uri); 89 } 90 91 /** Ditto */ 92 public @property void uri(string value) 93 { 94 evDocumentLicense.uri = Str.toStringz(value); 95 } 96 97 /** */ 98 public @property string webStatement() 99 { 100 return Str.toString(evDocumentLicense.webStatement); 101 } 102 103 /** Ditto */ 104 public @property void webStatement(string value) 105 { 106 evDocumentLicense.webStatement = Str.toStringz(value); 107 } 108 109 /** */ 110 public static GType getType() 111 { 112 return ev_document_license_get_type(); 113 } 114 115 /** */ 116 public this() 117 { 118 auto __p = ev_document_license_new(); 119 120 if(__p is null) 121 { 122 throw new ConstructionException("null returned by new"); 123 } 124 125 this(cast(EvDocumentLicense*) __p); 126 } 127 128 /** */ 129 public DocumentLicense copy() 130 { 131 auto __p = ev_document_license_copy(evDocumentLicense); 132 133 if(__p is null) 134 { 135 return null; 136 } 137 138 return ObjectG.getDObject!(DocumentLicense)(cast(EvDocumentLicense*) __p, true); 139 } 140 141 /** */ 142 public void free() 143 { 144 ev_document_license_free(evDocumentLicense); 145 ownedRef = false; 146 } 147 148 /** */ 149 public string getText() 150 { 151 return Str.toString(ev_document_license_get_text(evDocumentLicense)); 152 } 153 154 /** */ 155 public string getUri() 156 { 157 return Str.toString(ev_document_license_get_uri(evDocumentLicense)); 158 } 159 160 /** */ 161 public string getWebStatement() 162 { 163 return Str.toString(ev_document_license_get_web_statement(evDocumentLicense)); 164 } 165 }