<?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="GMountOperation">
<refmeta>
<refentrytitle role="top_of_page" id="GMountOperation.top_of_page">GMountOperation</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GIO Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>GMountOperation</refname>
<refpurpose>Object used for authentication and user interaction</refpurpose>
</refnamediv>

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

<synopsis>

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

enum                <link linkend="GAskPasswordFlags">GAskPasswordFlags</link>;
enum                <link linkend="GPasswordSave">GPasswordSave</link>;
                    <link linkend="GMountOperation-struct">GMountOperation</link>;
enum                <link linkend="GMountOperationResult">GMountOperationResult</link>;
<link linkend="GMountOperation">GMountOperation</link> *   <link linkend="g-mount-operation-new">g_mount_operation_new</link>               (void);
const <link linkend="char">char</link> *        <link linkend="g-mount-operation-get-username">g_mount_operation_get_username</link>      (<link linkend="GMountOperation">GMountOperation</link> *op);
<link linkend="void">void</link>                <link linkend="g-mount-operation-set-username">g_mount_operation_set_username</link>      (<link linkend="GMountOperation">GMountOperation</link> *op,
                                                         const <link linkend="char">char</link> *username);
const <link linkend="char">char</link> *        <link linkend="g-mount-operation-get-password">g_mount_operation_get_password</link>      (<link linkend="GMountOperation">GMountOperation</link> *op);
<link linkend="void">void</link>                <link linkend="g-mount-operation-set-password">g_mount_operation_set_password</link>      (<link linkend="GMountOperation">GMountOperation</link> *op,
                                                         const <link linkend="char">char</link> *password);
<link linkend="gboolean">gboolean</link>            <link linkend="g-mount-operation-get-anonymous">g_mount_operation_get_anonymous</link>     (<link linkend="GMountOperation">GMountOperation</link> *op);
<link linkend="void">void</link>                <link linkend="g-mount-operation-set-anonymous">g_mount_operation_set_anonymous</link>     (<link linkend="GMountOperation">GMountOperation</link> *op,
                                                         <link linkend="gboolean">gboolean</link> anonymous);
const <link linkend="char">char</link> *        <link linkend="g-mount-operation-get-domain">g_mount_operation_get_domain</link>        (<link linkend="GMountOperation">GMountOperation</link> *op);
<link linkend="void">void</link>                <link linkend="g-mount-operation-set-domain">g_mount_operation_set_domain</link>        (<link linkend="GMountOperation">GMountOperation</link> *op,
                                                         const <link linkend="char">char</link> *domain);
<link linkend="GPasswordSave">GPasswordSave</link>       <link linkend="g-mount-operation-get-password-save">g_mount_operation_get_password_save</link> (<link linkend="GMountOperation">GMountOperation</link> *op);
<link linkend="void">void</link>                <link linkend="g-mount-operation-set-password-save">g_mount_operation_set_password_save</link> (<link linkend="GMountOperation">GMountOperation</link> *op,
                                                         <link linkend="GPasswordSave">GPasswordSave</link> save);
<link linkend="int">int</link>                 <link linkend="g-mount-operation-get-choice">g_mount_operation_get_choice</link>        (<link linkend="GMountOperation">GMountOperation</link> *op);
<link linkend="void">void</link>                <link linkend="g-mount-operation-set-choice">g_mount_operation_set_choice</link>        (<link linkend="GMountOperation">GMountOperation</link> *op,
                                                         <link linkend="int">int</link> choice);
<link linkend="void">void</link>                <link linkend="g-mount-operation-reply">g_mount_operation_reply</link>             (<link linkend="GMountOperation">GMountOperation</link> *op,
                                                         <link linkend="GMountOperationResult">GMountOperationResult</link> result);
</synopsis>
</refsynopsisdiv>

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





<refsect1 id="GMountOperation.properties" role="properties">
<title role="properties.title">Properties</title>
<synopsis>
  &quot;<link linkend="GMountOperation--anonymous">anonymous</link>&quot;                <link linkend="gboolean">gboolean</link>              : Read / Write
  &quot;<link linkend="GMountOperation--choice">choice</link>&quot;                   <link linkend="gint">gint</link>                  : Read / Write
  &quot;<link linkend="GMountOperation--domain">domain</link>&quot;                   <link linkend="gchar">gchar</link>*                : Read / Write
  &quot;<link linkend="GMountOperation--password">password</link>&quot;                 <link linkend="gchar">gchar</link>*                : Read / Write
  &quot;<link linkend="GMountOperation--password-save">password-save</link>&quot;            <link linkend="GPasswordSave">GPasswordSave</link>         : Read / Write
  &quot;<link linkend="GMountOperation--username">username</link>&quot;                 <link linkend="gchar">gchar</link>*                : Read / Write
</synopsis>
</refsect1>

<refsect1 id="GMountOperation.signals" role="signal_proto">
<title role="signal_proto.title">Signals</title>
<synopsis>
  &quot;<link linkend="GMountOperation-aborted">aborted</link>&quot;                                        : Run Last
  &quot;<link linkend="GMountOperation-ask-password">ask-password</link>&quot;                                   : Run Last
  &quot;<link linkend="GMountOperation-ask-question">ask-question</link>&quot;                                   : Run Last
  &quot;<link linkend="GMountOperation-reply">reply</link>&quot;                                          : Run Last
  &quot;<link linkend="GMountOperation-show-processes">show-processes</link>&quot;                                 : Run Last
</synopsis>
</refsect1>


<refsect1 id="GMountOperation.description" role="desc">
<title role="desc.title">Description</title>
<para>
<link linkend="GMountOperation"><type>GMountOperation</type></link> provides a mechanism for interacting with the user.
It can be used for authenticating mountable operations, such as loop
mounting files, hard drive partitions or server locations. It can
also be used to ask the user questions or show a list of applications
preventing unmount or eject operations from completing.
</para>
<para>
Note that <link linkend="GMountOperation"><type>GMountOperation</type></link> is used for more than just <link linkend="GMount"><type>GMount</type></link>
objects – for example it is also used in <link linkend="g-drive-start"><function>g_drive_start()</function></link> and
<link linkend="g-drive-stop"><function>g_drive_stop()</function></link>.
</para>
<para>
Users should instantiate a subclass of this that implements all the
various callbacks to show the required dialogs, such as
<link linkend="GtkMountOperation"><type>GtkMountOperation</type></link>. If no user interaction is desired (for example
when automounting filesystems at login time), usually <link linkend="NULL--CAPS"><literal>NULL</literal></link> can be
passed, see each method taking a <link linkend="GMountOperation"><type>GMountOperation</type></link> for details.</para>
<para>
</para>
</refsect1>

<refsect1 id="GMountOperation.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="GAskPasswordFlags" role="enum">
<title>enum GAskPasswordFlags</title>
<indexterm zone="GAskPasswordFlags"><primary sortas="AskPasswordFlags">GAskPasswordFlags</primary></indexterm><programlisting>typedef enum {
  G_ASK_PASSWORD_NEED_PASSWORD       = (1 &lt;&lt; 0),
  G_ASK_PASSWORD_NEED_USERNAME       = (1 &lt;&lt; 1),
  G_ASK_PASSWORD_NEED_DOMAIN         = (1 &lt;&lt; 2),
  G_ASK_PASSWORD_SAVING_SUPPORTED    = (1 &lt;&lt; 3),
  G_ASK_PASSWORD_ANONYMOUS_SUPPORTED = (1 &lt;&lt; 4)
} GAskPasswordFlags;
</programlisting>
<para>
<link linkend="GAskPasswordFlags"><type>GAskPasswordFlags</type></link> are used to request specific information from the
user, or to notify the user of their choices in an authentication
situation.</para>
<para>
</para><variablelist role="enum">
<varlistentry id="G-ASK-PASSWORD-NEED-PASSWORD--CAPS" role="constant">
<term><literal>G_ASK_PASSWORD_NEED_PASSWORD</literal></term>
<listitem><simpara> operation requires a password.
</simpara></listitem>
</varlistentry>
<varlistentry id="G-ASK-PASSWORD-NEED-USERNAME--CAPS" role="constant">
<term><literal>G_ASK_PASSWORD_NEED_USERNAME</literal></term>
<listitem><simpara> operation requires a username.
</simpara></listitem>
</varlistentry>
<varlistentry id="G-ASK-PASSWORD-NEED-DOMAIN--CAPS" role="constant">
<term><literal>G_ASK_PASSWORD_NEED_DOMAIN</literal></term>
<listitem><simpara> operation requires a domain.
</simpara></listitem>
</varlistentry>
<varlistentry id="G-ASK-PASSWORD-SAVING-SUPPORTED--CAPS" role="constant">
<term><literal>G_ASK_PASSWORD_SAVING_SUPPORTED</literal></term>
<listitem><simpara> operation supports saving settings.
</simpara></listitem>
</varlistentry>
<varlistentry id="G-ASK-PASSWORD-ANONYMOUS-SUPPORTED--CAPS" role="constant">
<term><literal>G_ASK_PASSWORD_ANONYMOUS_SUPPORTED</literal></term>
<listitem><simpara> operation supports anonymous users.
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="GPasswordSave" role="enum">
<title>enum GPasswordSave</title>
<indexterm zone="GPasswordSave"><primary sortas="PasswordSave">GPasswordSave</primary></indexterm><programlisting>typedef enum {
  G_PASSWORD_SAVE_NEVER,
  G_PASSWORD_SAVE_FOR_SESSION,
  G_PASSWORD_SAVE_PERMANENTLY
} GPasswordSave;
</programlisting>
<para>
<link linkend="GPasswordSave"><type>GPasswordSave</type></link> is used to indicate the lifespan of a saved password.
</para>
<para>
<link linkend="Gvfs"><type>Gvfs</type></link> stores passwords in the Gnome keyring when this flag allows it
to, and later retrieves it again from there.</para>
<para>
</para><variablelist role="enum">
<varlistentry id="G-PASSWORD-SAVE-NEVER--CAPS" role="constant">
<term><literal>G_PASSWORD_SAVE_NEVER</literal></term>
<listitem><simpara> never save a password.
</simpara></listitem>
</varlistentry>
<varlistentry id="G-PASSWORD-SAVE-FOR-SESSION--CAPS" role="constant">
<term><literal>G_PASSWORD_SAVE_FOR_SESSION</literal></term>
<listitem><simpara> save a password for the session.
</simpara></listitem>
</varlistentry>
<varlistentry id="G-PASSWORD-SAVE-PERMANENTLY--CAPS" role="constant">
<term><literal>G_PASSWORD_SAVE_PERMANENTLY</literal></term>
<listitem><simpara> save a password permanently.
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="GMountOperation-struct" role="struct">
<title>GMountOperation</title>
<indexterm zone="GMountOperation-struct"><primary sortas="MountOperation">GMountOperation</primary></indexterm><programlisting>typedef struct _GMountOperation GMountOperation;</programlisting>
<para>
Class for providing authentication methods for mounting operations,
such as mounting a file locally, or authenticating with a server.</para>
<para>
</para></refsect2>
<refsect2 id="GMountOperationResult" role="enum">
<title>enum GMountOperationResult</title>
<indexterm zone="GMountOperationResult"><primary sortas="MountOperationResult">GMountOperationResult</primary></indexterm><programlisting>typedef enum {
  G_MOUNT_OPERATION_HANDLED,
  G_MOUNT_OPERATION_ABORTED,
  G_MOUNT_OPERATION_UNHANDLED
} GMountOperationResult;
</programlisting>
<para>
<link linkend="GMountOperationResult"><type>GMountOperationResult</type></link> is returned as a result when a request for
information is send by the mounting operation.</para>
<para>
</para><variablelist role="enum">
<varlistentry id="G-MOUNT-OPERATION-HANDLED--CAPS" role="constant">
<term><literal>G_MOUNT_OPERATION_HANDLED</literal></term>
<listitem><simpara> The request was fulfilled and the
    user specified data is now available
</simpara></listitem>
</varlistentry>
<varlistentry id="G-MOUNT-OPERATION-ABORTED--CAPS" role="constant">
<term><literal>G_MOUNT_OPERATION_ABORTED</literal></term>
<listitem><simpara> The user requested the mount operation
    to be aborted
</simpara></listitem>
</varlistentry>
<varlistentry id="G-MOUNT-OPERATION-UNHANDLED--CAPS" role="constant">
<term><literal>G_MOUNT_OPERATION_UNHANDLED</literal></term>
<listitem><simpara> The request was unhandled (i.e. not
    implemented)
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mount-operation-new" role="function">
<title>g_mount_operation_new ()</title>
<indexterm zone="g-mount-operation-new"><primary sortas="mount_operation_new">g_mount_operation_new</primary></indexterm><programlisting><link linkend="GMountOperation">GMountOperation</link> *   g_mount_operation_new               (void);</programlisting>
<para>
Creates a new mount operation.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a <link linkend="GMountOperation"><type>GMountOperation</type></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mount-operation-get-username" role="function">
<title>g_mount_operation_get_username ()</title>
<indexterm zone="g-mount-operation-get-username"><primary sortas="mount_operation_get_username">g_mount_operation_get_username</primary></indexterm><programlisting>const <link linkend="char">char</link> *        g_mount_operation_get_username      (<link linkend="GMountOperation">GMountOperation</link> *op);</programlisting>
<para>
Get the user name from the mount operation.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>op</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GMountOperation"><type>GMountOperation</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a string containing the user name.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mount-operation-set-username" role="function">
<title>g_mount_operation_set_username ()</title>
<indexterm zone="g-mount-operation-set-username"><primary sortas="mount_operation_set_username">g_mount_operation_set_username</primary></indexterm><programlisting><link linkend="void">void</link>                g_mount_operation_set_username      (<link linkend="GMountOperation">GMountOperation</link> *op,
                                                         const <link linkend="char">char</link> *username);</programlisting>
<para>
Sets the user name within <parameter>op</parameter> to <parameter>username</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>op</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GMountOperation"><type>GMountOperation</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>username</parameter>&#160;:</term>
<listitem><simpara> input username.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mount-operation-get-password" role="function">
<title>g_mount_operation_get_password ()</title>
<indexterm zone="g-mount-operation-get-password"><primary sortas="mount_operation_get_password">g_mount_operation_get_password</primary></indexterm><programlisting>const <link linkend="char">char</link> *        g_mount_operation_get_password      (<link linkend="GMountOperation">GMountOperation</link> *op);</programlisting>
<para>
Gets a password from the mount operation.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>op</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GMountOperation"><type>GMountOperation</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a string containing the password within <parameter>op</parameter>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mount-operation-set-password" role="function">
<title>g_mount_operation_set_password ()</title>
<indexterm zone="g-mount-operation-set-password"><primary sortas="mount_operation_set_password">g_mount_operation_set_password</primary></indexterm><programlisting><link linkend="void">void</link>                g_mount_operation_set_password      (<link linkend="GMountOperation">GMountOperation</link> *op,
                                                         const <link linkend="char">char</link> *password);</programlisting>
<para>
Sets the mount operation's password to <parameter>password</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>op</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GMountOperation"><type>GMountOperation</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>password</parameter>&#160;:</term>
<listitem><simpara> password to set.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mount-operation-get-anonymous" role="function">
<title>g_mount_operation_get_anonymous ()</title>
<indexterm zone="g-mount-operation-get-anonymous"><primary sortas="mount_operation_get_anonymous">g_mount_operation_get_anonymous</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            g_mount_operation_get_anonymous     (<link linkend="GMountOperation">GMountOperation</link> *op);</programlisting>
<para>
Check to see whether the mount operation is being used 
for an anonymous user.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>op</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GMountOperation"><type>GMountOperation</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if mount operation is anonymous. 
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mount-operation-set-anonymous" role="function">
<title>g_mount_operation_set_anonymous ()</title>
<indexterm zone="g-mount-operation-set-anonymous"><primary sortas="mount_operation_set_anonymous">g_mount_operation_set_anonymous</primary></indexterm><programlisting><link linkend="void">void</link>                g_mount_operation_set_anonymous     (<link linkend="GMountOperation">GMountOperation</link> *op,
                                                         <link linkend="gboolean">gboolean</link> anonymous);</programlisting>
<para>
Sets the mount operation to use an anonymous user if <parameter>anonymous</parameter> is <link linkend="TRUE--CAPS"><literal>TRUE</literal></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>op</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GMountOperation"><type>GMountOperation</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>anonymous</parameter>&#160;:</term>
<listitem><simpara> boolean value.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mount-operation-get-domain" role="function">
<title>g_mount_operation_get_domain ()</title>
<indexterm zone="g-mount-operation-get-domain"><primary sortas="mount_operation_get_domain">g_mount_operation_get_domain</primary></indexterm><programlisting>const <link linkend="char">char</link> *        g_mount_operation_get_domain        (<link linkend="GMountOperation">GMountOperation</link> *op);</programlisting>
<para>
Gets the domain of the mount operation.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>op</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GMountOperation"><type>GMountOperation</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a string set to the domain. 
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mount-operation-set-domain" role="function">
<title>g_mount_operation_set_domain ()</title>
<indexterm zone="g-mount-operation-set-domain"><primary sortas="mount_operation_set_domain">g_mount_operation_set_domain</primary></indexterm><programlisting><link linkend="void">void</link>                g_mount_operation_set_domain        (<link linkend="GMountOperation">GMountOperation</link> *op,
                                                         const <link linkend="char">char</link> *domain);</programlisting>
<para>
Sets the mount operation's domain.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>op</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GMountOperation"><type>GMountOperation</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>domain</parameter>&#160;:</term>
<listitem><simpara> the domain to set.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mount-operation-get-password-save" role="function">
<title>g_mount_operation_get_password_save ()</title>
<indexterm zone="g-mount-operation-get-password-save"><primary sortas="mount_operation_get_password_save">g_mount_operation_get_password_save</primary></indexterm><programlisting><link linkend="GPasswordSave">GPasswordSave</link>       g_mount_operation_get_password_save (<link linkend="GMountOperation">GMountOperation</link> *op);</programlisting>
<para>
Gets the state of saving passwords for the mount operation.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>op</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GMountOperation"><type>GMountOperation</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a <link linkend="GPasswordSave"><type>GPasswordSave</type></link> flag. 
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mount-operation-set-password-save" role="function">
<title>g_mount_operation_set_password_save ()</title>
<indexterm zone="g-mount-operation-set-password-save"><primary sortas="mount_operation_set_password_save">g_mount_operation_set_password_save</primary></indexterm><programlisting><link linkend="void">void</link>                g_mount_operation_set_password_save (<link linkend="GMountOperation">GMountOperation</link> *op,
                                                         <link linkend="GPasswordSave">GPasswordSave</link> save);</programlisting>
<para>
Sets the state of saving passwords for the mount operation.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>op</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GMountOperation"><type>GMountOperation</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>save</parameter>&#160;:</term>
<listitem><simpara> a set of <link linkend="GPasswordSave"><type>GPasswordSave</type></link> flags.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mount-operation-get-choice" role="function">
<title>g_mount_operation_get_choice ()</title>
<indexterm zone="g-mount-operation-get-choice"><primary sortas="mount_operation_get_choice">g_mount_operation_get_choice</primary></indexterm><programlisting><link linkend="int">int</link>                 g_mount_operation_get_choice        (<link linkend="GMountOperation">GMountOperation</link> *op);</programlisting>
<para>
Gets a choice from the mount operation.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>op</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GMountOperation"><type>GMountOperation</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> an integer containing an index of the user's choice from 
the choice's list, or <link linkend="0--CAPS"><literal>0</literal></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mount-operation-set-choice" role="function">
<title>g_mount_operation_set_choice ()</title>
<indexterm zone="g-mount-operation-set-choice"><primary sortas="mount_operation_set_choice">g_mount_operation_set_choice</primary></indexterm><programlisting><link linkend="void">void</link>                g_mount_operation_set_choice        (<link linkend="GMountOperation">GMountOperation</link> *op,
                                                         <link linkend="int">int</link> choice);</programlisting>
<para>
Sets a default choice for the mount operation.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>op</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GMountOperation"><type>GMountOperation</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>choice</parameter>&#160;:</term>
<listitem><simpara> an integer.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mount-operation-reply" role="function">
<title>g_mount_operation_reply ()</title>
<indexterm zone="g-mount-operation-reply"><primary sortas="mount_operation_reply">g_mount_operation_reply</primary></indexterm><programlisting><link linkend="void">void</link>                g_mount_operation_reply             (<link linkend="GMountOperation">GMountOperation</link> *op,
                                                         <link linkend="GMountOperationResult">GMountOperationResult</link> result);</programlisting>
<para>
Emits the <link linkend="GMountOperation-reply"><type>"reply"</type></link> signal.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>op</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GMountOperation"><type>GMountOperation</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>result</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GMountOperationResult"><type>GMountOperationResult</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>
<refsect1 id="GMountOperation.property-details" role="property_details">
<title role="property_details.title">Property Details</title>
<refsect2 id="GMountOperation--anonymous" role="property"><title>The <literal>&quot;anonymous&quot;</literal> property</title>
<indexterm zone="GMountOperation--anonymous"><primary sortas="MountOperation:anonymous">GMountOperation:anonymous</primary></indexterm><programlisting>  &quot;anonymous&quot;                <link linkend="gboolean">gboolean</link>              : Read / Write</programlisting>
<para>
Whether to use an anonymous user when authenticating.</para>
<para>
</para><para>Default value: FALSE</para>
</refsect2>
<refsect2 id="GMountOperation--choice" role="property"><title>The <literal>&quot;choice&quot;</literal> property</title>
<indexterm zone="GMountOperation--choice"><primary sortas="MountOperation:choice">GMountOperation:choice</primary></indexterm><programlisting>  &quot;choice&quot;                   <link linkend="gint">gint</link>                  : Read / Write</programlisting>
<para>
The index of the user's choice when a question is asked during the
mount operation. See the <link linkend="GMountOperation-ask-question"><type>"ask-question"</type></link> signal.</para>
<para>
</para><para>Allowed values: &gt;= 0</para>
<para>Default value: 0</para>
</refsect2>
<refsect2 id="GMountOperation--domain" role="property"><title>The <literal>&quot;domain&quot;</literal> property</title>
<indexterm zone="GMountOperation--domain"><primary sortas="MountOperation:domain">GMountOperation:domain</primary></indexterm><programlisting>  &quot;domain&quot;                   <link linkend="gchar">gchar</link>*                : Read / Write</programlisting>
<para>
The domain to use for the mount operation.</para>
<para>
</para><para>Default value: NULL</para>
</refsect2>
<refsect2 id="GMountOperation--password" role="property"><title>The <literal>&quot;password&quot;</literal> property</title>
<indexterm zone="GMountOperation--password"><primary sortas="MountOperation:password">GMountOperation:password</primary></indexterm><programlisting>  &quot;password&quot;                 <link linkend="gchar">gchar</link>*                : Read / Write</programlisting>
<para>
The password that is used for authentication when carrying out
the mount operation.</para>
<para>
</para><para>Default value: NULL</para>
</refsect2>
<refsect2 id="GMountOperation--password-save" role="property"><title>The <literal>&quot;password-save&quot;</literal> property</title>
<indexterm zone="GMountOperation--password-save"><primary sortas="MountOperation:password-save">GMountOperation:password-save</primary></indexterm><programlisting>  &quot;password-save&quot;            <link linkend="GPasswordSave">GPasswordSave</link>         : Read / Write</programlisting>
<para>
Determines if and how the password information should be saved.</para>
<para>
</para><para>Default value: G_PASSWORD_SAVE_NEVER</para>
</refsect2>
<refsect2 id="GMountOperation--username" role="property"><title>The <literal>&quot;username&quot;</literal> property</title>
<indexterm zone="GMountOperation--username"><primary sortas="MountOperation:username">GMountOperation:username</primary></indexterm><programlisting>  &quot;username&quot;                 <link linkend="gchar">gchar</link>*                : Read / Write</programlisting>
<para>
The user name that is used for authentication when carrying out
the mount operation.</para>
<para>
</para><para>Default value: NULL</para>
</refsect2>

</refsect1>

<refsect1 id="GMountOperation.signal-details" role="signals">
<title role="signals.title">Signal Details</title>
<refsect2 id="GMountOperation-aborted" role="signal"><title>The <literal>&quot;aborted&quot;</literal> signal</title>
<indexterm zone="GMountOperation-aborted" role="2.20"><primary sortas="MountOperation::aborted">GMountOperation::aborted</primary></indexterm><programlisting><link linkend="void">void</link>                user_function                      (<link linkend="GMountOperation">GMountOperation</link> *arg0,
                                                        <link linkend="gpointer">gpointer</link>         user_data)      : Run Last</programlisting>
<para>
Emitted by the backend when e.g. a device becomes unavailable
while a mount operation is in progress.
</para>
<para>
Implementations of GMountOperation should handle this signal
by dismissing open password dialogs.</para>
<para>
</para><variablelist role="params">
<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.20</para></refsect2><refsect2 id="GMountOperation-ask-password" role="signal"><title>The <literal>&quot;ask-password&quot;</literal> signal</title>
<indexterm zone="GMountOperation-ask-password"><primary sortas="MountOperation::ask-password">GMountOperation::ask-password</primary></indexterm><programlisting><link linkend="void">void</link>                user_function                      (<link linkend="GMountOperation">GMountOperation</link>  *op,
                                                        <link linkend="gchar">gchar</link>            *message,
                                                        <link linkend="gchar">gchar</link>            *default_user,
                                                        <link linkend="gchar">gchar</link>            *default_domain,
                                                        <link linkend="GAskPasswordFlags">GAskPasswordFlags</link> flags,
                                                        <link linkend="gpointer">gpointer</link>          user_data)           : Run Last</programlisting>
<para>
Emitted when a mount operation asks the user for a password.
</para>
<para>
If the message contains a line break, the first line should be
presented as a heading. For example, it may be used as the
primary text in a <link linkend="GtkMessageDialog"><type>GtkMessageDialog</type></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>op</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GMountOperation"><type>GMountOperation</type></link> requesting a password.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>message</parameter>&#160;:</term>
<listitem><simpara> string containing a message to display to the user.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>default_user</parameter>&#160;:</term>
<listitem><simpara> string containing the default user name.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>default_domain</parameter>&#160;:</term>
<listitem><simpara> string containing the default domain.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>flags</parameter>&#160;:</term>
<listitem><simpara> a set of <link linkend="GAskPasswordFlags"><type>GAskPasswordFlags</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="GMountOperation-ask-question" role="signal"><title>The <literal>&quot;ask-question&quot;</literal> signal</title>
<indexterm zone="GMountOperation-ask-question"><primary sortas="MountOperation::ask-question">GMountOperation::ask-question</primary></indexterm><programlisting><link linkend="void">void</link>                user_function                      (<link linkend="GMountOperation">GMountOperation</link> *op,
                                                        <link linkend="gchar">gchar</link>           *message,
                                                        <link linkend="GStrv">GStrv</link>           *choices,
                                                        <link linkend="gpointer">gpointer</link>         user_data)      : Run Last</programlisting>
<para>
Emitted when asking the user a question and gives a list of
choices for the user to choose from.
</para>
<para>
If the message contains a line break, the first line should be
presented as a heading. For example, it may be used as the
primary text in a <link linkend="GtkMessageDialog"><type>GtkMessageDialog</type></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>op</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GMountOperation"><type>GMountOperation</type></link> asking a question.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>message</parameter>&#160;:</term>
<listitem><simpara> string containing a message to display to the user.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>choices</parameter>&#160;:</term>
<listitem><simpara> an array of strings for each possible choice.
</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="GMountOperation-reply" role="signal"><title>The <literal>&quot;reply&quot;</literal> signal</title>
<indexterm zone="GMountOperation-reply"><primary sortas="MountOperation::reply">GMountOperation::reply</primary></indexterm><programlisting><link linkend="void">void</link>                user_function                      (<link linkend="GMountOperation">GMountOperation</link>      *op,
                                                        <link linkend="GMountOperationResult">GMountOperationResult</link> result,
                                                        <link linkend="gpointer">gpointer</link>              user_data)      : Run Last</programlisting>
<para>
Emitted when the user has replied to the mount operation.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>op</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GMountOperation"><type>GMountOperation</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>result</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GMountOperationResult"><type>GMountOperationResult</type></link> indicating how the request was handled
</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="GMountOperation-show-processes" role="signal"><title>The <literal>&quot;show-processes&quot;</literal> signal</title>
<indexterm zone="GMountOperation-show-processes" role="2.22"><primary sortas="MountOperation::show-processes">GMountOperation::show-processes</primary></indexterm><programlisting><link linkend="void">void</link>                user_function                      (<link linkend="GMountOperation">GMountOperation</link> *op,
                                                        <link linkend="gchar">gchar</link>           *message,
                                                        <link linkend="GArray">GArray</link>          *processes,
                                                        <link linkend="GStrv">GStrv</link>           *choices,
                                                        <link linkend="gpointer">gpointer</link>         user_data)      : Run Last</programlisting>
<para>
Emitted when one or more processes are blocking an operation
e.g. unmounting/ejecting a <link linkend="GMount"><type>GMount</type></link> or stopping a <link linkend="GDrive"><type>GDrive</type></link>.
</para>
<para>
Note that this signal may be emitted several times to update the
list of blocking processes as processes close files. The
application should only respond with <link linkend="g-mount-operation-reply"><function>g_mount_operation_reply()</function></link> to
the latest signal (setting <link linkend="GMountOperation--choice"><type>"choice"</type></link> to the choice
the user made).
</para>
<para>
If the message contains a line break, the first line should be
presented as a heading. For example, it may be used as the
primary text in a <link linkend="GtkMessageDialog"><type>GtkMessageDialog</type></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>op</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GMountOperation"><type>GMountOperation</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>message</parameter>&#160;:</term>
<listitem><simpara> string containing a message to display to the user.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>processes</parameter>&#160;:</term>
<listitem><simpara> an array of <link linkend="GPid"><type>GPid</type></link> for processes blocking the operation.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>choices</parameter>&#160;:</term>
<listitem><simpara> an array of strings for each possible choice.
</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>
