<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" 
               "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
<!ENTITY version SYSTEM "version.xml">
]>
<refentry id="GDrive">
<refmeta>
<refentrytitle role="top_of_page" id="GDrive.top_of_page">GDrive</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GIO Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>GDrive</refname>
<refpurpose>Drive management</refpurpose>
</refnamediv>

<refsynopsisdiv id="GDrive.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>

#include &lt;gio/gio.h&gt;

                    <link linkend="GDrive-struct">GDrive</link>;
                    <link linkend="GDriveIface">GDriveIface</link>;
enum                <link linkend="GDriveStartFlags">GDriveStartFlags</link>;
enum                <link linkend="GDriveStartStopType">GDriveStartStopType</link>;
<link linkend="char">char</link> *              <link linkend="g-drive-get-name">g_drive_get_name</link>                    (<link linkend="GDrive">GDrive</link> *drive);
<link linkend="GIcon">GIcon</link> *             <link linkend="g-drive-get-icon">g_drive_get_icon</link>                    (<link linkend="GDrive">GDrive</link> *drive);
<link linkend="gboolean">gboolean</link>            <link linkend="g-drive-has-volumes">g_drive_has_volumes</link>                 (<link linkend="GDrive">GDrive</link> *drive);
<link linkend="GList">GList</link> *             <link linkend="g-drive-get-volumes">g_drive_get_volumes</link>                 (<link linkend="GDrive">GDrive</link> *drive);
<link linkend="gboolean">gboolean</link>            <link linkend="g-drive-can-eject">g_drive_can_eject</link>                   (<link linkend="GDrive">GDrive</link> *drive);
<link linkend="GDriveStartStopType">GDriveStartStopType</link>  <link linkend="g-drive-get-start-stop-type">g_drive_get_start_stop_type</link>        (<link linkend="GDrive">GDrive</link> *drive);
<link linkend="gboolean">gboolean</link>            <link linkend="g-drive-can-start">g_drive_can_start</link>                   (<link linkend="GDrive">GDrive</link> *drive);
<link linkend="gboolean">gboolean</link>            <link linkend="g-drive-can-start-degraded">g_drive_can_start_degraded</link>          (<link linkend="GDrive">GDrive</link> *drive);
<link linkend="gboolean">gboolean</link>            <link linkend="g-drive-can-stop">g_drive_can_stop</link>                    (<link linkend="GDrive">GDrive</link> *drive);
<link linkend="gboolean">gboolean</link>            <link linkend="g-drive-can-poll-for-media">g_drive_can_poll_for_media</link>          (<link linkend="GDrive">GDrive</link> *drive);
<link linkend="void">void</link>                <link linkend="g-drive-poll-for-media">g_drive_poll_for_media</link>              (<link linkend="GDrive">GDrive</link> *drive,
                                                         <link linkend="GCancellable">GCancellable</link> *cancellable,
                                                         <link linkend="GAsyncReadyCallback">GAsyncReadyCallback</link> callback,
                                                         <link linkend="gpointer">gpointer</link> user_data);
<link linkend="gboolean">gboolean</link>            <link linkend="g-drive-poll-for-media-finish">g_drive_poll_for_media_finish</link>       (<link linkend="GDrive">GDrive</link> *drive,
                                                         <link linkend="GAsyncResult">GAsyncResult</link> *result,
                                                         <link linkend="GError">GError</link> **error);
<link linkend="gboolean">gboolean</link>            <link linkend="g-drive-has-media">g_drive_has_media</link>                   (<link linkend="GDrive">GDrive</link> *drive);
<link linkend="gboolean">gboolean</link>            <link linkend="g-drive-is-media-check-automatic">g_drive_is_media_check_automatic</link>    (<link linkend="GDrive">GDrive</link> *drive);
<link linkend="gboolean">gboolean</link>            <link linkend="g-drive-is-media-removable">g_drive_is_media_removable</link>          (<link linkend="GDrive">GDrive</link> *drive);
<link linkend="void">void</link>                <link linkend="g-drive-eject">g_drive_eject</link>                       (<link linkend="GDrive">GDrive</link> *drive,
                                                         <link linkend="GMountUnmountFlags">GMountUnmountFlags</link> flags,
                                                         <link linkend="GCancellable">GCancellable</link> *cancellable,
                                                         <link linkend="GAsyncReadyCallback">GAsyncReadyCallback</link> callback,
                                                         <link linkend="gpointer">gpointer</link> user_data);
<link linkend="gboolean">gboolean</link>            <link linkend="g-drive-eject-finish">g_drive_eject_finish</link>                (<link linkend="GDrive">GDrive</link> *drive,
                                                         <link linkend="GAsyncResult">GAsyncResult</link> *result,
                                                         <link linkend="GError">GError</link> **error);
<link linkend="void">void</link>                <link linkend="g-drive-eject-with-operation">g_drive_eject_with_operation</link>        (<link linkend="GDrive">GDrive</link> *drive,
                                                         <link linkend="GMountUnmountFlags">GMountUnmountFlags</link> flags,
                                                         <link linkend="GMountOperation">GMountOperation</link> *mount_operation,
                                                         <link linkend="GCancellable">GCancellable</link> *cancellable,
                                                         <link linkend="GAsyncReadyCallback">GAsyncReadyCallback</link> callback,
                                                         <link linkend="gpointer">gpointer</link> user_data);
<link linkend="gboolean">gboolean</link>            <link linkend="g-drive-eject-with-operation-finish">g_drive_eject_with_operation_finish</link> (<link linkend="GDrive">GDrive</link> *drive,
                                                         <link linkend="GAsyncResult">GAsyncResult</link> *result,
                                                         <link linkend="GError">GError</link> **error);
<link linkend="void">void</link>                <link linkend="g-drive-start">g_drive_start</link>                       (<link linkend="GDrive">GDrive</link> *drive,
                                                         <link linkend="GDriveStartFlags">GDriveStartFlags</link> flags,
                                                         <link linkend="GMountOperation">GMountOperation</link> *mount_operation,
                                                         <link linkend="GCancellable">GCancellable</link> *cancellable,
                                                         <link linkend="GAsyncReadyCallback">GAsyncReadyCallback</link> callback,
                                                         <link linkend="gpointer">gpointer</link> user_data);
<link linkend="gboolean">gboolean</link>            <link linkend="g-drive-start-finish">g_drive_start_finish</link>                (<link linkend="GDrive">GDrive</link> *drive,
                                                         <link linkend="GAsyncResult">GAsyncResult</link> *result,
                                                         <link linkend="GError">GError</link> **error);
<link linkend="void">void</link>                <link linkend="g-drive-stop">g_drive_stop</link>                        (<link linkend="GDrive">GDrive</link> *drive,
                                                         <link linkend="GMountUnmountFlags">GMountUnmountFlags</link> flags,
                                                         <link linkend="GMountOperation">GMountOperation</link> *mount_operation,
                                                         <link linkend="GCancellable">GCancellable</link> *cancellable,
                                                         <link linkend="GAsyncReadyCallback">GAsyncReadyCallback</link> callback,
                                                         <link linkend="gpointer">gpointer</link> user_data);
<link linkend="gboolean">gboolean</link>            <link linkend="g-drive-stop-finish">g_drive_stop_finish</link>                 (<link linkend="GDrive">GDrive</link> *drive,
                                                         <link linkend="GAsyncResult">GAsyncResult</link> *result,
                                                         <link linkend="GError">GError</link> **error);
<link linkend="char">char</link> **             <link linkend="g-drive-enumerate-identifiers">g_drive_enumerate_identifiers</link>       (<link linkend="GDrive">GDrive</link> *drive);
<link linkend="char">char</link> *              <link linkend="g-drive-get-identifier">g_drive_get_identifier</link>              (<link linkend="GDrive">GDrive</link> *drive,
                                                         const <link linkend="char">char</link> *kind);
</synopsis>
</refsynopsisdiv>

<refsect1 id="GDrive.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<synopsis>
  <link linkend="GInterface">GInterface</link>
   +----GDrive
</synopsis>
</refsect1>

<refsect1 id="GDrive.prerequisites" role="prerequisites">
<title role="prerequisites.title">Prerequisites</title>
<para>
GDrive requires
 <link linkend="GObject">GObject</link>.</para>
</refsect1>





<refsect1 id="GDrive.signals" role="signal_proto">
<title role="signal_proto.title">Signals</title>
<synopsis>
  &quot;<link linkend="GDrive-changed">changed</link>&quot;                                        : Run Last
  &quot;<link linkend="GDrive-disconnected">disconnected</link>&quot;                                   : Run Last
  &quot;<link linkend="GDrive-eject-button">eject-button</link>&quot;                                   : Run Last
  &quot;<link linkend="GDrive-stop-button">stop-button</link>&quot;                                    : Run Last
</synopsis>
</refsect1>


<refsect1 id="GDrive.description" role="desc">
<title role="desc.title">Description</title>
<para>
<link linkend="GDrive"><type>GDrive</type></link> - this represent a piece of hardware connected to the machine.
It's generally only created for removable hardware or hardware with
removable media.
</para>
<para>
<link linkend="GDrive"><type>GDrive</type></link> is a container class for <link linkend="GVolume"><type>GVolume</type></link> objects that stem from
the same piece of media. As such, <link linkend="GDrive"><type>GDrive</type></link> abstracts a drive with
(or without) removable media and provides operations for querying
whether media is available, determing whether media change is
automatically detected and ejecting the media.
</para>
<para>
If the <link linkend="GDrive"><type>GDrive</type></link> reports that media isn't automatically detected, one
can poll for media; typically one should not do this periodically
as a poll for media operation is potententially expensive and may
spin up the drive creating noise.
</para>
<para>
<link linkend="GDrive"><type>GDrive</type></link> supports starting and stopping drives with authentication
support for the former. This can be used to support a diverse set
of use cases including connecting/disconnecting iSCSI devices,
powering down external disk enclosures and starting/stopping
multi-disk devices such as RAID devices. Note that the actual
semantics and side-effects of starting/stopping a <link linkend="GDrive"><type>GDrive</type></link> may vary
according to implementation. To choose the correct verbs in e.g. a
file manager, use <link linkend="g-drive-get-start-stop-type"><function>g_drive_get_start_stop_type()</function></link>.
</para>
<para>
For porting from GnomeVFS note that there is no equivalent of
<link linkend="GDrive"><type>GDrive</type></link> in that API.</para>
<para>
</para>
</refsect1>

<refsect1 id="GDrive.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="GDrive-struct" role="struct">
<title>GDrive</title>
<indexterm zone="GDrive-struct"><primary sortas="Drive">GDrive</primary></indexterm><programlisting>typedef struct _GDrive GDrive;</programlisting>
<para>
Opaque drive object.</para>
<para>
</para></refsect2>
<refsect2 id="GDriveIface" role="struct">
<title>GDriveIface</title>
<indexterm zone="GDriveIface"><primary sortas="DriveIface">GDriveIface</primary></indexterm><programlisting>typedef struct {
  GTypeInterface g_iface;

  /* signals */
  void     (* changed)                  (GDrive              *drive);
  void     (* disconnected)             (GDrive              *drive);
  void     (* eject_button)             (GDrive              *drive);

  /* Virtual Table */
  char *   (* get_name)                 (GDrive              *drive);
  GIcon *  (* get_icon)                 (GDrive              *drive);
  gboolean (* has_volumes)              (GDrive              *drive);
  GList *  (* get_volumes)              (GDrive              *drive);
  gboolean (* is_media_removable)       (GDrive              *drive);
  gboolean (* has_media)                (GDrive              *drive);
  gboolean (* is_media_check_automatic) (GDrive              *drive);
  gboolean (* can_eject)                (GDrive              *drive);
  gboolean (* can_poll_for_media)       (GDrive              *drive);
  void     (* eject)                    (GDrive              *drive,
                                         GMountUnmountFlags   flags,
                                         GCancellable        *cancellable,
                                         GAsyncReadyCallback  callback,
                                         gpointer             user_data);
  gboolean (* eject_finish)             (GDrive              *drive,
                                         GAsyncResult        *result,
                                         GError             **error);
  void     (* poll_for_media)           (GDrive              *drive,
                                         GCancellable        *cancellable,
                                         GAsyncReadyCallback  callback,
                                         gpointer             user_data);
  gboolean (* poll_for_media_finish)    (GDrive              *drive,
                                         GAsyncResult        *result,
                                         GError             **error);

  char *   (* get_identifier)           (GDrive              *drive,
                                         const char          *kind);
  char **  (* enumerate_identifiers)    (GDrive              *drive);

  GDriveStartStopType (* get_start_stop_type) (GDrive        *drive);

  gboolean (* can_start)                (GDrive              *drive);
  gboolean (* can_start_degraded)       (GDrive              *drive);
  void     (* start)                    (GDrive              *drive,
                                         GDriveStartFlags     flags,
                                         GMountOperation     *mount_operation,
                                         GCancellable        *cancellable,
                                         GAsyncReadyCallback  callback,
                                         gpointer             user_data);
  gboolean (* start_finish)             (GDrive              *drive,
                                         GAsyncResult        *result,
                                         GError             **error);

  gboolean (* can_stop)                 (GDrive              *drive);
  void     (* stop)                     (GDrive              *drive,
                                         GMountUnmountFlags   flags,
                                         GMountOperation     *mount_operation,
                                         GCancellable        *cancellable,
                                         GAsyncReadyCallback  callback,
                                         gpointer             user_data);
  gboolean (* stop_finish)              (GDrive              *drive,
                                         GAsyncResult        *result,
                                         GError             **error);
  /* signal, not VFunc */
  void     (* stop_button)              (GDrive              *drive);

  void        (* eject_with_operation)      (GDrive              *drive,
                                             GMountUnmountFlags   flags,
                                             GMountOperation     *mount_operation,
                                             GCancellable        *cancellable,
                                             GAsyncReadyCallback  callback,
                                             gpointer             user_data);
  gboolean    (* eject_with_operation_finish) (GDrive            *drive,
                                             GAsyncResult        *result,
                                             GError             **error);
} GDriveIface;
</programlisting>
<para>
Interface for creating <link linkend="GDrive"><type>GDrive</type></link> implementations.</para>
<para>
</para><variablelist role="struct">
<varlistentry>
<term><link linkend="GTypeInterface">GTypeInterface</link>&#160;<structfield>g_iface</structfield>;</term>
<listitem><simpara> The parent interface.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>changed</structfield>&#160;()</term>
<listitem><simpara> Signal emitted when the drive is changed.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>disconnected</structfield>&#160;()</term>
<listitem><simpara> The removed signal that is emitted when the <link linkend="GDrive"><type>GDrive</type></link> have been disconnected. If the recipient is holding references to the object they should release them so the object can be finalized.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>eject_button</structfield>&#160;()</term>
<listitem><simpara> Signal emitted when the physical eject button (if any) of a drive have been pressed.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>get_name</structfield>&#160;()</term>
<listitem><simpara> Returns the name for the given <link linkend="GDrive"><type>GDrive</type></link>.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>get_icon</structfield>&#160;()</term>
<listitem><simpara> Returns a <link linkend="GIcon"><type>GIcon</type></link> for the given <link linkend="GDrive"><type>GDrive</type></link>.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>has_volumes</structfield>&#160;()</term>
<listitem><simpara> Returns <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the <link linkend="GDrive"><type>GDrive</type></link> has mountable volumes.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>get_volumes</structfield>&#160;()</term>
<listitem><simpara> Returns a list <link linkend="GList"><type>GList</type></link> of <link linkend="GVolume"><type>GVolume</type></link> for the <link linkend="GDrive"><type>GDrive</type></link>.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>is_media_removable</structfield>&#160;()</term>
<listitem><simpara> Returns <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the <link linkend="GDrive"><type>GDrive</type></link> supports removal and insertion of media.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>has_media</structfield>&#160;()</term>
<listitem><simpara> Returns <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the <link linkend="GDrive"><type>GDrive</type></link> has media inserted.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>is_media_check_automatic</structfield>&#160;()</term>
<listitem><simpara> Returns <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the <link linkend="GDrive"><type>GDrive</type></link> is capabable of automatically detecting media changes.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>can_eject</structfield>&#160;()</term>
<listitem><simpara> Returns <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the <link linkend="GDrive"><type>GDrive</type></link> can eject media.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>can_poll_for_media</structfield>&#160;()</term>
<listitem><simpara> Returns <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the <link linkend="GDrive"><type>GDrive</type></link> is capable of manually polling for media change.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>eject</structfield>&#160;()</term>
<listitem><simpara> Ejects a <link linkend="GDrive"><type>GDrive</type></link>.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>eject_finish</structfield>&#160;()</term>
<listitem><simpara> Finishes an eject operation.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>poll_for_media</structfield>&#160;()</term>
<listitem><simpara> Poll for media insertion/removal on a <link linkend="GDrive"><type>GDrive</type></link>.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>poll_for_media_finish</structfield>&#160;()</term>
<listitem><simpara> Finishes a media poll operation.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>get_identifier</structfield>&#160;()</term>
<listitem><simpara> Returns the identifier of the given kind, or <link linkend="NULL--CAPS"><literal>NULL</literal></link> if
   the <link linkend="GDrive"><type>GDrive</type></link> doesn't have one.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>enumerate_identifiers</structfield>&#160;()</term>
<listitem><simpara> Returns an array strings listing the kinds
   of identifiers which the <link linkend="GDrive"><type>GDrive</type></link> has.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>get_start_stop_type</structfield>&#160;()</term>
<listitem><simpara> Gets a <link linkend="GDriveStartStopType"><type>GDriveStartStopType</type></link> with details about starting/stopping the drive. Since 2.22.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>can_start</structfield>&#160;()</term>
<listitem><simpara> Returns <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if a <link linkend="GDrive"><type>GDrive</type></link> can be started. Since 2.22.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>can_start_degraded</structfield>&#160;()</term>
<listitem><simpara> Returns <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if a <link linkend="GDrive"><type>GDrive</type></link> can be started degraded. Since 2.22.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>start</structfield>&#160;()</term>
<listitem><simpara> Starts a <link linkend="GDrive"><type>GDrive</type></link>. Since 2.22.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>start_finish</structfield>&#160;()</term>
<listitem><simpara> Finishes a start operation. Since 2.22.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>can_stop</structfield>&#160;()</term>
<listitem><simpara> Returns <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if a <link linkend="GDrive"><type>GDrive</type></link> can be stopped. Since 2.22.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>stop</structfield>&#160;()</term>
<listitem><simpara> Stops a <link linkend="GDrive"><type>GDrive</type></link>. Since 2.22.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>stop_finish</structfield>&#160;()</term>
<listitem><simpara> Finishes a stop operation. Since 2.22.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>stop_button</structfield>&#160;()</term>
<listitem><simpara> Signal emitted when the physical stop button (if any) of a drive have been pressed. Since 2.22.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>eject_with_operation</structfield>&#160;()</term>
<listitem><simpara> Starts ejecting a <link linkend="GDrive"><type>GDrive</type></link> using a <link linkend="GMountOperation"><type>GMountOperation</type></link>. Since 2.22.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>eject_with_operation_finish</structfield>&#160;()</term>
<listitem><simpara> Finishes an eject operation using a <link linkend="GMountOperation"><type>GMountOperation</type></link>. Since 2.22.
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="GDriveStartFlags" role="enum" condition="since:2.22">
<title>enum GDriveStartFlags</title>
<indexterm zone="GDriveStartFlags" role="2.22"><primary sortas="DriveStartFlags">GDriveStartFlags</primary></indexterm><programlisting>typedef enum {
  G_DRIVE_START_NONE = 0
} GDriveStartFlags;
</programlisting>
<para>
Flags used when starting a drive.</para>
<para>
</para><variablelist role="enum">
<varlistentry id="G-DRIVE-START-NONE--CAPS" role="constant">
<term><literal>G_DRIVE_START_NONE</literal></term>
<listitem><simpara> No flags set.
</simpara></listitem>
</varlistentry>
</variablelist><para role="since">Since 2.22</para></refsect2>
<refsect2 id="GDriveStartStopType" role="enum" condition="since:2.22">
<title>enum GDriveStartStopType</title>
<indexterm zone="GDriveStartStopType" role="2.22"><primary sortas="DriveStartStopType">GDriveStartStopType</primary></indexterm><programlisting>typedef enum {
  G_DRIVE_START_STOP_TYPE_UNKNOWN,
  G_DRIVE_START_STOP_TYPE_SHUTDOWN,
  G_DRIVE_START_STOP_TYPE_NETWORK,
  G_DRIVE_START_STOP_TYPE_MULTIDISK,
  G_DRIVE_START_STOP_TYPE_PASSWORD
} GDriveStartStopType;
</programlisting>
<para>
Enumeration describing how a drive can be started/stopped.</para>
<para>
</para><variablelist role="enum">
<varlistentry id="G-DRIVE-START-STOP-TYPE-UNKNOWN--CAPS" role="constant">
<term><literal>G_DRIVE_START_STOP_TYPE_UNKNOWN</literal></term>
<listitem><simpara> Unknown or drive doesn't support
   start/stop.
</simpara></listitem>
</varlistentry>
<varlistentry id="G-DRIVE-START-STOP-TYPE-SHUTDOWN--CAPS" role="constant">
<term><literal>G_DRIVE_START_STOP_TYPE_SHUTDOWN</literal></term>
<listitem><simpara> The stop method will physically
   shut down the drive and e.g. power down the port the drive is
   attached to.
</simpara></listitem>
</varlistentry>
<varlistentry id="G-DRIVE-START-STOP-TYPE-NETWORK--CAPS" role="constant">
<term><literal>G_DRIVE_START_STOP_TYPE_NETWORK</literal></term>
<listitem><simpara> The start/stop methods are used
   for connecting/disconnect to the drive over the network.
</simpara></listitem>
</varlistentry>
<varlistentry id="G-DRIVE-START-STOP-TYPE-MULTIDISK--CAPS" role="constant">
<term><literal>G_DRIVE_START_STOP_TYPE_MULTIDISK</literal></term>
<listitem><simpara> The start/stop methods will
   assemble/disassemble a virtual drive from several physical
   drives.
</simpara></listitem>
</varlistentry>
<varlistentry id="G-DRIVE-START-STOP-TYPE-PASSWORD--CAPS" role="constant">
<term><literal>G_DRIVE_START_STOP_TYPE_PASSWORD</literal></term>
<listitem><simpara> The start/stop methods will
   unlock/lock the disk (for example using the ATA <quote>SECURITY
   UNLOCK DEVICE</quote> command)
</simpara></listitem>
</varlistentry>
</variablelist><para role="since">Since 2.22</para></refsect2>
<refsect2 id="g-drive-get-name" role="function">
<title>g_drive_get_name ()</title>
<indexterm zone="g-drive-get-name"><primary sortas="drive_get_name">g_drive_get_name</primary></indexterm><programlisting><link linkend="char">char</link> *              g_drive_get_name                    (<link linkend="GDrive">GDrive</link> *drive);</programlisting>
<para>
Gets the name of <parameter>drive</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>drive</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GDrive"><type>GDrive</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a string containing <parameter>drive</parameter>'s name. The returned 
    string should be freed when no longer needed.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-drive-get-icon" role="function">
<title>g_drive_get_icon ()</title>
<indexterm zone="g-drive-get-icon"><primary sortas="drive_get_icon">g_drive_get_icon</primary></indexterm><programlisting><link linkend="GIcon">GIcon</link> *             g_drive_get_icon                    (<link linkend="GDrive">GDrive</link> *drive);</programlisting>
<para>
Gets the icon for <parameter>drive</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>drive</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GDrive"><type>GDrive</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="GIcon"><type>GIcon</type></link> for the <parameter>drive</parameter>.
   Free the returned object with <link linkend="g-object-unref"><function>g_object_unref()</function></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-drive-has-volumes" role="function">
<title>g_drive_has_volumes ()</title>
<indexterm zone="g-drive-has-volumes"><primary sortas="drive_has_volumes">g_drive_has_volumes</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            g_drive_has_volumes                 (<link linkend="GDrive">GDrive</link> *drive);</programlisting>
<para>
Check if <parameter>drive</parameter> has any mountable volumes.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>drive</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GDrive"><type>GDrive</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the <parameter>drive</parameter> contains volumes, <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> otherwise.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-drive-get-volumes" role="function">
<title>g_drive_get_volumes ()</title>
<indexterm zone="g-drive-get-volumes"><primary sortas="drive_get_volumes">g_drive_get_volumes</primary></indexterm><programlisting><link linkend="GList">GList</link> *             g_drive_get_volumes                 (<link linkend="GDrive">GDrive</link> *drive);</programlisting>
<para>
Get a list of mountable volumes for <parameter>drive</parameter>.
</para>
<para>
The returned list should be freed with <link linkend="g-list-free"><function>g_list_free()</function></link>, after
its elements have been unreffed with <link linkend="g-object-unref"><function>g_object_unref()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>drive</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GDrive"><type>GDrive</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="GList"><type>GList</type></link> containing any <link linkend="GVolume"><type>GVolume</type></link> objects on the given <parameter>drive</parameter>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-drive-can-eject" role="function">
<title>g_drive_can_eject ()</title>
<indexterm zone="g-drive-can-eject"><primary sortas="drive_can_eject">g_drive_can_eject</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            g_drive_can_eject                   (<link linkend="GDrive">GDrive</link> *drive);</programlisting>
<para>
Checks if a drive can be ejected.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>drive</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GDrive"><type>GDrive</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the <parameter>drive</parameter> can be ejected, <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> otherwise.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-drive-get-start-stop-type" role="function" condition="since:2.22">
<title>g_drive_get_start_stop_type ()</title>
<indexterm zone="g-drive-get-start-stop-type" role="2.22"><primary sortas="drive_get_start_stop_type">g_drive_get_start_stop_type</primary></indexterm><programlisting><link linkend="GDriveStartStopType">GDriveStartStopType</link>  g_drive_get_start_stop_type        (<link linkend="GDrive">GDrive</link> *drive);</programlisting>
<para>
Gets a hint about how a drive can be started/stopped.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>drive</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GDrive"><type>GDrive</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> A value from the <link linkend="GDriveStartStopType"><type>GDriveStartStopType</type></link> enumeration.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.22</para></refsect2>
<refsect2 id="g-drive-can-start" role="function" condition="since:2.22">
<title>g_drive_can_start ()</title>
<indexterm zone="g-drive-can-start" role="2.22"><primary sortas="drive_can_start">g_drive_can_start</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            g_drive_can_start                   (<link linkend="GDrive">GDrive</link> *drive);</programlisting>
<para>
Checks if a drive can be started.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>drive</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GDrive"><type>GDrive</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the <parameter>drive</parameter> can be started, <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> otherwise.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.22</para></refsect2>
<refsect2 id="g-drive-can-start-degraded" role="function" condition="since:2.22">
<title>g_drive_can_start_degraded ()</title>
<indexterm zone="g-drive-can-start-degraded" role="2.22"><primary sortas="drive_can_start_degraded">g_drive_can_start_degraded</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            g_drive_can_start_degraded          (<link linkend="GDrive">GDrive</link> *drive);</programlisting>
<para>
Checks if a drive can be started degraded.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>drive</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GDrive"><type>GDrive</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the <parameter>drive</parameter> can be started degraded, <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> otherwise.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.22</para></refsect2>
<refsect2 id="g-drive-can-stop" role="function" condition="since:2.22">
<title>g_drive_can_stop ()</title>
<indexterm zone="g-drive-can-stop" role="2.22"><primary sortas="drive_can_stop">g_drive_can_stop</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            g_drive_can_stop                    (<link linkend="GDrive">GDrive</link> *drive);</programlisting>
<para>
Checks if a drive can be stopped.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>drive</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GDrive"><type>GDrive</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the <parameter>drive</parameter> can be stopped, <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> otherwise.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.22</para></refsect2>
<refsect2 id="g-drive-can-poll-for-media" role="function">
<title>g_drive_can_poll_for_media ()</title>
<indexterm zone="g-drive-can-poll-for-media"><primary sortas="drive_can_poll_for_media">g_drive_can_poll_for_media</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            g_drive_can_poll_for_media          (<link linkend="GDrive">GDrive</link> *drive);</programlisting>
<para>
Checks if a drive can be polled for media changes.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>drive</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GDrive"><type>GDrive</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the <parameter>drive</parameter> can be polled for media changes,
    <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> otherwise.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-drive-poll-for-media" role="function">
<title>g_drive_poll_for_media ()</title>
<indexterm zone="g-drive-poll-for-media"><primary sortas="drive_poll_for_media">g_drive_poll_for_media</primary></indexterm><programlisting><link linkend="void">void</link>                g_drive_poll_for_media              (<link linkend="GDrive">GDrive</link> *drive,
                                                         <link linkend="GCancellable">GCancellable</link> *cancellable,
                                                         <link linkend="GAsyncReadyCallback">GAsyncReadyCallback</link> callback,
                                                         <link linkend="gpointer">gpointer</link> user_data);</programlisting>
<para>
Asynchronously polls <parameter>drive</parameter> to see if media has been inserted or removed.
</para>
<para>
When the operation is finished, <parameter>callback</parameter> will be called.
You can then call <link linkend="g-drive-poll-for-media-finish"><function>g_drive_poll_for_media_finish()</function></link> to obtain the
result of the operation.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>drive</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GDrive"><type>GDrive</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>cancellable</parameter>&#160;:</term>
<listitem><simpara> optional <link linkend="GCancellable"><type>GCancellable</type></link> object, <link linkend="NULL--CAPS"><literal>NULL</literal></link> to ignore.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>callback</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GAsyncReadyCallback"><type>GAsyncReadyCallback</type></link>, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara> user data to pass to <parameter>callback</parameter>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-drive-poll-for-media-finish" role="function">
<title>g_drive_poll_for_media_finish ()</title>
<indexterm zone="g-drive-poll-for-media-finish"><primary sortas="drive_poll_for_media_finish">g_drive_poll_for_media_finish</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            g_drive_poll_for_media_finish       (<link linkend="GDrive">GDrive</link> *drive,
                                                         <link linkend="GAsyncResult">GAsyncResult</link> *result,
                                                         <link linkend="GError">GError</link> **error);</programlisting>
<para>
Finishes an operation started with <link linkend="g-drive-poll-for-media"><function>g_drive_poll_for_media()</function></link> on a drive.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>drive</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GDrive"><type>GDrive</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>result</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GAsyncResult"><type>GAsyncResult</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GError"><type>GError</type></link>, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the drive has been poll_for_mediaed successfully,
    <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> otherwise.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-drive-has-media" role="function">
<title>g_drive_has_media ()</title>
<indexterm zone="g-drive-has-media"><primary sortas="drive_has_media">g_drive_has_media</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            g_drive_has_media                   (<link linkend="GDrive">GDrive</link> *drive);</programlisting>
<para>
Checks if the <parameter>drive</parameter> has media. Note that the OS may not be polling
the drive for media changes; see <link linkend="g-drive-is-media-check-automatic"><function>g_drive_is_media_check_automatic()</function></link>
for more details.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>drive</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GDrive"><type>GDrive</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if <parameter>drive</parameter> has media, <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> otherwise.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-drive-is-media-check-automatic" role="function">
<title>g_drive_is_media_check_automatic ()</title>
<indexterm zone="g-drive-is-media-check-automatic"><primary sortas="drive_is_media_check_automatic">g_drive_is_media_check_automatic</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            g_drive_is_media_check_automatic    (<link linkend="GDrive">GDrive</link> *drive);</programlisting>
<para>
Checks if <parameter>drive</parameter> is capabable of automatically detecting media changes.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>drive</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GDrive"><type>GDrive</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the <parameter>drive</parameter> is capabable of automatically detecting 
    media changes, <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> otherwise.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-drive-is-media-removable" role="function">
<title>g_drive_is_media_removable ()</title>
<indexterm zone="g-drive-is-media-removable"><primary sortas="drive_is_media_removable">g_drive_is_media_removable</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            g_drive_is_media_removable          (<link linkend="GDrive">GDrive</link> *drive);</programlisting>
<para>
Checks if the <parameter>drive</parameter> supports removable media.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>drive</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GDrive"><type>GDrive</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if <parameter>drive</parameter> supports removable media, <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> otherwise.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-drive-eject" role="function" condition="deprecated:2.22: Use g_drive_eject_with_operation() instead.">
<title>g_drive_eject ()</title>
<indexterm zone="g-drive-eject" role="deprecated"><primary sortas="drive_eject">g_drive_eject</primary></indexterm><programlisting><link linkend="void">void</link>                g_drive_eject                       (<link linkend="GDrive">GDrive</link> *drive,
                                                         <link linkend="GMountUnmountFlags">GMountUnmountFlags</link> flags,
                                                         <link linkend="GCancellable">GCancellable</link> *cancellable,
                                                         <link linkend="GAsyncReadyCallback">GAsyncReadyCallback</link> callback,
                                                         <link linkend="gpointer">gpointer</link> user_data);</programlisting>
<warning><para><literal>g_drive_eject</literal> has been deprecated since version 2.22 and should not be used in newly-written code. Use <link linkend="g-drive-eject-with-operation"><function>g_drive_eject_with_operation()</function></link> instead.</para></warning>
<para>
Asynchronously ejects a drive.
</para>
<para>
When the operation is finished, <parameter>callback</parameter> will be called.
You can then call <link linkend="g-drive-eject-finish"><function>g_drive_eject_finish()</function></link> to obtain the
result of the operation.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>drive</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GDrive"><type>GDrive</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>flags</parameter>&#160;:</term>
<listitem><simpara> flags affecting the unmount if required for eject
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>cancellable</parameter>&#160;:</term>
<listitem><simpara> optional <link linkend="GCancellable"><type>GCancellable</type></link> object, <link linkend="NULL--CAPS"><literal>NULL</literal></link> to ignore.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>callback</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GAsyncReadyCallback"><type>GAsyncReadyCallback</type></link>, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara> user data to pass to <parameter>callback</parameter>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-drive-eject-finish" role="function" condition="deprecated:2.22: Use g_drive_eject_with_operation_finish() instead.">
<title>g_drive_eject_finish ()</title>
<indexterm zone="g-drive-eject-finish" role="deprecated"><primary sortas="drive_eject_finish">g_drive_eject_finish</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            g_drive_eject_finish                (<link linkend="GDrive">GDrive</link> *drive,
                                                         <link linkend="GAsyncResult">GAsyncResult</link> *result,
                                                         <link linkend="GError">GError</link> **error);</programlisting>
<warning><para><literal>g_drive_eject_finish</literal> has been deprecated since version 2.22 and should not be used in newly-written code. Use <link linkend="g-drive-eject-with-operation-finish"><function>g_drive_eject_with_operation_finish()</function></link> instead.</para></warning>
<para>
Finishes ejecting a drive.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>drive</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GDrive"><type>GDrive</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>result</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GAsyncResult"><type>GAsyncResult</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GError"><type>GError</type></link>, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the drive has been ejected successfully,
    <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> otherwise.

</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-drive-eject-with-operation" role="function" condition="since:2.22">
<title>g_drive_eject_with_operation ()</title>
<indexterm zone="g-drive-eject-with-operation" role="2.22"><primary sortas="drive_eject_with_operation">g_drive_eject_with_operation</primary></indexterm><programlisting><link linkend="void">void</link>                g_drive_eject_with_operation        (<link linkend="GDrive">GDrive</link> *drive,
                                                         <link linkend="GMountUnmountFlags">GMountUnmountFlags</link> flags,
                                                         <link linkend="GMountOperation">GMountOperation</link> *mount_operation,
                                                         <link linkend="GCancellable">GCancellable</link> *cancellable,
                                                         <link linkend="GAsyncReadyCallback">GAsyncReadyCallback</link> callback,
                                                         <link linkend="gpointer">gpointer</link> user_data);</programlisting>
<para>
Ejects a drive. This is an asynchronous operation, and is
finished by calling <link linkend="g-drive-eject-with-operation-finish"><function>g_drive_eject_with_operation_finish()</function></link> with the <parameter>drive</parameter>
and <link linkend="GAsyncResult"><type>GAsyncResult</type></link> data returned in the <parameter>callback</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>drive</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GDrive"><type>GDrive</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>flags</parameter>&#160;:</term>
<listitem><simpara> flags affecting the unmount if required for eject
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>mount_operation</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GMountOperation"><type>GMountOperation</type></link> or <link linkend="NULL--CAPS"><literal>NULL</literal></link> to avoid user interaction.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>cancellable</parameter>&#160;:</term>
<listitem><simpara> optional <link linkend="GCancellable"><type>GCancellable</type></link> object, <link linkend="NULL--CAPS"><literal>NULL</literal></link> to ignore.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>callback</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GAsyncReadyCallback"><type>GAsyncReadyCallback</type></link>, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara> user data passed to <parameter>callback</parameter>.
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.22</para></refsect2>
<refsect2 id="g-drive-eject-with-operation-finish" role="function" condition="since:2.22">
<title>g_drive_eject_with_operation_finish ()</title>
<indexterm zone="g-drive-eject-with-operation-finish" role="2.22"><primary sortas="drive_eject_with_operation_finish">g_drive_eject_with_operation_finish</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            g_drive_eject_with_operation_finish (<link linkend="GDrive">GDrive</link> *drive,
                                                         <link linkend="GAsyncResult">GAsyncResult</link> *result,
                                                         <link linkend="GError">GError</link> **error);</programlisting>
<para>
Finishes ejecting a drive. If any errors occurred during the operation,
<parameter>error</parameter> will be set to contain the errors and <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> will be returned.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>drive</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GDrive"><type>GDrive</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>result</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GAsyncResult"><type>GAsyncResult</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GError"><type>GError</type></link> location to store the error occuring, or <link linkend="NULL--CAPS"><literal>NULL</literal></link> to
    ignore.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the drive was successfully ejected. <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> otherwise.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.22</para></refsect2>
<refsect2 id="g-drive-start" role="function" condition="since:2.22">
<title>g_drive_start ()</title>
<indexterm zone="g-drive-start" role="2.22"><primary sortas="drive_start">g_drive_start</primary></indexterm><programlisting><link linkend="void">void</link>                g_drive_start                       (<link linkend="GDrive">GDrive</link> *drive,
                                                         <link linkend="GDriveStartFlags">GDriveStartFlags</link> flags,
                                                         <link linkend="GMountOperation">GMountOperation</link> *mount_operation,
                                                         <link linkend="GCancellable">GCancellable</link> *cancellable,
                                                         <link linkend="GAsyncReadyCallback">GAsyncReadyCallback</link> callback,
                                                         <link linkend="gpointer">gpointer</link> user_data);</programlisting>
<para>
Asynchronously starts a drive.
</para>
<para>
When the operation is finished, <parameter>callback</parameter> will be called.
You can then call <link linkend="g-drive-start-finish"><function>g_drive_start_finish()</function></link> to obtain the
result of the operation.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>drive</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GDrive"><type>GDrive</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>flags</parameter>&#160;:</term>
<listitem><simpara> flags affecting the start operation.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>mount_operation</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GMountOperation"><type>GMountOperation</type></link> or <link linkend="NULL--CAPS"><literal>NULL</literal></link> to avoid user interaction.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>cancellable</parameter>&#160;:</term>
<listitem><simpara> optional <link linkend="GCancellable"><type>GCancellable</type></link> object, <link linkend="NULL--CAPS"><literal>NULL</literal></link> to ignore.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>callback</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GAsyncReadyCallback"><type>GAsyncReadyCallback</type></link>, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara> user data to pass to <parameter>callback</parameter>
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.22</para></refsect2>
<refsect2 id="g-drive-start-finish" role="function" condition="since:2.22">
<title>g_drive_start_finish ()</title>
<indexterm zone="g-drive-start-finish" role="2.22"><primary sortas="drive_start_finish">g_drive_start_finish</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            g_drive_start_finish                (<link linkend="GDrive">GDrive</link> *drive,
                                                         <link linkend="GAsyncResult">GAsyncResult</link> *result,
                                                         <link linkend="GError">GError</link> **error);</programlisting>
<para>
Finishes starting a drive.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>drive</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GDrive"><type>GDrive</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>result</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GAsyncResult"><type>GAsyncResult</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GError"><type>GError</type></link>, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the drive has been started successfully,
    <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> otherwise.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.22</para></refsect2>
<refsect2 id="g-drive-stop" role="function" condition="since:2.22">
<title>g_drive_stop ()</title>
<indexterm zone="g-drive-stop" role="2.22"><primary sortas="drive_stop">g_drive_stop</primary></indexterm><programlisting><link linkend="void">void</link>                g_drive_stop                        (<link linkend="GDrive">GDrive</link> *drive,
                                                         <link linkend="GMountUnmountFlags">GMountUnmountFlags</link> flags,
                                                         <link linkend="GMountOperation">GMountOperation</link> *mount_operation,
                                                         <link linkend="GCancellable">GCancellable</link> *cancellable,
                                                         <link linkend="GAsyncReadyCallback">GAsyncReadyCallback</link> callback,
                                                         <link linkend="gpointer">gpointer</link> user_data);</programlisting>
<para>
Asynchronously stops a drive.
</para>
<para>
When the operation is finished, <parameter>callback</parameter> will be called.
You can then call <link linkend="g-drive-stop-finish"><function>g_drive_stop_finish()</function></link> to obtain the
result of the operation.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>drive</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GDrive"><type>GDrive</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>flags</parameter>&#160;:</term>
<listitem><simpara> flags affecting the unmount if required for stopping.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>mount_operation</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GMountOperation"><type>GMountOperation</type></link> or <link linkend="NULL--CAPS"><literal>NULL</literal></link> to avoid user interaction.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>cancellable</parameter>&#160;:</term>
<listitem><simpara> optional <link linkend="GCancellable"><type>GCancellable</type></link> object, <link linkend="NULL--CAPS"><literal>NULL</literal></link> to ignore.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>callback</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GAsyncReadyCallback"><type>GAsyncReadyCallback</type></link>, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara> user data to pass to <parameter>callback</parameter>
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.22</para></refsect2>
<refsect2 id="g-drive-stop-finish" role="function" condition="since:2.22">
<title>g_drive_stop_finish ()</title>
<indexterm zone="g-drive-stop-finish" role="2.22"><primary sortas="drive_stop_finish">g_drive_stop_finish</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            g_drive_stop_finish                 (<link linkend="GDrive">GDrive</link> *drive,
                                                         <link linkend="GAsyncResult">GAsyncResult</link> *result,
                                                         <link linkend="GError">GError</link> **error);</programlisting>
<para>
Finishes stopping a drive.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>drive</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GDrive"><type>GDrive</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>result</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GAsyncResult"><type>GAsyncResult</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GError"><type>GError</type></link>, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the drive has been stopped successfully,
    <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> otherwise.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.22</para></refsect2>
<refsect2 id="g-drive-enumerate-identifiers" role="function">
<title>g_drive_enumerate_identifiers ()</title>
<indexterm zone="g-drive-enumerate-identifiers"><primary sortas="drive_enumerate_identifiers">g_drive_enumerate_identifiers</primary></indexterm><programlisting><link linkend="char">char</link> **             g_drive_enumerate_identifiers       (<link linkend="GDrive">GDrive</link> *drive);</programlisting>
<para>
Gets the kinds of identifiers that <parameter>drive</parameter> has. 
Use <link linkend="g-drive-get-identifer"><function>g_drive_get_identifer()</function></link> to obtain the identifiers
themselves.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>drive</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GDrive"><type>GDrive</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a <link linkend="NULL--CAPS"><literal>NULL</literal></link>-terminated array of strings containing
    kinds of identifiers. Use <link linkend="g-strfreev"><function>g_strfreev()</function></link> to free.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-drive-get-identifier" role="function">
<title>g_drive_get_identifier ()</title>
<indexterm zone="g-drive-get-identifier"><primary sortas="drive_get_identifier">g_drive_get_identifier</primary></indexterm><programlisting><link linkend="char">char</link> *              g_drive_get_identifier              (<link linkend="GDrive">GDrive</link> *drive,
                                                         const <link linkend="char">char</link> *kind);</programlisting>
<para>
Gets the identifier of the given kind for <parameter>drive</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>drive</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GDrive"><type>GDrive</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>kind</parameter>&#160;:</term>
<listitem><simpara> the kind of identifier to return
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a newly allocated string containing the
    requested identfier, or <link linkend="NULL--CAPS"><literal>NULL</literal></link> if the <link linkend="GDrive"><type>GDrive</type></link>
    doesn't have this kind of identifier.
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>

<refsect1 id="GDrive.signal-details" role="signals">
<title role="signals.title">Signal Details</title>
<refsect2 id="GDrive-changed" role="signal"><title>The <literal>&quot;changed&quot;</literal> signal</title>
<indexterm zone="GDrive-changed"><primary sortas="Drive::changed">GDrive::changed</primary></indexterm><programlisting><link linkend="void">void</link>                user_function                      (<link linkend="GDrive">GDrive</link>  *drive,
                                                        <link linkend="gpointer">gpointer</link> user_data)      : Run Last</programlisting>
<para>
Emitted when the drive's state has changed.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>drive</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GDrive"><type>GDrive</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2 id="GDrive-disconnected" role="signal"><title>The <literal>&quot;disconnected&quot;</literal> signal</title>
<indexterm zone="GDrive-disconnected"><primary sortas="Drive::disconnected">GDrive::disconnected</primary></indexterm><programlisting><link linkend="void">void</link>                user_function                      (<link linkend="GDrive">GDrive</link>  *drive,
                                                        <link linkend="gpointer">gpointer</link> user_data)      : Run Last</programlisting>
<para>
This signal is emitted when the <link linkend="GDrive"><type>GDrive</type></link> have been
disconnected. If the recipient is holding references to the
object they should release them so the object can be
finalized.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>drive</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GDrive"><type>GDrive</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2 id="GDrive-eject-button" role="signal"><title>The <literal>&quot;eject-button&quot;</literal> signal</title>
<indexterm zone="GDrive-eject-button"><primary sortas="Drive::eject-button">GDrive::eject-button</primary></indexterm><programlisting><link linkend="void">void</link>                user_function                      (<link linkend="GDrive">GDrive</link>  *drive,
                                                        <link linkend="gpointer">gpointer</link> user_data)      : Run Last</programlisting>
<para>
Emitted when the physical eject button (if any) of a drive has
been pressed.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>drive</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GDrive"><type>GDrive</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2 id="GDrive-stop-button" role="signal"><title>The <literal>&quot;stop-button&quot;</literal> signal</title>
<indexterm zone="GDrive-stop-button" role="2.22"><primary sortas="Drive::stop-button">GDrive::stop-button</primary></indexterm><programlisting><link linkend="void">void</link>                user_function                      (<link linkend="GDrive">GDrive</link>  *drive,
                                                        <link linkend="gpointer">gpointer</link> user_data)      : Run Last</programlisting>
<para>
Emitted when the physical stop button (if any) of a drive has
been pressed.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>drive</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GDrive"><type>GDrive</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist><para>Since 2.22</para></refsect2>
</refsect1>



</refentry>
