Interface

Gio-2.0GioVolumeInterface

Interface for implementing Volume. Contains only the virtual methods that need to be implemented.

interface Interface {
    vfunc_can_eject(): boolean;
    vfunc_can_mount(): boolean;
    vfunc_changed(): void;
    vfunc_eject(
        flags: Gio.MountUnmountFlags,
        cancellable?: Gio.Cancellable,
        callback?: AsyncReadyCallback<Gio.Volume.Interface>,
    ): void;
    vfunc_eject_finish(result: Gio.AsyncResult): boolean;
    vfunc_eject_with_operation(
        flags: Gio.MountUnmountFlags,
        mount_operation?: Gio.MountOperation,
        cancellable?: Gio.Cancellable,
        callback?: AsyncReadyCallback<Gio.Volume.Interface>,
    ): void;
    vfunc_eject_with_operation_finish(result: Gio.AsyncResult): boolean;
    vfunc_enumerate_identifiers(): string[];
    vfunc_get_activation_root(): Gio.File;
    vfunc_get_drive(): Gio.Drive;
    vfunc_get_icon(): Gio.Icon;
    vfunc_get_identifier(kind: string): string;
    vfunc_get_mount(): Gio.Mount;
    vfunc_get_name(): string;
    vfunc_get_sort_key(): string;
    vfunc_get_symbolic_icon(): Gio.Icon;
    vfunc_get_uuid(): string;
    vfunc_mount_finish(result: Gio.AsyncResult): boolean;
    vfunc_mount_fn(
        flags: NONE,
        mount_operation?: Gio.MountOperation,
        cancellable?: Gio.Cancellable,
        callback?: AsyncReadyCallback<Gio.Volume.Interface>,
    ): void;
    vfunc_removed(): void;
    vfunc_should_automount(): boolean;
}

Hierarchy (View Summary)

Index

Methods

  • Changed signal that is emitted when the volume's state has changed.

    Returns void

  • Gets the kinds of identifiers that volume has. Use g_volume_get_identifier() to obtain the identifiers themselves.

    Returns string[]

  • Gets the activation root for a Gio.Volume if it is known ahead of mount time. Returns null otherwise. If not null and if volume is mounted, then the result of g_mount_get_root() on the Gio.Mount object obtained from g_volume_get_mount() will always either be equal or a prefix of what this function returns. In other words, in code

      GMount *mount;
    GFile *mount_root
    GFile *volume_activation_root;

    mount = g_volume_get_mount (volume); // mounted, so never NULL
    mount_root = g_mount_get_root (mount);
    volume_activation_root = g_volume_get_activation_root (volume); // assume not NULL

    then the expression

      (g_file_has_prefix (volume_activation_root, mount_root) ||
    g_file_equal (volume_activation_root, mount_root))

    will always be true.

    Activation roots are typically used in Gio.VolumeMonitor implementations to find the underlying mount to shadow, see g_mount_is_shadowed() for more details.

    Returns Gio.File

  • Gets the identifier of the given kind for volume. See the introduction for more information about volume identifiers.

    Parameters

    • kind: string

      the kind of identifier to return

    Returns string

  • Gets the UUID for the volume. The reference is typically based on the file system UUID for the volume in question and should be considered an opaque string. Returns null if there is no UUID available.

    Returns string

  • Finishes mounting a volume. If any errors occurred during the operation, error will be set to contain the errors and false will be returned.

    If the mount operation succeeded, g_volume_get_mount() on volume is guaranteed to return the mount right after calling this function; there's no need to listen for the 'mount-added' signal on Gio.VolumeMonitor.

    Parameters

    Returns boolean

  • The removed signal that is emitted when the Gio.Volume have been removed. If the recipient is holding references to the object they should release them so the object can be finalized.

    Returns void

  • Returns whether the volume should be automatically mounted.

    Returns boolean