| 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 |
* Conversion parameters: |
|---|
| 26 |
* inFile = GVolume.html |
|---|
| 27 |
* outPack = gio |
|---|
| 28 |
* outFile = VolumeT |
|---|
| 29 |
* strct = GVolume |
|---|
| 30 |
* realStrct= |
|---|
| 31 |
* ctorStrct= |
|---|
| 32 |
* clss = VolumeT |
|---|
| 33 |
* interf = VolumeIF |
|---|
| 34 |
* class Code: No |
|---|
| 35 |
* interface Code: No |
|---|
| 36 |
* template for: |
|---|
| 37 |
* - TStruct |
|---|
| 38 |
* extend = |
|---|
| 39 |
* implements: |
|---|
| 40 |
* prefixes: |
|---|
| 41 |
* - g_volume_ |
|---|
| 42 |
* omit structs: |
|---|
| 43 |
* omit prefixes: |
|---|
| 44 |
* omit code: |
|---|
| 45 |
* omit signals: |
|---|
| 46 |
* imports: |
|---|
| 47 |
* - glib.Str |
|---|
| 48 |
* - glib.ErrorG |
|---|
| 49 |
* - glib.GException |
|---|
| 50 |
* - gobject.Signals |
|---|
| 51 |
* - gio.AsyncResultIF |
|---|
| 52 |
* - gio.Cancellable |
|---|
| 53 |
* - gio.Drive |
|---|
| 54 |
* - gio.DriveIF |
|---|
| 55 |
* - gio.File |
|---|
| 56 |
* - gio.Icon |
|---|
| 57 |
* - gio.IconIF |
|---|
| 58 |
* - gio.Mount |
|---|
| 59 |
* - gio.MountIF |
|---|
| 60 |
* - gio.MountOperation |
|---|
| 61 |
* structWrap: |
|---|
| 62 |
* - GAsyncResult* -> AsyncResultIF |
|---|
| 63 |
* - GCancellable* -> Cancellable |
|---|
| 64 |
* - GDrive* -> DriveIF |
|---|
| 65 |
* - GFile* -> File |
|---|
| 66 |
* - GIcon* -> IconIF |
|---|
| 67 |
* - GMount* -> MountIF |
|---|
| 68 |
* - GMountOperation* -> MountOperation |
|---|
| 69 |
* module aliases: |
|---|
| 70 |
* local aliases: |
|---|
| 71 |
* overrides: |
|---|
| 72 |
*/ |
|---|
| 73 |
|
|---|
| 74 |
module gio.VolumeT; |
|---|
| 75 |
|
|---|
| 76 |
public import gtkc.giotypes; |
|---|
| 77 |
|
|---|
| 78 |
public import gtkc.gio; |
|---|
| 79 |
public import glib.ConstructionException; |
|---|
| 80 |
|
|---|
| 81 |
public import gobject.Signals; |
|---|
| 82 |
public import gtkc.gdktypes; |
|---|
| 83 |
|
|---|
| 84 |
public import glib.Str; |
|---|
| 85 |
public import glib.ErrorG; |
|---|
| 86 |
public import glib.GException; |
|---|
| 87 |
public import gobject.Signals; |
|---|
| 88 |
public import gio.AsyncResultIF; |
|---|
| 89 |
public import gio.Cancellable; |
|---|
| 90 |
public import gio.Drive; |
|---|
| 91 |
public import gio.DriveIF; |
|---|
| 92 |
public import gio.File; |
|---|
| 93 |
public import gio.Icon; |
|---|
| 94 |
public import gio.IconIF; |
|---|
| 95 |
public import gio.Mount; |
|---|
| 96 |
public import gio.MountIF; |
|---|
| 97 |
public import gio.MountOperation; |
|---|
| 98 |
|
|---|
| 99 |
|
|---|
| 100 |
|
|---|
| 101 |
|
|---|
| 102 |
/** |
|---|
| 103 |
* Description |
|---|
| 104 |
* The GVolume interface represents user-visible objects that can be |
|---|
| 105 |
* mounted. Note, when porting from GnomeVFS, GVolume is the moral |
|---|
| 106 |
* equivalent of GnomeVFSDrive. |
|---|
| 107 |
* Mounting a GVolume instance is an asynchronous operation. For more |
|---|
| 108 |
* information about asynchronous operations, see GAsyncReady and |
|---|
| 109 |
* GSimpleAsyncReady. To mount a GVolume, first call |
|---|
| 110 |
* g_volume_mount() with (at least) the GVolume instance, optionally |
|---|
| 111 |
* a GMountOperation object and a GAsyncReadyCallback. |
|---|
| 112 |
* Typically, one will only want to pass NULL for the |
|---|
| 113 |
* GMountOperation if automounting all volumes when a desktop session |
|---|
| 114 |
* starts since it's not desirable to put up a lot of dialogs asking |
|---|
| 115 |
* for credentials. |
|---|
| 116 |
* The callback will be fired when the operation has resolved (either |
|---|
| 117 |
* with success or failure), and a GAsyncReady structure will be |
|---|
| 118 |
* passed to the callback. That callback should then call |
|---|
| 119 |
* g_volume_mount_finish() with the GVolume instance and the |
|---|
| 120 |
* GAsyncReady data to see if the operation was completed |
|---|
| 121 |
* successfully. If an error is present when g_volume_mount_finish() |
|---|
| 122 |
* is called, then it will be filled with any error information. |
|---|
| 123 |
* It is sometimes necessary to directly access the underlying |
|---|
| 124 |
* operating system object behind a volume (e.g. for passing a volume |
|---|
| 125 |
* to an application via the commandline). For this purpose, GIO |
|---|
| 126 |
* allows to obtain an 'identifier' for the volume. There can be |
|---|
| 127 |
* different kinds of identifiers, such as Hal UDIs, filesystem labels, |
|---|
| 128 |
* traditional Unix devices (e.g. /dev/sda2), |
|---|
| 129 |
* uuids. GIO uses predefind strings as names for the different kinds |
|---|
| 130 |
* of identifiers: G_VOLUME_IDENTIFIER_KIND_HAL_UDI, |
|---|
| 131 |
* G_VOLUME_IDENTIFIER_KIND_LABEL, etc. Use g_volume_get_identifier() |
|---|
| 132 |
* to obtain an identifier for a volume. |
|---|
| 133 |
* Note that G_VOLUME_IDENTIFIER_KIND_HAL_UDI will only be available |
|---|
| 134 |
* when the gvfs hal volume monitor is in use. Other volume monitors |
|---|
| 135 |
* will generally be able to provide the G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE |
|---|
| 136 |
* identifier, which can be used to obtain a hal device by means of |
|---|
| 137 |
* libhal_manger_find_device_string_match(). |
|---|
| 138 |
*/ |
|---|
| 139 |
public template VolumeT(TStruct) |
|---|
| 140 |
{ |
|---|
| 141 |
|
|---|
| 142 |
/** the main Gtk struct */ |
|---|
| 143 |
protected GVolume* gVolume; |
|---|
| 144 |
|
|---|
| 145 |
|
|---|
| 146 |
public GVolume* getVolumeTStruct() |
|---|
| 147 |
{ |
|---|
| 148 |
return cast(GVolume*)getStruct(); |
|---|
| 149 |
} |
|---|
| 150 |
|
|---|
| 151 |
|
|---|
| 152 |
/** |
|---|
| 153 |
*/ |
|---|
| 154 |
int[string] connectedSignals; |
|---|
| 155 |
|
|---|
| 156 |
void delegate(VolumeIF)[] _onChangedListeners; |
|---|
| 157 |
void delegate(VolumeIF)[] onChangedListeners() |
|---|
| 158 |
{ |
|---|
| 159 |
return _onChangedListeners; |
|---|
| 160 |
} |
|---|
| 161 |
/** |
|---|
| 162 |
* Emitted when the volume has been changed. |
|---|
| 163 |
*/ |
|---|
| 164 |
void addOnChanged(void delegate(VolumeIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) |
|---|
| 165 |
{ |
|---|
| 166 |
if ( !("changed" in connectedSignals) ) |
|---|
| 167 |
{ |
|---|
| 168 |
Signals.connectData( |
|---|
| 169 |
getStruct(), |
|---|
| 170 |
"changed", |
|---|
| 171 |
cast(GCallback)&callBackChanged, |
|---|
| 172 |
cast(void*)cast(VolumeIF)this, |
|---|
| 173 |
null, |
|---|
| 174 |
connectFlags); |
|---|
| 175 |
connectedSignals["changed"] = 1; |
|---|
| 176 |
} |
|---|
| 177 |
_onChangedListeners ~= dlg; |
|---|
| 178 |
} |
|---|
| 179 |
extern(C) static void callBackChanged(GVolume* arg0Struct, VolumeIF volumeIF) |
|---|
| 180 |
{ |
|---|
| 181 |
foreach ( void delegate(VolumeIF) dlg ; volumeIF.onChangedListeners ) |
|---|
| 182 |
{ |
|---|
| 183 |
dlg(volumeIF); |
|---|
| 184 |
} |
|---|
| 185 |
} |
|---|
| 186 |
|
|---|
| 187 |
void delegate(VolumeIF)[] _onRemovedListeners; |
|---|
| 188 |
void delegate(VolumeIF)[] onRemovedListeners() |
|---|
| 189 |
{ |
|---|
| 190 |
return _onRemovedListeners; |
|---|
| 191 |
} |
|---|
| 192 |
/** |
|---|
| 193 |
* This signal is emitted when the GVolume have been removed. If |
|---|
| 194 |
* the recipient is holding references to the object they should |
|---|
| 195 |
* release them so the object can be finalized. |
|---|
| 196 |
*/ |
|---|
| 197 |
void addOnRemoved(void delegate(VolumeIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) |
|---|
| 198 |
{ |
|---|
| 199 |
if ( !("removed" in connectedSignals) ) |
|---|
| 200 |
{ |
|---|
| 201 |
Signals.connectData( |
|---|
| 202 |
getStruct(), |
|---|
| 203 |
"removed", |
|---|
| 204 |
cast(GCallback)&callBackRemoved, |
|---|
| 205 |
cast(void*)cast(VolumeIF)this, |
|---|
| 206 |
null, |
|---|
| 207 |
connectFlags); |
|---|
| 208 |
connectedSignals["removed"] = 1; |
|---|
| 209 |
} |
|---|
| 210 |
_onRemovedListeners ~= dlg; |
|---|
| 211 |
} |
|---|
| 212 |
extern(C) static void callBackRemoved(GVolume* arg0Struct, VolumeIF volumeIF) |
|---|
| 213 |
{ |
|---|
| 214 |
foreach ( void delegate(VolumeIF) dlg ; volumeIF.onRemovedListeners ) |
|---|
| 215 |
{ |
|---|
| 216 |
dlg(volumeIF); |
|---|
| 217 |
} |
|---|
| 218 |
} |
|---|
| 219 |
|
|---|
| 220 |
|
|---|
| 221 |
/** |
|---|
| 222 |
* Gets the name of volume. |
|---|
| 223 |
* Returns: the name for the given volume. The returned string should be freed with g_free() when no longer needed. |
|---|
| 224 |
*/ |
|---|
| 225 |
public string getName() |
|---|
| 226 |
{ |
|---|
| 227 |
// char * g_volume_get_name (GVolume *volume); |
|---|
| 228 |
return Str.toString(g_volume_get_name(getVolumeTStruct())); |
|---|
| 229 |
} |
|---|
| 230 |
|
|---|
| 231 |
/** |
|---|
| 232 |
* Gets the UUID for the volume. The reference is typically based on |
|---|
| 233 |
* the file system UUID for the volume in question and should be |
|---|
| 234 |
* considered an opaque string. Returns NULL if there is no UUID |
|---|
| 235 |
* available. |
|---|
| 236 |
* Returns: the UUID for volume or NULL if no UUID can be computed. The returned string should be freed with g_free() when no longer needed. |
|---|
| 237 |
*/ |
|---|
| 238 |
public string getUuid() |
|---|
| 239 |
{ |
|---|
| 240 |
// char * g_volume_get_uuid (GVolume *volume); |
|---|
| 241 |
return Str.toString(g_volume_get_uuid(getVolumeTStruct())); |
|---|
| 242 |
} |
|---|
| 243 |
|
|---|
| 244 |
/** |
|---|
| 245 |
* Gets the icon for volume. |
|---|
| 246 |
* Returns: a GIcon. The returned object should be unreffed with g_object_unref() when no longer needed. [transfer full] |
|---|
| 247 |
*/ |
|---|
| 248 |
public IconIF getIcon() |
|---|
| 249 |
{ |
|---|
| 250 |
// GIcon * g_volume_get_icon (GVolume *volume); |
|---|
| 251 |
auto p = g_volume_get_icon(getVolumeTStruct()); |
|---|
| 252 |
if(p is null) |
|---|
| 253 |
{ |
|---|
| 254 |
return null; |
|---|
| 255 |
} |
|---|
| 256 |
return new Icon(cast(GIcon*) p); |
|---|
| 257 |
} |
|---|
| 258 |
|
|---|
| 259 |
/** |
|---|
| 260 |
* Gets the drive for the volume. |
|---|
| 261 |
* Returns: a GDrive or NULL if volume is not associated with a drive. The returned object should be unreffed with g_object_unref() when no longer needed. [transfer full] |
|---|
| 262 |
*/ |
|---|
| 263 |
public DriveIF getDrive() |
|---|
| 264 |
{ |
|---|
| 265 |
// GDrive * g_volume_get_drive (GVolume *volume); |
|---|
| 266 |
auto p = g_volume_get_drive(getVolumeTStruct()); |
|---|
| 267 |
if(p is null) |
|---|
| 268 |
{ |
|---|
| 269 |
return null; |
|---|
| 270 |
} |
|---|
| 271 |
return new Drive(cast(GDrive*) p); |
|---|
| 272 |
} |
|---|
| 273 |
|
|---|
| 274 |
/** |
|---|
| 275 |
* Gets the mount for the volume. |
|---|
| 276 |
* Returns: a GMount or NULL if volume isn't mounted. The returned object should be unreffed with g_object_unref() when no longer needed. [transfer full] |
|---|
| 277 |
*/ |
|---|
| 278 |
public MountIF getMount() |
|---|
| 279 |
{ |
|---|
| 280 |
// GMount * g_volume_get_mount (GVolume *volume); |
|---|
| 281 |
auto p = g_volume_get_mount(getVolumeTStruct()); |
|---|
| 282 |
if(p is null) |
|---|
| 283 |
{ |
|---|
| 284 |
return null; |
|---|
| 285 |
} |
|---|
| 286 |
return new Mount(cast(GMount*) p); |
|---|
| 287 |
} |
|---|
| 288 |
|
|---|
| 289 |
/** |
|---|
| 290 |
* Checks if a volume can be mounted. |
|---|
| 291 |
* Returns: TRUE if the volume can be mounted. FALSE otherwise. |
|---|
| 292 |
*/ |
|---|
| 293 |
public int canMount() |
|---|
| 294 |
{ |
|---|
| 295 |
// gboolean g_volume_can_mount (GVolume *volume); |
|---|
| 296 |
return g_volume_can_mount(getVolumeTStruct()); |
|---|
| 297 |
} |
|---|
| 298 |
|
|---|
| 299 |
/** |
|---|
| 300 |
* Returns whether the volume should be automatically mounted. |
|---|
| 301 |
* Returns: TRUE if the volume should be automatically mounted. |
|---|
| 302 |
*/ |
|---|
| 303 |
public int shouldAutomount() |
|---|
| 304 |
{ |
|---|
| 305 |
// gboolean g_volume_should_automount (GVolume *volume); |
|---|
| 306 |
return g_volume_should_automount(getVolumeTStruct()); |
|---|
| 307 |
} |
|---|
| 308 |
|
|---|
| 309 |
/** |
|---|
| 310 |
* Gets the activation root for a GVolume if it is known ahead of |
|---|
| 311 |
* mount time. Returns NULL otherwise. If not NULL and if volume |
|---|
| 312 |
* is mounted, then the result of g_mount_get_root() on the |
|---|
| 313 |
* GMount object obtained from g_volume_get_mount() will always |
|---|
| 314 |
* either be equal or a prefix of what this function returns. In |
|---|
| 315 |
* other words, in code |
|---|
| 316 |
* GMount *mount; |
|---|
| 317 |
* GFile *mount_root |
|---|
| 318 |
* GFile *volume_activation_root; |
|---|
| 319 |
* mount = g_volume_get_mount (volume); /+* mounted, so never NULL +/ |
|---|
| 320 |
* mount_root = g_mount_get_root (mount); |
|---|
| 321 |
* volume_activation_root = g_volume_get_activation_root(volume); /+* assume not NULL +/ |
|---|
| 322 |
* then the expression |
|---|
| 323 |
* (g_file_has_prefix (volume_activation_root, mount_root) || |
|---|
| 324 |
* g_file_equal (volume_activation_root, mount_root)) |
|---|
| 325 |
* will always be TRUE. |
|---|
| 326 |
* Activation roots are typically used in GVolumeMonitor |
|---|
| 327 |
* implementations to find the underlying mount to shadow, see |
|---|
| 328 |
* g_mount_is_shadowed() for more details. |
|---|
| 329 |
* Since 2.18 |
|---|
| 330 |
* Returns: the activation root of volume or NULL. Use g_object_unref() to free. [transfer full] |
|---|
| 331 |
*/ |
|---|
| 332 |
public File getActivationRoot() |
|---|
| 333 |
{ |
|---|
| 334 |
// GFile * g_volume_get_activation_root (GVolume *volume); |
|---|
| 335 |
auto p = g_volume_get_activation_root(getVolumeTStruct()); |
|---|
| 336 |
if(p is null) |
|---|
| 337 |
{ |
|---|
| 338 |
return null; |
|---|
| 339 |
} |
|---|
| 340 |
return new File(cast(GFile*) p); |
|---|
| 341 |
} |
|---|
| 342 |
|
|---|
| 343 |
/** |
|---|
| 344 |
* Mounts a volume. This is an asynchronous operation, and is |
|---|
| 345 |
* finished by calling g_volume_mount_finish() with the volume |
|---|
| 346 |
* and GAsyncResult returned in the callback. |
|---|
| 347 |
* Virtual: mount_fn |
|---|
| 348 |
* Params: |
|---|
| 349 |
* flags = flags affecting the operation |
|---|
| 350 |
* mountOperation = a GMountOperation or NULL to avoid user interaction. [allow-none] |
|---|
| 351 |
* cancellable = optional GCancellable object, NULL to ignore. [allow-none] |
|---|
| 352 |
* callback = a GAsyncReadyCallback, or NULL. [allow-none] |
|---|
| 353 |
* userData = user data that gets passed to callback |
|---|
| 354 |
*/ |
|---|
| 355 |
public void mount(GMountMountFlags flags, MountOperation mountOperation, Cancellable cancellable, GAsyncReadyCallback callback, void* userData) |
|---|
| 356 |
{ |
|---|
| 357 |
// void g_volume_mount (GVolume *volume, GMountMountFlags flags, GMountOperation *mount_operation, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); |
|---|
| 358 |
g_volume_mount(getVolumeTStruct(), flags, (mountOperation is null) ? null : mountOperation.getMountOperationStruct(), (cancellable is null) ? null : cancellable.getCancellableStruct(), callback, userData); |
|---|
| 359 |
} |
|---|
| 360 |
|
|---|
| 361 |
/** |
|---|
| 362 |
* Finishes mounting a volume. If any errors occured during the operation, |
|---|
| 363 |
* error will be set to contain the errors and FALSE will be returned. |
|---|
| 364 |
* If the mount operation succeeded, g_volume_get_mount() on volume |
|---|
| 365 |
* is guaranteed to return the mount right after calling this |
|---|
| 366 |
* function; there's no need to listen for the 'mount-added' signal on |
|---|
| 367 |
* GVolumeMonitor. |
|---|
| 368 |
* Params: |
|---|
| 369 |
* result = a GAsyncResult |
|---|
| 370 |
* Returns: TRUE, FALSE if operation failed. |
|---|
| 371 |
* Throws: GException on failure. |
|---|
| 372 |
*/ |
|---|
| 373 |
public int mountFinish(AsyncResultIF result) |
|---|
| 374 |
{ |
|---|
| 375 |
// gboolean g_volume_mount_finish (GVolume *volume, GAsyncResult *result, GError **error); |
|---|
| 376 |
GError* err = null; |
|---|
| 377 |
|
|---|
| 378 |
auto p = g_volume_mount_finish(getVolumeTStruct(), (result is null) ? null : result.getAsyncResultTStruct(), &err); |
|---|
| 379 |
|
|---|
| 380 |
if (err !is null) |
|---|
| 381 |
{ |
|---|
| 382 |
throw new GException( new ErrorG(err) ); |
|---|
| 383 |
} |
|---|
| 384 |
|
|---|
| 385 |
return p; |
|---|
| 386 |
} |
|---|
| 387 |
|
|---|
| 388 |
/** |
|---|
| 389 |
* Checks if a volume can be ejected. |
|---|
| 390 |
* Returns: TRUE if the volume can be ejected. FALSE otherwise. |
|---|
| 391 |
*/ |
|---|
| 392 |
public int canEject() |
|---|
| 393 |
{ |
|---|
| 394 |
// gboolean g_volume_can_eject (GVolume *volume); |
|---|
| 395 |
return g_volume_can_eject(getVolumeTStruct()); |
|---|
| 396 |
} |
|---|
| 397 |
|
|---|
| 398 |
/** |
|---|
| 399 |
* Warning |
|---|
| 400 |
* g_volume_eject has been deprecated since version 2.22 and should not be used in newly-written code. Use g_volume_eject_with_operation() instead. |
|---|
| 401 |
* Ejects a volume. This is an asynchronous operation, and is |
|---|
| 402 |
* finished by calling g_volume_eject_finish() with the volume |
|---|
| 403 |
* and GAsyncResult returned in the callback. |
|---|
| 404 |
* Params: |
|---|
| 405 |
* flags = flags affecting the unmount if required for eject |
|---|
| 406 |
* cancellable = optional GCancellable object, NULL to ignore. [allow-none] |
|---|
| 407 |
* callback = a GAsyncReadyCallback, or NULL. [allow-none] |
|---|
| 408 |
* userData = user data that gets passed to callback |
|---|
| 409 |
*/ |
|---|
| 410 |
public void eject(GMountUnmountFlags flags, Cancellable cancellable, GAsyncReadyCallback callback, void* userData) |
|---|
| 411 |
{ |
|---|
| 412 |
// void g_volume_eject (GVolume *volume, GMountUnmountFlags flags, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); |
|---|
| 413 |
g_volume_eject(getVolumeTStruct(), flags, (cancellable is null) ? null : cancellable.getCancellableStruct(), callback, userData); |
|---|
| 414 |
} |
|---|
| 415 |
|
|---|
| 416 |
/** |
|---|
| 417 |
* Warning |
|---|
| 418 |
* g_volume_eject_finish has been deprecated since version 2.22 and should not be used in newly-written code. Use g_volume_eject_with_operation_finish() instead. |
|---|
| 419 |
* Finishes ejecting a volume. If any errors occured during the operation, |
|---|
| 420 |
* error will be set to contain the errors and FALSE will be returned. |
|---|
| 421 |
* Params: |
|---|
| 422 |
* result = a GAsyncResult. |
|---|
| 423 |
* Returns: TRUE, FALSE if operation failed. |
|---|
| 424 |
* Throws: GException on failure. |
|---|
| 425 |
*/ |
|---|
| 426 |
public int ejectFinish(AsyncResultIF result) |
|---|
| 427 |
{ |
|---|
| 428 |
// gboolean g_volume_eject_finish (GVolume *volume, GAsyncResult *result, GError **error); |
|---|
| 429 |
GError* err = null; |
|---|
| 430 |
|
|---|
| 431 |
auto p = g_volume_eject_finish(getVolumeTStruct(), (result is null) ? null : result.getAsyncResultTStruct(), &err); |
|---|
| 432 |
|
|---|
| 433 |
if (err !is null) |
|---|
| 434 |
{ |
|---|
| 435 |
throw new GException( new ErrorG(err) ); |
|---|
| 436 |
} |
|---|
| 437 |
|
|---|
| 438 |
return p; |
|---|
| 439 |
} |
|---|
| 440 |
|
|---|
| 441 |
/** |
|---|
| 442 |
* Ejects a volume. This is an asynchronous operation, and is |
|---|
| 443 |
* finished by calling g_volume_eject_with_operation_finish() with the volume |
|---|
| 444 |
* and GAsyncResult data returned in the callback. |
|---|
| 445 |
* Since 2.22 |
|---|
| 446 |
* Params: |
|---|
| 447 |
* flags = flags affecting the unmount if required for eject |
|---|
| 448 |
* mountOperation = a GMountOperation or NULL to |
|---|
| 449 |
* avoid user interaction. [allow-none] |
|---|
| 450 |
* cancellable = optional GCancellable object, NULL to ignore. [allow-none] |
|---|
| 451 |
* callback = a GAsyncReadyCallback, or NULL. |
|---|
| 452 |
* userData = user data passed to callback. |
|---|
| 453 |
*/ |
|---|
| 454 |
public void ejectWithOperation(GMountUnmountFlags flags, MountOperation mountOperation, Cancellable cancellable, GAsyncReadyCallback callback, void* userData) |
|---|
| 455 |
{ |
|---|
| 456 |
// void g_volume_eject_with_operation (GVolume *volume, GMountUnmountFlags flags, GMountOperation *mount_operation, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); |
|---|
| 457 |
g_volume_eject_with_operation(getVolumeTStruct(), flags, (mountOperation is null) ? null : mountOperation.getMountOperationStruct(), (cancellable is null) ? null : cancellable.getCancellableStruct(), callback, userData); |
|---|
| 458 |
} |
|---|
| 459 |
|
|---|
| 460 |
/** |
|---|
| 461 |
* Finishes ejecting a volume. If any errors occurred during the operation, |
|---|
| 462 |
* error will be set to contain the errors and FALSE will be returned. |
|---|
| 463 |
* Since 2.22 |
|---|
| 464 |
* Params: |
|---|
| 465 |
* result = a GAsyncResult. |
|---|
| 466 |
* Returns: TRUE if the volume was successfully ejected. FALSE otherwise. |
|---|
| 467 |
* Throws: GException on failure. |
|---|
| 468 |
*/ |
|---|
| 469 |
public int ejectWithOperationFinish(AsyncResultIF result) |
|---|
| 470 |
{ |
|---|
| 471 |
// gboolean g_volume_eject_with_operation_finish (GVolume *volume, GAsyncResult *result, GError **error); |
|---|
| 472 |
GError* err = null; |
|---|
| 473 |
|
|---|
| 474 |
auto p = g_volume_eject_with_operation_finish(getVolumeTStruct(), (result is null) ? null : result.getAsyncResultTStruct(), &err); |
|---|
| 475 |
|
|---|
| 476 |
if (err !is null) |
|---|
| 477 |
{ |
|---|
| 478 |
throw new GException( new ErrorG(err) ); |
|---|
| 479 |
} |
|---|
| 480 |
|
|---|
| 481 |
return p; |
|---|
| 482 |
} |
|---|
| 483 |
|
|---|
| 484 |
/** |
|---|
| 485 |
* Gets the kinds of identifiers |
|---|
| 486 |
* that volume has. Use g_volume_get_identifer() to obtain |
|---|
| 487 |
* the identifiers themselves. |
|---|
| 488 |
* Returns: a NULL-terminated array of strings containing kinds of identifiers. Use g_strfreev() to free. [array zero-terminated=1][transfer full] |
|---|
| 489 |
*/ |
|---|
| 490 |
public string[] enumerateIdentifiers() |
|---|
| 491 |
{ |
|---|
| 492 |
// char ** g_volume_enumerate_identifiers (GVolume *volume); |
|---|
| 493 |
return Str.toStringArray(g_volume_enumerate_identifiers(getVolumeTStruct())); |
|---|
| 494 |
} |
|---|
| 495 |
|
|---|
| 496 |
/** |
|---|
| 497 |
* Gets the identifier of the given kind for volume. |
|---|
| 498 |
* See the introduction |
|---|
| 499 |
* for more information about volume identifiers. |
|---|
| 500 |
* Params: |
|---|
| 501 |
* kind = the kind of identifier to return |
|---|
| 502 |
* Returns: a newly allocated string containing the requested identfier, or NULL if the GVolume doesn't have this kind of identifier Signal Details The "changed" signal void user_function (GVolume *arg0, gpointer user_data) : Run Last Emitted when the volume has been changed. |
|---|
| 503 |
*/ |
|---|
| 504 |
public string getIdentifier(string kind) |
|---|
| 505 |
{ |
|---|
| 506 |
// char * g_volume_get_identifier (GVolume *volume, const char *kind); |
|---|
| 507 |
return Str.toString(g_volume_get_identifier(getVolumeTStruct(), Str.toStringz(kind))); |
|---|
| 508 |
} |
|---|
| 509 |
} |
|---|