• Home
  • Raw
  • Download

Lines Matching +full:- +full:- +full:volume

1 /* GIO - GLib Input, Output and Streaming Library
3 * Copyright (C) 2006-2007 Red Hat, Inc.
34 * @short_description: Volume management
37 * The #GVolume interface represents user-visible objects that can be
60 * ## Volume Identifiers # {#volume-identifier}
63 * operating system object behind a volume (e.g. for passing a volume
65 * allows to obtain an 'identifier' for the volume. There can be
70 * Use g_volume_get_identifier() to obtain an identifier for a volume.
74 * when the gvfs hal volume monitor is in use. Other volume monitors
89 * Emitted when the volume has been changed. in G_DEFINE_INTERFACE()
117 * @volume: a #GVolume
119 * Gets the name of @volume.
121 * Returns: the name for the given @volume. The returned string should
125 g_volume_get_name (GVolume *volume) in g_volume_get_name() argument
129 g_return_val_if_fail (G_IS_VOLUME (volume), NULL); in g_volume_get_name()
131 iface = G_VOLUME_GET_IFACE (volume); in g_volume_get_name()
133 return (* iface->get_name) (volume); in g_volume_get_name()
138 * @volume: a #GVolume
140 * Gets the icon for @volume.
147 g_volume_get_icon (GVolume *volume) in g_volume_get_icon() argument
151 g_return_val_if_fail (G_IS_VOLUME (volume), NULL); in g_volume_get_icon()
153 iface = G_VOLUME_GET_IFACE (volume); in g_volume_get_icon()
155 return (* iface->get_icon) (volume); in g_volume_get_icon()
160 * @volume: a #GVolume
162 * Gets the symbolic icon for @volume.
171 g_volume_get_symbolic_icon (GVolume *volume) in g_volume_get_symbolic_icon() argument
176 g_return_val_if_fail (G_IS_VOLUME (volume), NULL); in g_volume_get_symbolic_icon()
178 iface = G_VOLUME_GET_IFACE (volume); in g_volume_get_symbolic_icon()
180 if (iface->get_symbolic_icon != NULL) in g_volume_get_symbolic_icon()
181 ret = iface->get_symbolic_icon (volume); in g_volume_get_symbolic_icon()
183 ret = g_themed_icon_new_with_default_fallbacks ("folder-remote-symbolic"); in g_volume_get_symbolic_icon()
191 * @volume: a #GVolume
193 * Gets the UUID for the @volume. The reference is typically based on
194 * the file system UUID for the volume in question and should be
198 * Returns: (nullable) (transfer full): the UUID for @volume or %NULL if no UUID
204 g_volume_get_uuid (GVolume *volume) in g_volume_get_uuid() argument
208 g_return_val_if_fail (G_IS_VOLUME (volume), NULL); in g_volume_get_uuid()
210 iface = G_VOLUME_GET_IFACE (volume); in g_volume_get_uuid()
212 return (* iface->get_uuid) (volume); in g_volume_get_uuid()
217 * @volume: a #GVolume
219 * Gets the drive for the @volume.
221 * Returns: (transfer full) (nullable): a #GDrive or %NULL if @volume is not
226 g_volume_get_drive (GVolume *volume) in g_volume_get_drive() argument
230 g_return_val_if_fail (G_IS_VOLUME (volume), NULL); in g_volume_get_drive()
232 iface = G_VOLUME_GET_IFACE (volume); in g_volume_get_drive()
234 return (* iface->get_drive) (volume); in g_volume_get_drive()
239 * @volume: a #GVolume
241 * Gets the mount for the @volume.
243 * Returns: (transfer full) (nullable): a #GMount or %NULL if @volume isn't mounted.
248 g_volume_get_mount (GVolume *volume) in g_volume_get_mount() argument
252 g_return_val_if_fail (G_IS_VOLUME (volume), NULL); in g_volume_get_mount()
254 iface = G_VOLUME_GET_IFACE (volume); in g_volume_get_mount()
256 return (* iface->get_mount) (volume); in g_volume_get_mount()
262 * @volume: a #GVolume
264 * Checks if a volume can be mounted.
266 * Returns: %TRUE if the @volume can be mounted. %FALSE otherwise
269 g_volume_can_mount (GVolume *volume) in g_volume_can_mount() argument
273 g_return_val_if_fail (G_IS_VOLUME (volume), FALSE); in g_volume_can_mount()
275 iface = G_VOLUME_GET_IFACE (volume); in g_volume_can_mount()
277 if (iface->can_mount == NULL) in g_volume_can_mount()
280 return (* iface->can_mount) (volume); in g_volume_can_mount()
285 * @volume: a #GVolume
287 * Checks if a volume can be ejected.
289 * Returns: %TRUE if the @volume can be ejected. %FALSE otherwise
292 g_volume_can_eject (GVolume *volume) in g_volume_can_eject() argument
296 g_return_val_if_fail (G_IS_VOLUME (volume), FALSE); in g_volume_can_eject()
298 iface = G_VOLUME_GET_IFACE (volume); in g_volume_can_eject()
300 if (iface->can_eject == NULL) in g_volume_can_eject()
303 return (* iface->can_eject) (volume); in g_volume_can_eject()
308 * @volume: a #GVolume
310 * Returns whether the volume should be automatically mounted.
312 * Returns: %TRUE if the volume should be automatically mounted
315 g_volume_should_automount (GVolume *volume) in g_volume_should_automount() argument
319 g_return_val_if_fail (G_IS_VOLUME (volume), FALSE); in g_volume_should_automount()
321 iface = G_VOLUME_GET_IFACE (volume); in g_volume_should_automount()
323 if (iface->should_automount == NULL) in g_volume_should_automount()
326 return (* iface->should_automount) (volume); in g_volume_should_automount()
332 * @volume: a #GVolume
339 * Mounts a volume. This is an asynchronous operation, and is
340 * finished by calling g_volume_mount_finish() with the @volume
346 g_volume_mount (GVolume *volume, in g_volume_mount() argument
355 g_return_if_fail (G_IS_VOLUME (volume)); in g_volume_mount()
357 iface = G_VOLUME_GET_IFACE (volume); in g_volume_mount()
359 if (iface->mount_fn == NULL) in g_volume_mount()
361 g_task_report_new_error (volume, callback, user_data, in g_volume_mount()
364 _("volume doesn’t implement mount")); in g_volume_mount()
368 (* iface->mount_fn) (volume, flags, mount_operation, cancellable, callback, user_data); in g_volume_mount()
373 * @volume: a #GVolume
377 * Finishes mounting a volume. If any errors occurred during the operation,
380 * If the mount operation succeeded, g_volume_get_mount() on @volume
382 * function; there's no need to listen for the 'mount-added' signal on
388 g_volume_mount_finish (GVolume *volume, in g_volume_mount_finish() argument
394 g_return_val_if_fail (G_IS_VOLUME (volume), FALSE); in g_volume_mount_finish()
402 iface = G_VOLUME_GET_IFACE (volume); in g_volume_mount_finish()
403 return (* iface->mount_finish) (volume, result, error); in g_volume_mount_finish()
408 * @volume: a #GVolume
414 * Ejects a volume. This is an asynchronous operation, and is
415 * finished by calling g_volume_eject_finish() with the @volume
421 g_volume_eject (GVolume *volume, in g_volume_eject() argument
429 g_return_if_fail (G_IS_VOLUME (volume)); in g_volume_eject()
431 iface = G_VOLUME_GET_IFACE (volume); in g_volume_eject()
433 if (iface->eject == NULL) in g_volume_eject()
435 g_task_report_new_error (volume, callback, user_data, in g_volume_eject()
438 _("volume doesn’t implement eject")); in g_volume_eject()
442 (* iface->eject) (volume, flags, cancellable, callback, user_data); in g_volume_eject()
447 * @volume: pointer to a #GVolume
451 * Finishes ejecting a volume. If any errors occurred during the operation,
459 g_volume_eject_finish (GVolume *volume, in g_volume_eject_finish() argument
465 g_return_val_if_fail (G_IS_VOLUME (volume), FALSE); in g_volume_eject_finish()
473 iface = G_VOLUME_GET_IFACE (volume); in g_volume_eject_finish()
474 return (* iface->eject_finish) (volume, result, error); in g_volume_eject_finish()
479 * @volume: a #GVolume
487 * Ejects a volume. This is an asynchronous operation, and is
488 * finished by calling g_volume_eject_with_operation_finish() with the @volume
494 g_volume_eject_with_operation (GVolume *volume, in g_volume_eject_with_operation() argument
503 g_return_if_fail (G_IS_VOLUME (volume)); in g_volume_eject_with_operation()
505 iface = G_VOLUME_GET_IFACE (volume); in g_volume_eject_with_operation()
507 if (iface->eject == NULL && iface->eject_with_operation == NULL) in g_volume_eject_with_operation()
509 g_task_report_new_error (volume, callback, user_data, in g_volume_eject_with_operation()
513 * message for volume objects that in g_volume_eject_with_operation()
515 _("volume doesn’t implement eject or eject_with_operation")); in g_volume_eject_with_operation()
519 if (iface->eject_with_operation != NULL) in g_volume_eject_with_operation()
520 …(* iface->eject_with_operation) (volume, flags, mount_operation, cancellable, callback, user_data); in g_volume_eject_with_operation()
522 (* iface->eject) (volume, flags, cancellable, callback, user_data); in g_volume_eject_with_operation()
527 * @volume: a #GVolume
531 * Finishes ejecting a volume. If any errors occurred during the operation,
534 * Returns: %TRUE if the volume was successfully ejected. %FALSE otherwise
539 g_volume_eject_with_operation_finish (GVolume *volume, in g_volume_eject_with_operation_finish() argument
545 g_return_val_if_fail (G_IS_VOLUME (volume), FALSE); in g_volume_eject_with_operation_finish()
553 iface = G_VOLUME_GET_IFACE (volume); in g_volume_eject_with_operation_finish()
554 if (iface->eject_with_operation_finish != NULL) in g_volume_eject_with_operation_finish()
555 return (* iface->eject_with_operation_finish) (volume, result, error); in g_volume_eject_with_operation_finish()
557 return (* iface->eject_finish) (volume, result, error); in g_volume_eject_with_operation_finish()
562 * @volume: a #GVolume
565 * Gets the identifier of the given kind for @volume.
566 * See the [introduction][volume-identifier] for more
567 * information about volume identifiers.
574 g_volume_get_identifier (GVolume *volume, in g_volume_get_identifier() argument
579 g_return_val_if_fail (G_IS_VOLUME (volume), NULL); in g_volume_get_identifier()
582 iface = G_VOLUME_GET_IFACE (volume); in g_volume_get_identifier()
584 if (iface->get_identifier == NULL) in g_volume_get_identifier()
587 return (* iface->get_identifier) (volume, kind); in g_volume_get_identifier()
592 * @volume: a #GVolume
594 * Gets the kinds of [identifiers][volume-identifier] that @volume has.
597 * Returns: (array zero-terminated=1) (transfer full): a %NULL-terminated array
601 g_volume_enumerate_identifiers (GVolume *volume) in g_volume_enumerate_identifiers() argument
605 g_return_val_if_fail (G_IS_VOLUME (volume), NULL); in g_volume_enumerate_identifiers()
606 iface = G_VOLUME_GET_IFACE (volume); in g_volume_enumerate_identifiers()
608 if (iface->enumerate_identifiers == NULL) in g_volume_enumerate_identifiers()
611 return (* iface->enumerate_identifiers) (volume); in g_volume_enumerate_identifiers()
616 * @volume: a #GVolume
619 * mount time. Returns %NULL otherwise. If not %NULL and if @volume
625 * |[<!-- language="C" -->
630 * mount = g_volume_get_mount (volume); // mounted, so never NULL
632 * volume_activation_root = g_volume_get_activation_root (volume); // assume not NULL
635 * |[<!-- language="C" -->
645 * Returns: (nullable) (transfer full): the activation root of @volume
651 g_volume_get_activation_root (GVolume *volume) in g_volume_get_activation_root() argument
655 g_return_val_if_fail (G_IS_VOLUME (volume), NULL); in g_volume_get_activation_root()
656 iface = G_VOLUME_GET_IFACE (volume); in g_volume_get_activation_root()
658 if (iface->get_activation_root == NULL) in g_volume_get_activation_root()
661 return (* iface->get_activation_root) (volume); in g_volume_get_activation_root()
666 * @volume: a #GVolume
668 * Gets the sort key for @volume, if any.
670 * Returns: (nullable): Sorting key for @volume or %NULL if no such key is available
675 g_volume_get_sort_key (GVolume *volume) in g_volume_get_sort_key() argument
680 g_return_val_if_fail (G_IS_VOLUME (volume), NULL); in g_volume_get_sort_key()
682 iface = G_VOLUME_GET_IFACE (volume); in g_volume_get_sort_key()
683 if (iface->get_sort_key != NULL) in g_volume_get_sort_key()
684 ret = iface->get_sort_key (volume); in g_volume_get_sort_key()