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.LinkAction;
26 
27 private import evince.document.EvinceLayer;
28 private import evince.document.LinkDest;
29 private import evince.document.c.functions;
30 public  import evince.document.c.types;
31 private import glib.ConstructionException;
32 private import glib.ListG;
33 private import glib.Str;
34 private import gobject.ObjectG;
35 
36 
37 /** */
38 public class LinkAction : ObjectG
39 {
40 	/** the main Gtk struct */
41 	protected EvLinkAction* evLinkAction;
42 
43 	/** Get the main Gtk struct */
44 	public EvLinkAction* getLinkActionStruct(bool transferOwnership = false)
45 	{
46 		if (transferOwnership)
47 			ownedRef = false;
48 		return evLinkAction;
49 	}
50 
51 	/** the main Gtk struct as a void* */
52 	protected override void* getStruct()
53 	{
54 		return cast(void*)evLinkAction;
55 	}
56 
57 	/**
58 	 * Sets our main struct and passes it to the parent class.
59 	 */
60 	public this (EvLinkAction* evLinkAction, bool ownedRef = false)
61 	{
62 		this.evLinkAction = evLinkAction;
63 		super(cast(GObject*)evLinkAction, ownedRef);
64 	}
65 
66 
67 	/** */
68 	public static GType getType()
69 	{
70 		return ev_link_action_get_type();
71 	}
72 
73 	/** */
74 	public this(LinkDest dest)
75 	{
76 		auto __p = ev_link_action_new_dest((dest is null) ? null : dest.getLinkDestStruct());
77 
78 		if(__p is null)
79 		{
80 			throw new ConstructionException("null returned by new_dest");
81 		}
82 
83 		this(cast(EvLinkAction*) __p, true);
84 	}
85 
86 	/** */
87 	public this(string uri)
88 	{
89 		auto __p = ev_link_action_new_external_uri(Str.toStringz(uri));
90 
91 		if(__p is null)
92 		{
93 			throw new ConstructionException("null returned by new_external_uri");
94 		}
95 
96 		this(cast(EvLinkAction*) __p, true);
97 	}
98 
99 	/** */
100 	public this(string filename, string params)
101 	{
102 		auto __p = ev_link_action_new_launch(Str.toStringz(filename), Str.toStringz(params));
103 
104 		if(__p is null)
105 		{
106 			throw new ConstructionException("null returned by new_launch");
107 		}
108 
109 		this(cast(EvLinkAction*) __p, true);
110 	}
111 
112 	/**
113 	 *
114 	 * Params:
115 	 *     showList = a list of #EvLayer objects
116 	 *     hideList = a list of #EvLayer objects
117 	 *     toggleList = a list of #EvLayer objects
118 	 * Returns: a new #EvLinkAction
119 	 *
120 	 * Throws: ConstructionException GTK+ fails to create the object.
121 	 */
122 	public this(ListG showList, ListG hideList, ListG toggleList)
123 	{
124 		auto __p = ev_link_action_new_layers_state((showList is null) ? null : showList.getListGStruct(), (hideList is null) ? null : hideList.getListGStruct(), (toggleList is null) ? null : toggleList.getListGStruct());
125 
126 		if(__p is null)
127 		{
128 			throw new ConstructionException("null returned by new_layers_state");
129 		}
130 
131 		this(cast(EvLinkAction*) __p, true);
132 	}
133 
134 	/** */
135 	public this(string name)
136 	{
137 		auto __p = ev_link_action_new_named(Str.toStringz(name));
138 
139 		if(__p is null)
140 		{
141 			throw new ConstructionException("null returned by new_named");
142 		}
143 
144 		this(cast(EvLinkAction*) __p, true);
145 	}
146 
147 	/** */
148 	public this(LinkDest dest, string filename)
149 	{
150 		auto __p = ev_link_action_new_remote((dest is null) ? null : dest.getLinkDestStruct(), Str.toStringz(filename));
151 
152 		if(__p is null)
153 		{
154 			throw new ConstructionException("null returned by new_remote");
155 		}
156 
157 		this(cast(EvLinkAction*) __p, true);
158 	}
159 
160 	/**
161 	 * Checks whether @a and @b are equal.
162 	 *
163 	 * Params:
164 	 *     b = a #EvLinkAction
165 	 *
166 	 * Returns: %TRUE iff @a and @b are equal
167 	 *
168 	 * Since: 3.8
169 	 */
170 	public bool equal(LinkAction b)
171 	{
172 		return ev_link_action_equal(evLinkAction, (b is null) ? null : b.getLinkActionStruct()) != 0;
173 	}
174 
175 	/** */
176 	public EvLinkActionType getActionType()
177 	{
178 		return ev_link_action_get_action_type(evLinkAction);
179 	}
180 
181 	/**
182 	 * Returns: an #EvLinkDest
183 	 */
184 	public LinkDest getDest()
185 	{
186 		auto __p = ev_link_action_get_dest(evLinkAction);
187 
188 		if(__p is null)
189 		{
190 			return null;
191 		}
192 
193 		return ObjectG.getDObject!(LinkDest)(cast(EvLinkDest*) __p);
194 	}
195 
196 	/** */
197 	public string getFilename()
198 	{
199 		return Str.toString(ev_link_action_get_filename(evLinkAction));
200 	}
201 
202 	/**
203 	 * Returns: a list of #EvLayer objects
204 	 */
205 	public ListG getHideList()
206 	{
207 		auto __p = ev_link_action_get_hide_list(evLinkAction);
208 
209 		if(__p is null)
210 		{
211 			return null;
212 		}
213 
214 		return new ListG(cast(GList*) __p);
215 	}
216 
217 	/** */
218 	public string getName()
219 	{
220 		return Str.toString(ev_link_action_get_name(evLinkAction));
221 	}
222 
223 	/** */
224 	public string getParams()
225 	{
226 		return Str.toString(ev_link_action_get_params(evLinkAction));
227 	}
228 
229 	/**
230 	 * Returns: a list of #EvLayer objects
231 	 */
232 	public ListG getShowList()
233 	{
234 		auto __p = ev_link_action_get_show_list(evLinkAction);
235 
236 		if(__p is null)
237 		{
238 			return null;
239 		}
240 
241 		return new ListG(cast(GList*) __p);
242 	}
243 
244 	/**
245 	 * Returns: a list of #EvLayer objects
246 	 */
247 	public ListG getToggleList()
248 	{
249 		auto __p = ev_link_action_get_toggle_list(evLinkAction);
250 
251 		if(__p is null)
252 		{
253 			return null;
254 		}
255 
256 		return new ListG(cast(GList*) __p);
257 	}
258 
259 	/** */
260 	public string getUri()
261 	{
262 		return Str.toString(ev_link_action_get_uri(evLinkAction));
263 	}
264 }