1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19 
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 
25 module gio.UnixMountPoint;
26 
27 private import gio.Icon;
28 private import gio.IconIF;
29 private import glib.Str;
30 private import gobject.ObjectG;
31 private import gtkc.gio;
32 public  import gtkc.giotypes;
33 
34 
35 /**
36  * Defines a Unix mount point (e.g. <filename>/dev</filename>).
37  * This corresponds roughly to a fstab entry.
38  */
39 public class UnixMountPoint
40 {
41 	/** the main Gtk struct */
42 	protected GUnixMountPoint* gUnixMountPoint;
43 
44 	/** Get the main Gtk struct */
45 	public GUnixMountPoint* getUnixMountPointStruct()
46 	{
47 		return gUnixMountPoint;
48 	}
49 
50 	/** the main Gtk struct as a void* */
51 	protected void* getStruct()
52 	{
53 		return cast(void*)gUnixMountPoint;
54 	}
55 
56 	/**
57 	 * Sets our main struct and passes it to the parent class.
58 	 */
59 	public this (GUnixMountPoint* gUnixMountPoint)
60 	{
61 		this.gUnixMountPoint = gUnixMountPoint;
62 	}
63 
64 	/**
65 	 */
66 
67 	/**
68 	 * Compares two unix mount points.
69 	 *
70 	 * Params:
71 	 *     mount2 = a #GUnixMount.
72 	 *
73 	 * Return: 1, 0 or -1 if @mount1 is greater than, equal to,
74 	 *     or less than @mount2, respectively.
75 	 */
76 	public int compare(UnixMountPoint mount2)
77 	{
78 		return g_unix_mount_point_compare(gUnixMountPoint, (mount2 is null) ? null : mount2.getUnixMountPointStruct());
79 	}
80 
81 	/**
82 	 * Frees a unix mount point.
83 	 */
84 	public void free()
85 	{
86 		g_unix_mount_point_free(gUnixMountPoint);
87 	}
88 
89 	/**
90 	 * Gets the device path for a unix mount point.
91 	 *
92 	 * Return: a string containing the device path.
93 	 */
94 	public string getDevicePath()
95 	{
96 		return Str.toString(g_unix_mount_point_get_device_path(gUnixMountPoint));
97 	}
98 
99 	/**
100 	 * Gets the file system type for the mount point.
101 	 *
102 	 * Return: a string containing the file system type.
103 	 */
104 	public string getFsType()
105 	{
106 		return Str.toString(g_unix_mount_point_get_fs_type(gUnixMountPoint));
107 	}
108 
109 	/**
110 	 * Gets the mount path for a unix mount point.
111 	 *
112 	 * Return: a string containing the mount path.
113 	 */
114 	public string getMountPath()
115 	{
116 		return Str.toString(g_unix_mount_point_get_mount_path(gUnixMountPoint));
117 	}
118 
119 	/**
120 	 * Gets the options for the mount point.
121 	 *
122 	 * Return: a string containing the options.
123 	 *
124 	 * Since: 2.32
125 	 */
126 	public string getOptions()
127 	{
128 		return Str.toString(g_unix_mount_point_get_options(gUnixMountPoint));
129 	}
130 
131 	/**
132 	 * Guesses whether a Unix mount point can be ejected.
133 	 *
134 	 * Return: %TRUE if @mount_point is deemed to be ejectable.
135 	 */
136 	public bool guessCanEject()
137 	{
138 		return g_unix_mount_point_guess_can_eject(gUnixMountPoint) != 0;
139 	}
140 
141 	/**
142 	 * Guesses the icon of a Unix mount point.
143 	 *
144 	 * Return: a #GIcon
145 	 */
146 	public IconIF guessIcon()
147 	{
148 		auto p = g_unix_mount_point_guess_icon(gUnixMountPoint);
149 		
150 		if(p is null)
151 		{
152 			return null;
153 		}
154 		
155 		return ObjectG.getDObject!(Icon, IconIF)(cast(GIcon*) p);
156 	}
157 
158 	/**
159 	 * Guesses the name of a Unix mount point.
160 	 * The result is a translated string.
161 	 *
162 	 * Return: A newly allocated string that must
163 	 *     be freed with g_free()
164 	 */
165 	public string guessName()
166 	{
167 		return Str.toString(g_unix_mount_point_guess_name(gUnixMountPoint));
168 	}
169 
170 	/**
171 	 * Guesses the symbolic icon of a Unix mount point.
172 	 *
173 	 * Return: a #GIcon
174 	 *
175 	 * Since: 2.34
176 	 */
177 	public IconIF guessSymbolicIcon()
178 	{
179 		auto p = g_unix_mount_point_guess_symbolic_icon(gUnixMountPoint);
180 		
181 		if(p is null)
182 		{
183 			return null;
184 		}
185 		
186 		return ObjectG.getDObject!(Icon, IconIF)(cast(GIcon*) p);
187 	}
188 
189 	/**
190 	 * Checks if a unix mount point is a loopback device.
191 	 *
192 	 * Return: %TRUE if the mount point is a loopback. %FALSE otherwise.
193 	 */
194 	public bool isLoopback()
195 	{
196 		return g_unix_mount_point_is_loopback(gUnixMountPoint) != 0;
197 	}
198 
199 	/**
200 	 * Checks if a unix mount point is read only.
201 	 *
202 	 * Return: %TRUE if a mount point is read only.
203 	 */
204 	public bool isReadonly()
205 	{
206 		return g_unix_mount_point_is_readonly(gUnixMountPoint) != 0;
207 	}
208 
209 	/**
210 	 * Checks if a unix mount point is mountable by the user.
211 	 *
212 	 * Return: %TRUE if the mount point is user mountable.
213 	 */
214 	public bool isUserMountable()
215 	{
216 		return g_unix_mount_point_is_user_mountable(gUnixMountPoint) != 0;
217 	}
218 }