GDrive

GDrive

Synopsis




                    GDrive;
                    GDriveIface;
char*               g_drive_get_name                    (GDrive *drive);
GIcon*              g_drive_get_icon                    (GDrive *drive);
gboolean            g_drive_has_volumes                 (GDrive *drive);
GList*              g_drive_get_volumes                 (GDrive *drive);
gboolean            g_drive_is_automounted              (GDrive *drive);
gboolean            g_drive_can_mount                   (GDrive *drive);
gboolean            g_drive_can_eject                   (GDrive *drive);
void                g_drive_mount                       (GDrive *drive,
                                                         GMountOperation *mount_operation,
                                                         GCancellable *cancellable,
                                                         GAsyncReadyCallback callback,
                                                         gpointer user_data);
gboolean            g_drive_mount_finish                (GDrive *drive,
                                                         GAsyncResult *result,
                                                         GError **error);
void                g_drive_eject                       (GDrive *drive,
                                                         GCancellable *cancellable,
                                                         GAsyncReadyCallback callback,
                                                         gpointer user_data);
gboolean            g_drive_eject_finish                (GDrive *drive,
                                                         GAsyncResult *result,
                                                         GError **error);


Object Hierarchy


  GInterface
   +----GDrive

Prerequisites

GDrive requires GObject.

Signals


  "changed"                                        : Run Last

Description

Details

GDrive

typedef struct _GDrive GDrive;


GDriveIface

typedef struct {
  GTypeInterface g_iface;

  /* signals */
  void (*changed)            (GVolume *volume);
  
  /* Virtual Table */
  
  char *   (*get_name)    (GDrive         *drive);
  GIcon *  (*get_icon)    (GDrive         *drive);
  gboolean (*has_volumes) (GDrive         *drive);
  GList *  (*get_volumes) (GDrive         *drive);
  gboolean (*is_automounted)(GDrive       *drive);
  gboolean (*can_mount)   (GDrive         *drive);
  gboolean (*can_eject)   (GDrive         *drive);
  void     (*mount)       (GDrive         *drive,
			   GMountOperation *mount_operation,
			   GCancellable   *cancellable,
			   GAsyncReadyCallback callback,
			   gpointer        user_data);
  gboolean (*mount_finish)(GDrive         *drive,
			   GAsyncResult   *result,
			   GError        **error);
  void     (*eject)       (GDrive         *drive,
			   GCancellable   *cancellable,
			   GAsyncReadyCallback callback,
			   gpointer        user_data);
  gboolean (*eject_finish)(GDrive         *drive,
			   GAsyncResult   *result,
			   GError        **error);
} GDriveIface;


g_drive_get_name ()

char*               g_drive_get_name                    (GDrive *drive);

drive :

a GDrive.

Returns :

string containing drive's name. The returned string should be freed when no longer needed

g_drive_get_icon ()

GIcon*              g_drive_get_icon                    (GDrive *drive);

Gets the icon for drive.

drive :

a GDrive.

Returns :

GIcon for the drive.

g_drive_has_volumes ()

gboolean            g_drive_has_volumes                 (GDrive *drive);

drive :

a GDrive.

Returns :

TRUE if drive contains volumes, FALSE otherwise.

g_drive_get_volumes ()

GList*              g_drive_get_volumes                 (GDrive *drive);

drive :

a GDrive.

Returns :

GList containing any GVolume s on the given drive. NOTE: Fact-check this.

g_drive_is_automounted ()

gboolean            g_drive_is_automounted              (GDrive *drive);

drive :

a GDrive.

Returns :

TRUE if the drive was automounted. FALSE otherwise.

g_drive_can_mount ()

gboolean            g_drive_can_mount                   (GDrive *drive);

drive :

a GDrive.

Returns :

TRUE if the drive can be mounted. FALSE otherwise.

g_drive_can_eject ()

gboolean            g_drive_can_eject                   (GDrive *drive);

drive :

pointer to a GDrive.

Returns :

TRUE if the drive can be ejected. FALSE otherwise.

g_drive_mount ()

void                g_drive_mount                       (GDrive *drive,
                                                         GMountOperation *mount_operation,
                                                         GCancellable *cancellable,
                                                         GAsyncReadyCallback callback,
                                                         gpointer user_data);

drive :

a GDrive.

mount_operation :

a GMountOperation.

cancellable :

callback :

a GAsyncReadyCallback.

user_data :

a gpointer.

g_drive_mount_finish ()

gboolean            g_drive_mount_finish                (GDrive *drive,
                                                         GAsyncResult *result,
                                                         GError **error);

drive :

pointer to a GDrive.

result :

a GAsyncResult.

error :

a GError.

Returns :

TRUE, FALSE if operation failed.

g_drive_eject ()

void                g_drive_eject                       (GDrive *drive,
                                                         GCancellable *cancellable,
                                                         GAsyncReadyCallback callback,
                                                         gpointer user_data);

drive :

a GDrive.

cancellable :

callback :

a GAsyncReadyCallback.

user_data :

a gpointer.

g_drive_eject_finish ()

gboolean            g_drive_eject_finish                (GDrive *drive,
                                                         GAsyncResult *result,
                                                         GError **error);

drive :

a GDrive.

result :

a GAsyncResult.

error :

a GError.

Returns :

TRUE if the drive has been ejected successfully, FALSE otherwise.

Signal Details

The "changed" signal

void                user_function                      (GDrive  *gdrive,
                                                        gpointer user_data)      : Run Last

gdrive :

the object which received the signal.

user_data :

user data set when the signal handler was connected.