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.DocumentLinksT;
26 
27 public  import evince.document.Link;
28 public  import evince.document.LinkDest;
29 public  import evince.document.MappingList;
30 public  import evince.document.Page;
31 public  import evince.document.c.functions;
32 public  import evince.document.c.types;
33 public  import glib.Str;
34 public  import gobject.ObjectG;
35 public  import gtk.TreeModelIF;
36 
37 
38 /** */
39 public template DocumentLinksT(TStruct)
40 {
41 	/** Get the main Gtk struct */
42 	public EvDocumentLinks* getDocumentLinksStruct(bool transferOwnership = false)
43 	{
44 		if (transferOwnership)
45 			ownedRef = false;
46 		return cast(EvDocumentLinks*)getStruct();
47 	}
48 
49 
50 	/**
51 	 *
52 	 * Params:
53 	 *     linkName = the link name
54 	 * Returns: an #EvLinkDest
55 	 */
56 	public LinkDest findLinkDest(string linkName)
57 	{
58 		auto __p = ev_document_links_find_link_dest(getDocumentLinksStruct(), Str.toStringz(linkName));
59 
60 		if(__p is null)
61 		{
62 			return null;
63 		}
64 
65 		return ObjectG.getDObject!(LinkDest)(cast(EvLinkDest*) __p, true);
66 	}
67 
68 	/** */
69 	public int findLinkPage(string linkName)
70 	{
71 		return ev_document_links_find_link_page(getDocumentLinksStruct(), Str.toStringz(linkName));
72 	}
73 
74 	/** */
75 	public int getDestPage(LinkDest dest)
76 	{
77 		return ev_document_links_get_dest_page(getDocumentLinksStruct(), (dest is null) ? null : dest.getLinkDestStruct());
78 	}
79 
80 	/** */
81 	public string getDestPageLabel(LinkDest dest)
82 	{
83 		auto retStr = ev_document_links_get_dest_page_label(getDocumentLinksStruct(), (dest is null) ? null : dest.getLinkDestStruct());
84 
85 		scope(exit) Str.freeString(retStr);
86 		return Str.toString(retStr);
87 	}
88 
89 	/** */
90 	public int getLinkPage(Link link)
91 	{
92 		return ev_document_links_get_link_page(getDocumentLinksStruct(), (link is null) ? null : link.getLinkStruct());
93 	}
94 
95 	/** */
96 	public string getLinkPageLabel(Link link)
97 	{
98 		auto retStr = ev_document_links_get_link_page_label(getDocumentLinksStruct(), (link is null) ? null : link.getLinkStruct());
99 
100 		scope(exit) Str.freeString(retStr);
101 		return Str.toString(retStr);
102 	}
103 
104 	/** */
105 	public MappingList getLinks(Page page)
106 	{
107 		auto __p = ev_document_links_get_links(getDocumentLinksStruct(), (page is null) ? null : page.getPageStruct());
108 
109 		if(__p is null)
110 		{
111 			return null;
112 		}
113 
114 		return ObjectG.getDObject!(MappingList)(cast(EvMappingList*) __p, true);
115 	}
116 
117 	/**
118 	 * Returns: a #GtkTreeModel
119 	 */
120 	public TreeModelIF getLinksModel()
121 	{
122 		auto __p = ev_document_links_get_links_model(getDocumentLinksStruct());
123 
124 		if(__p is null)
125 		{
126 			return null;
127 		}
128 
129 		return ObjectG.getDObject!(TreeModelIF)(cast(GtkTreeModel*) __p, true);
130 	}
131 
132 	/** */
133 	public bool hasDocumentLinks()
134 	{
135 		return ev_document_links_has_document_links(getDocumentLinksStruct()) != 0;
136 	}
137 }