<?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">GDrive</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GIO Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>GDrive</refname>
<refpurpose>Virtual File System drive management</refpurpose>
<!--[<xref linkend="desc" endterm="desc.title"/>]-->
</refnamediv>

<refsynopsisdiv 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>;
<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="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="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 role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<synopsis>

  <link linkend="GInterface">GInterface</link>
   +----GDrive
</synopsis>

</refsect1>

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

</refsect1>





<refsect1 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
</synopsis>
</refsect1>


<refsect1 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.
Its 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>
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 role="details">
<title role="details.title">Details</title>
<refsect2>
<title><anchor id="GDrive-struct" role="struct"/>GDrive</title>
<indexterm><primary>GDrive</primary></indexterm><programlisting>typedef struct _GDrive GDrive;</programlisting>
<para>
Opaque drive object.</para>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="GDriveIface" role="struct"/>GDriveIface</title>
<indexterm><primary>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);
} 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>&nbsp;<structfield>g_iface</structfield>;</term>
<listitem><simpara> The parent interface.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>changed</structfield>&nbsp;()</term>
<listitem><simpara> Signal emitted when the drive is changed.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>disconnected</structfield>&nbsp;()</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>&nbsp;()</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>&nbsp;()</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>&nbsp;()</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>&nbsp;()</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>&nbsp;()</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>&nbsp;()</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>&nbsp;()</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>&nbsp;()</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>&nbsp;()</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>&nbsp;()</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>&nbsp;()</term>
<listitem><simpara> Ejects a <link linkend="GDrive"><type>GDrive</type></link>.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>eject_finish</structfield>&nbsp;()</term>
<listitem><simpara> Finishes an eject operation.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>poll_for_media</structfield>&nbsp;()</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>&nbsp;()</term>
<listitem><simpara> Finishes a media poll operation.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>get_identifier</structfield>&nbsp;()</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>&nbsp;()</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>
</variablelist></refsect2>
<refsect2>
<title><anchor id="g-drive-get-name" role="function"/>g_drive_get_name ()</title>
<indexterm><primary>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>&nbsp;:</term>
<listitem><simpara> a <link linkend="GDrive"><type>GDrive</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</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>
<title><anchor id="g-drive-get-icon" role="function"/>g_drive_get_icon ()</title>
<indexterm><primary>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>&nbsp;:</term>
<listitem><simpara> a <link linkend="GDrive"><type>GDrive</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> <link linkend="GIcon"><type>GIcon</type></link> for the <parameter>drive</parameter>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="g-drive-has-volumes" role="function"/>g_drive_has_volumes ()</title>
<indexterm><primary>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>&nbsp;:</term>
<listitem><simpara> a <link linkend="GDrive"><type>GDrive</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</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>
<title><anchor id="g-drive-get-volumes" role="function"/>g_drive_get_volumes ()</title>
<indexterm><primary>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>&nbsp;:</term>
<listitem><simpara> a <link linkend="GDrive"><type>GDrive</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> <link linkend="GList"><type>GList</type></link> containing any <link linkend="GVolume"><type>GVolume</type></link><!---->s on the given <parameter>drive</parameter>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="g-drive-can-eject" role="function"/>g_drive_can_eject ()</title>
<indexterm><primary>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>&nbsp;:</term>
<listitem><simpara> pointer to a <link linkend="GDrive"><type>GDrive</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</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>
<title><anchor id="g-drive-can-poll-for-media" role="function"/>g_drive_can_poll_for_media ()</title>
<indexterm><primary>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>&nbsp;:</term>
<listitem><simpara> a <link linkend="GDrive"><type>GDrive</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</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>
<title><anchor id="g-drive-poll-for-media" role="function"/>g_drive_poll_for_media ()</title>
<indexterm><primary>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>
Polls <parameter>drive</parameter> to see if media has been inserted or removed.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>drive</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="GDrive"><type>GDrive</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>cancellable</parameter>&nbsp;:</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>&nbsp;:</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>&nbsp;:</term>
<listitem><simpara> a <link linkend="gpointer"><type>gpointer</type></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="g-drive-poll-for-media-finish" role="function"/>g_drive_poll_for_media_finish ()</title>
<indexterm><primary>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 poll_for_mediaing a drive.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>drive</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="GDrive"><type>GDrive</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>result</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="GAsyncResult"><type>GAsyncResult</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="GError"><type>GError</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</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>
<title><anchor id="g-drive-has-media" role="function"/>g_drive_has_media ()</title>
<indexterm><primary>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>&nbsp;:</term>
<listitem><simpara> a <link linkend="GDrive"><type>GDrive</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</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>
<title><anchor id="g-drive-is-media-check-automatic" role="function"/>g_drive_is_media_check_automatic ()</title>
<indexterm><primary>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>&nbsp;:</term>
<listitem><simpara> a <link linkend="GDrive"><type>GDrive</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</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>
<title><anchor id="g-drive-is-media-removable" role="function"/>g_drive_is_media_removable ()</title>
<indexterm><primary>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>&nbsp;:</term>
<listitem><simpara> a <link linkend="GDrive"><type>GDrive</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</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>
<title><anchor id="g-drive-eject" role="function"/>g_drive_eject ()</title>
<indexterm><primary>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>
<para>
Ejects a drive.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>drive</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="GDrive"><type>GDrive</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>flags</parameter>&nbsp;:</term>
<listitem><simpara> flags affecting the unmount if required for eject
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>cancellable</parameter>&nbsp;:</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>&nbsp;:</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>&nbsp;:</term>
<listitem><simpara> a <link linkend="gpointer"><type>gpointer</type></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="g-drive-eject-finish" role="function"/>g_drive_eject_finish ()</title>
<indexterm><primary>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>
<para>
Finishes ejecting a drive.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>drive</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="GDrive"><type>GDrive</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>result</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="GAsyncResult"><type>GAsyncResult</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="GError"><type>GError</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</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>
<title><anchor id="g-drive-enumerate-identifiers" role="function"/>g_drive_enumerate_identifiers ()</title>
<indexterm><primary>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>&nbsp;:</term>
<listitem><simpara> a <link linkend="GDrive"><type>GDrive</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</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>
<title><anchor id="g-drive-get-identifier" role="function"/>g_drive_get_identifier ()</title>
<indexterm><primary>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>&nbsp;:</term>
<listitem><simpara> a <link linkend="GDrive"><type>GDrive</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>kind</parameter>&nbsp;:</term>
<listitem><simpara> the kind of identifier to return
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</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 role="signals">
<title role="signals.title">Signal Details</title>
<refsect2><title><anchor id="GDrive-changed"/>The <literal>&quot;changed&quot;</literal> signal</title>
<indexterm><primary>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>&nbsp;:</term>
<listitem><simpara> a <link linkend="GDrive"><type>GDrive</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&nbsp;:</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2><title><anchor id="GDrive-disconnected"/>The <literal>&quot;disconnected&quot;</literal> signal</title>
<indexterm><primary>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>&nbsp;:</term>
<listitem><simpara> a <link linkend="GDrive"><type>GDrive</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&nbsp;:</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2><title><anchor id="GDrive-eject-button"/>The <literal>&quot;eject-button&quot;</literal> signal</title>
<indexterm><primary>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 have been pressed.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>drive</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="GDrive"><type>GDrive</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&nbsp;:</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2>
</refsect1>




<refsect1><refsect2 /><refsect2 /></refsect1>
</refentry>
