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 protected bool ownedRef; 44 45 /** Get the main Gtk struct */ 46 public GUnixMountPoint* getUnixMountPointStruct() 47 { 48 return gUnixMountPoint; 49 } 50 51 /** the main Gtk struct as a void* */ 52 protected void* getStruct() 53 { 54 return cast(void*)gUnixMountPoint; 55 } 56 57 /** 58 * Sets our main struct and passes it to the parent class. 59 */ 60 public this (GUnixMountPoint* gUnixMountPoint, bool ownedRef = false) 61 { 62 this.gUnixMountPoint = gUnixMountPoint; 63 this.ownedRef = ownedRef; 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, true); 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 auto retStr = g_unix_mount_point_guess_name(gUnixMountPoint); 168 169 scope(exit) Str.freeString(retStr); 170 return Str.toString(retStr); 171 } 172 173 /** 174 * Guesses the symbolic icon of a Unix mount point. 175 * 176 * Return: a #GIcon 177 * 178 * Since: 2.34 179 */ 180 public IconIF guessSymbolicIcon() 181 { 182 auto p = g_unix_mount_point_guess_symbolic_icon(gUnixMountPoint); 183 184 if(p is null) 185 { 186 return null; 187 } 188 189 return ObjectG.getDObject!(Icon, IconIF)(cast(GIcon*) p, true); 190 } 191 192 /** 193 * Checks if a unix mount point is a loopback device. 194 * 195 * Return: %TRUE if the mount point is a loopback. %FALSE otherwise. 196 */ 197 public bool isLoopback() 198 { 199 return g_unix_mount_point_is_loopback(gUnixMountPoint) != 0; 200 } 201 202 /** 203 * Checks if a unix mount point is read only. 204 * 205 * Return: %TRUE if a mount point is read only. 206 */ 207 public bool isReadonly() 208 { 209 return g_unix_mount_point_is_readonly(gUnixMountPoint) != 0; 210 } 211 212 /** 213 * Checks if a unix mount point is mountable by the user. 214 * 215 * Return: %TRUE if the mount point is user mountable. 216 */ 217 public bool isUserMountable() 218 { 219 return g_unix_mount_point_is_user_mountable(gUnixMountPoint) != 0; 220 } 221 }