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 * Compares two unix mount points. 67 * 68 * Params: 69 * mount2 = a #GUnixMount. 70 * 71 * Return: 1, 0 or -1 if @mount1 is greater than, equal to, 72 * or less than @mount2, respectively. 73 */ 74 public int compare(UnixMountPoint mount2) 75 { 76 return g_unix_mount_point_compare(gUnixMountPoint, (mount2 is null) ? null : mount2.getUnixMountPointStruct()); 77 } 78 79 /** 80 * Frees a unix mount point. 81 */ 82 public void free() 83 { 84 g_unix_mount_point_free(gUnixMountPoint); 85 } 86 87 /** 88 * Gets the device path for a unix mount point. 89 * 90 * Return: a string containing the device path. 91 */ 92 public string getDevicePath() 93 { 94 return Str.toString(g_unix_mount_point_get_device_path(gUnixMountPoint)); 95 } 96 97 /** 98 * Gets the file system type for the mount point. 99 * 100 * Return: a string containing the file system type. 101 */ 102 public string getFsType() 103 { 104 return Str.toString(g_unix_mount_point_get_fs_type(gUnixMountPoint)); 105 } 106 107 /** 108 * Gets the mount path for a unix mount point. 109 * 110 * Return: a string containing the mount path. 111 */ 112 public string getMountPath() 113 { 114 return Str.toString(g_unix_mount_point_get_mount_path(gUnixMountPoint)); 115 } 116 117 /** 118 * Gets the options for the mount point. 119 * 120 * Return: a string containing the options. 121 * 122 * Since: 2.32 123 */ 124 public string getOptions() 125 { 126 return Str.toString(g_unix_mount_point_get_options(gUnixMountPoint)); 127 } 128 129 /** 130 * Guesses whether a Unix mount point can be ejected. 131 * 132 * Return: %TRUE if @mount_point is deemed to be ejectable. 133 */ 134 public bool guessCanEject() 135 { 136 return g_unix_mount_point_guess_can_eject(gUnixMountPoint) != 0; 137 } 138 139 /** 140 * Guesses the icon of a Unix mount point. 141 * 142 * Return: a #GIcon 143 */ 144 public IconIF guessIcon() 145 { 146 auto p = g_unix_mount_point_guess_icon(gUnixMountPoint); 147 148 if(p is null) 149 { 150 return null; 151 } 152 153 return ObjectG.getDObject!(Icon, IconIF)(cast(GIcon*) p); 154 } 155 156 /** 157 * Guesses the name of a Unix mount point. 158 * The result is a translated string. 159 * 160 * Return: A newly allocated string that must 161 * be freed with g_free() 162 */ 163 public string guessName() 164 { 165 return Str.toString(g_unix_mount_point_guess_name(gUnixMountPoint)); 166 } 167 168 /** 169 * Guesses the symbolic icon of a Unix mount point. 170 * 171 * Return: a #GIcon 172 * 173 * Since: 2.34 174 */ 175 public IconIF guessSymbolicIcon() 176 { 177 auto p = g_unix_mount_point_guess_symbolic_icon(gUnixMountPoint); 178 179 if(p is null) 180 { 181 return null; 182 } 183 184 return ObjectG.getDObject!(Icon, IconIF)(cast(GIcon*) p); 185 } 186 187 /** 188 * Checks if a unix mount point is a loopback device. 189 * 190 * Return: %TRUE if the mount point is a loopback. %FALSE otherwise. 191 */ 192 public bool isLoopback() 193 { 194 return g_unix_mount_point_is_loopback(gUnixMountPoint) != 0; 195 } 196 197 /** 198 * Checks if a unix mount point is read only. 199 * 200 * Return: %TRUE if a mount point is read only. 201 */ 202 public bool isReadonly() 203 { 204 return g_unix_mount_point_is_readonly(gUnixMountPoint) != 0; 205 } 206 207 /** 208 * Checks if a unix mount point is mountable by the user. 209 * 210 * Return: %TRUE if the mount point is user mountable. 211 */ 212 public bool isUserMountable() 213 { 214 return g_unix_mount_point_is_user_mountable(gUnixMountPoint) != 0; 215 } 216 }