319
335
* Unmounts a mount. This is an asynchronous operation, and is
320
336
* finished by calling g_mount_unmount_finish() with the @mount
321
* and #GAsyncResults data returned in the @callback.
337
* and #GAsyncResult data returned in the @callback.
324
g_mount_unmount (GMount *mount,
325
GMountUnmountFlags flags,
326
GCancellable *cancellable,
327
GAsyncReadyCallback callback,
340
g_mount_unmount (GMount *mount,
341
GMountUnmountFlags flags,
342
GCancellable *cancellable,
343
GAsyncReadyCallback callback,
330
346
GMountIface *iface;
394
410
* Ejects a mount. This is an asynchronous operation, and is
395
411
* finished by calling g_mount_eject_finish() with the @mount
396
* and #GAsyncResults data returned in the @callback.
412
* and #GAsyncResult data returned in the @callback.
399
g_mount_eject (GMount *mount,
400
GMountUnmountFlags flags,
401
GCancellable *cancellable,
402
GAsyncReadyCallback callback,
415
g_mount_eject (GMount *mount,
416
GMountUnmountFlags flags,
417
GCancellable *cancellable,
418
GAsyncReadyCallback callback,
405
421
GMountIface *iface;
539
555
return (* iface->remount_finish) (mount, result, error);
559
* g_mount_guess_content_type:
561
* @force_rescan: Whether to force a rescan of the content.
562
* Otherwise a cached result will be used if available
563
* @cancellable: optional #GCancellable object, %NULL to ignore
564
* @callback: a #GAsyncReadyCallback
565
* @user_data: user data passed to @callback
567
* Tries to guess the type of content stored on @mount. Returns one or
568
* more textual identifiers of well-known content types (typically
569
* prefixed with "x-content/"), e.g. x-content/image-dcf for camera
570
* memory cards. See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
571
* specification for more on x-content types.
573
* This is an asynchronous operation (see
574
* g_mount_guess_content_type_sync() for the synchronous version), and
575
* is finished by calling g_mount_guess_content_type_finish() with the
576
* @mount and #GAsyncResult data returned in the @callback.
581
g_mount_guess_content_type (GMount *mount,
582
gboolean force_rescan,
583
GCancellable *cancellable,
584
GAsyncReadyCallback callback,
589
g_return_if_fail (G_IS_MOUNT (mount));
591
iface = G_MOUNT_GET_IFACE (mount);
593
if (iface->guess_content_type == NULL)
595
g_simple_async_report_error_in_idle (G_OBJECT (mount),
597
G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
598
/* Translators: This is an error
599
* message for mount objects that
600
* don't implement content type guessing. */
601
_("mount doesn't implement content type guessing"));
606
(* iface->guess_content_type) (mount, force_rescan, cancellable, callback, user_data);
610
* g_mount_guess_content_type_finish:
612
* @result: a #GAsyncResult
613
* @error: a #GError location to store the error occuring, or %NULL to
616
* Finishes guessing content types of @mount. If any errors occured
617
* during the operation, @error will be set to contain the errors and
618
* %FALSE will be returned. In particular, you may get an
619
* %G_IO_ERROR_NOT_SUPPORTED if the mount does not support content
622
* Returns: a %NULL-terminated array of content types or %NULL on error.
623
* Caller should free this array with g_strfreev() when done with it.
628
g_mount_guess_content_type_finish (GMount *mount,
629
GAsyncResult *result,
634
g_return_val_if_fail (G_IS_MOUNT (mount), FALSE);
635
g_return_val_if_fail (G_IS_ASYNC_RESULT (result), FALSE);
637
if (G_IS_SIMPLE_ASYNC_RESULT (result))
639
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
640
if (g_simple_async_result_propagate_error (simple, error))
644
iface = G_MOUNT_GET_IFACE (mount);
645
return (* iface->guess_content_type_finish) (mount, result, error);
649
* g_mount_guess_content_type_sync:
651
* @force_rescan: Whether to force a rescan of the content.
652
* Otherwise a cached result will be used if available
653
* @cancellable: optional #GCancellable object, %NULL to ignore
654
* @error: a #GError location to store the error occuring, or %NULL to
657
* Tries to guess the type of content stored on @mount. Returns one or
658
* more textual identifiers of well-known content types (typically
659
* prefixed with "x-content/"), e.g. x-content/image-dcf for camera
660
* memory cards. See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
661
* specification for more on x-content types.
663
* This is an synchronous operation and as such may block doing IO;
664
* see g_mount_guess_content_type() for the asynchronous version.
666
* Returns: a %NULL-terminated array of content types or %NULL on error.
667
* Caller should free this array with g_strfreev() when done with it.
672
g_mount_guess_content_type_sync (GMount *mount,
673
gboolean force_rescan,
674
GCancellable *cancellable,
679
g_return_val_if_fail (G_IS_MOUNT (mount), NULL);
681
iface = G_MOUNT_GET_IFACE (mount);
683
if (iface->guess_content_type_sync == NULL)
685
g_set_error_literal (error,
686
G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
687
/* Translators: This is an error
688
* message for mount objects that
689
* don't implement content type guessing. */
690
_("mount doesn't implement synchronous content type guessing"));
695
return (* iface->guess_content_type_sync) (mount, force_rescan, cancellable, error);
543
698
#define __G_MOUNT_C__
544
699
#include "gioaliasdef.c"