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.LinkDest;
26 
27 private import evince.document.c.functions;
28 public  import evince.document.c.types;
29 private import glib.ConstructionException;
30 private import glib.Str;
31 private import gobject.ObjectG;
32 
33 
34 /** */
35 public class LinkDest : ObjectG
36 {
37 	/** the main Gtk struct */
38 	protected EvLinkDest* evLinkDest;
39 
40 	/** Get the main Gtk struct */
41 	public EvLinkDest* getLinkDestStruct(bool transferOwnership = false)
42 	{
43 		if (transferOwnership)
44 			ownedRef = false;
45 		return evLinkDest;
46 	}
47 
48 	/** the main Gtk struct as a void* */
49 	protected override void* getStruct()
50 	{
51 		return cast(void*)evLinkDest;
52 	}
53 
54 	/**
55 	 * Sets our main struct and passes it to the parent class.
56 	 */
57 	public this (EvLinkDest* evLinkDest, bool ownedRef = false)
58 	{
59 		this.evLinkDest = evLinkDest;
60 		super(cast(GObject*)evLinkDest, ownedRef);
61 	}
62 
63 	/** */
64 	public double getLeft(bool* changeLeft)
65 	{
66 		int c_changeLeft;
67 		auto result = ev_link_dest_get_left(evLinkDest, &c_changeLeft);
68 
69 		if (changeLeft) {
70 		 *changeLeft = c_changeLeft == 0 ? false : true;
71 		}
72 
73 	return result;
74 }
75 
76 /** */
77 public double getTop(bool* changeTop)
78 {
79 	int c_changeTop;
80 	auto result = ev_link_dest_get_top(evLinkDest, &c_changeTop);
81 
82 	if (changeTop) {
83 	 *changeTop = c_changeTop == 0 ? false : true;
84 	}
85 
86 return result;
87 }
88 
89 /** */
90 public double getZoom(bool* changeZoom)
91 {
92 	int c_changeZoom;
93 	auto result = ev_link_dest_get_zoom(evLinkDest, &c_changeZoom);
94 
95 	if (changeZoom) {
96 	 *changeZoom = c_changeZoom == 0 ? false : true;
97 	}
98 
99 return result;
100 }
101 
102 /**
103  */
104 
105 /** */
106 public static GType getType()
107 {
108 	return ev_link_dest_get_type();
109 }
110 
111 /** */
112 public this(int page)
113 {
114 	auto __p = ev_link_dest_new_fit(page);
115 
116 	if(__p is null)
117 	{
118 		throw new ConstructionException("null returned by new_fit");
119 	}
120 
121 	this(cast(EvLinkDest*) __p, true);
122 }
123 
124 /** */
125 public this(int page, double top, bool changeTop)
126 {
127 	auto __p = ev_link_dest_new_fith(page, top, changeTop);
128 
129 	if(__p is null)
130 	{
131 		throw new ConstructionException("null returned by new_fith");
132 	}
133 
134 	this(cast(EvLinkDest*) __p, true);
135 }
136 
137 /** */
138 public this(int page, double left, double bottom, double right, double top)
139 {
140 	auto __p = ev_link_dest_new_fitr(page, left, bottom, right, top);
141 
142 	if(__p is null)
143 	{
144 		throw new ConstructionException("null returned by new_fitr");
145 	}
146 
147 	this(cast(EvLinkDest*) __p, true);
148 }
149 
150 /** */
151 public this(int page, double left, bool changeLeft)
152 {
153 	auto __p = ev_link_dest_new_fitv(page, left, changeLeft);
154 
155 	if(__p is null)
156 	{
157 		throw new ConstructionException("null returned by new_fitv");
158 	}
159 
160 	this(cast(EvLinkDest*) __p, true);
161 }
162 
163 /** */
164 public this(string namedDest)
165 {
166 	auto __p = ev_link_dest_new_named(Str.toStringz(namedDest));
167 
168 	if(__p is null)
169 	{
170 		throw new ConstructionException("null returned by new_named");
171 	}
172 
173 	this(cast(EvLinkDest*) __p, true);
174 }
175 
176 /** */
177 public this(int page)
178 {
179 	auto __p = ev_link_dest_new_page(page);
180 
181 	if(__p is null)
182 	{
183 		throw new ConstructionException("null returned by new_page");
184 	}
185 
186 	this(cast(EvLinkDest*) __p, true);
187 }
188 
189 /** */
190 public this(string pageLabel)
191 {
192 	auto __p = ev_link_dest_new_page_label(Str.toStringz(pageLabel));
193 
194 	if(__p is null)
195 	{
196 		throw new ConstructionException("null returned by new_page_label");
197 	}
198 
199 	this(cast(EvLinkDest*) __p, true);
200 }
201 
202 /** */
203 public this(int page, double left, double top, double zoom, bool changeLeft, bool changeTop, bool changeZoom)
204 {
205 	auto __p = ev_link_dest_new_xyz(page, left, top, zoom, changeLeft, changeTop, changeZoom);
206 
207 	if(__p is null)
208 	{
209 		throw new ConstructionException("null returned by new_xyz");
210 	}
211 
212 	this(cast(EvLinkDest*) __p, true);
213 }
214 
215 /**
216  * Checks whether @a and @b are equal.
217  *
218  * Params:
219  *     b = a #EvLinkDest
220  *
221  * Returns: %TRUE iff @a and @b are equal
222  *
223  * Since: 3.8
224  */
225 public bool equal(LinkDest b)
226 {
227 	return ev_link_dest_equal(evLinkDest, (b is null) ? null : b.getLinkDestStruct()) != 0;
228 }
229 
230 /** */
231 public double getBottom()
232 {
233 	return ev_link_dest_get_bottom(evLinkDest);
234 }
235 
236 /** */
237 public EvLinkDestType getDestType()
238 {
239 	return ev_link_dest_get_dest_type(evLinkDest);
240 }
241 
242 /** */
243 public string getNamedDest()
244 {
245 	return Str.toString(ev_link_dest_get_named_dest(evLinkDest));
246 }
247 
248 /** */
249 public int getPage()
250 {
251 	return ev_link_dest_get_page(evLinkDest);
252 }
253 
254 /** */
255 public string getPageLabel()
256 {
257 	return Str.toString(ev_link_dest_get_page_label(evLinkDest));
258 }
259 
260 /** */
261 public double getRight()
262 {
263 	return ev_link_dest_get_right(evLinkDest);
264 }
265 }