Main Page Widgets glibmm Namespaces Book

# Gio::MountOperation Class Reference

Authentication methods for mountable locations. More...

Inheritance diagram for Gio::MountOperation:

[legend]

List of all members.

## Public Member Functions

virtual | ~MountOperation ()
GMountOperation* | gobj ()
| Provides access to the underlying C GObject.
const GMountOperation* | gobj () const
| Provides access to the underlying C GObject.
GMountOperation* | gobj_copy ()
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
Glib::ustring | get_username () const
| Get the user name from the mount operation.
void | set_username (const Glib::ustring& username)
| Sets the user name within op to username.
Glib::ustring | get_password () const
| Gets a password from the mount operation.
void | set_password (const Glib::ustring& password)
| Sets the mount operation's password to password.
bool | get_anonymous () const
| Check to see whether the mount operation is being used for an anonymous user.
void | set_anonymous (bool anonymous=true)
| Sets the mount operation to use an anonymous user if anonymous is `true`.
Glib::ustring | get_domain () const
| Gets the domain of the mount operation.
void | set_domain (const Glib::ustring& domain)
| Sets the mount operation's domain.
PasswordSave | get_password_save () const
| Gets the state of saving passwords for the mount operation.
void | set_password_save (PasswordSave password_save)
| Sets the state of saving passwords for the mount operation.
int | get_choice () const
| Gets a choice from the mount operation.
void | set_choice (int choice)
| Sets a default choice for the mount operation.
void | reply (MountOperationResult result)
| Emits the MountOperation::reply signal.
Glib::SignalProxy4< void, const Glib::ustring&, const Glib::ustring&, const Glib::ustring &, AskPasswordFlags > | signal_ask_password ()
Glib::SignalProxy2< void, const Glib::ustring&, const Glib::StringArrayHandle& > | signal_ask_question ()
Glib::SignalProxy1< void, MountOperationResult > | signal_reply ()
Glib::PropertyProxy <Glib::ustring> | property_username ()
| The user name.
Glib::PropertyProxy_ReadOnly <Glib::ustring> | property_username () const
| The user name.
Glib::PropertyProxy <Glib::ustring> | property_password ()
| The password.
Glib::PropertyProxy_ReadOnly <Glib::ustring> | property_password () const
| The password.
Glib::PropertyProxy<bool> | property_anonymous ()
| Whether to use an anonymous user.
Glib::PropertyProxy_ReadOnly <bool> | property_anonymous () const
| Whether to use an anonymous user.
Glib::PropertyProxy <Glib::ustring> | property_domain ()
| The domain of the mount operation.
Glib::PropertyProxy_ReadOnly <Glib::ustring> | property_domain () const
| The domain of the mount operation.
Glib::PropertyProxy<PasswordSave> | property_password_save ()
| How passwords should be saved.
Glib::PropertyProxy_ReadOnly <PasswordSave> | property_password_save () const
| How passwords should be saved.
Glib::PropertyProxy<int> | property_choice ()
| The users choice.
Glib::PropertyProxy_ReadOnly<int> | property_choice () const
| The users choice.

## Static Public Member Functions

static Glib::RefPtr <MountOperation> | create ()

## Protected Member Functions

| MountOperation ()
virtual void | on_ask_password (const Glib::ustring& message, const Glib::ustring& default_user, const Glib::ustring& default_domain, AskPasswordFlags flags)
virtual void | on_ask_question (const Glib::ustring& message, const Glib::StringArrayHandle& choices)
virtual void | on_reply (MountOperationResult result)

## Related Functions

(Note that these are not member functions.)
Glib::RefPtr<Gio::MountOperation> | wrap (GMountOperation* object, bool take_copy=false)
| A Glib::wrap() method for this object.

## Detailed Description

Authentication methods for mountable locations.

MountOperation provides a mechanism for authenticating mountable operations, such as loop mounting files, hard drive partitions or server locations.

Mounting operations are handed a MountOperation that they can use if they require any privileges or authentication for their volumes to be mounted (e.g. a hard disk partition or an encrypted filesystem), or if they are implementing a remote server protocol which requires user credentials such as FTP or WebDAV.

Developers should instantiate a subclass of this that implements all the various callbacks to show the required dialogs.

Since glibmm 2.16:

## Constructor & Destructor Documentation

virtual Gio::MountOperation::~MountOperation | ( |  | ) | `[virtual]`

Gio::MountOperation::MountOperation | ( |  | ) | `[protected]`

## Member Function Documentation

GMountOperation* Gio::MountOperation::gobj | ( |  | ) | `[inline]`

Provides access to the underlying C GObject.

Reimplemented from Glib::ObjectBase.

const GMountOperation* Gio::MountOperation::gobj | ( |  | ) | const`[inline]`

Provides access to the underlying C GObject.

Reimplemented from Glib::ObjectBase.

GMountOperation* Gio::MountOperation::gobj_copy | ( |  | ) |

Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

static Glib::RefPtr<MountOperation> Gio::MountOperation::create | ( |  | ) | `[static]`

Glib::ustring Gio::MountOperation::get_username | ( |  | ) | const

Get the user name from the mount operation.

Returns:
  A string containing the user name.

void Gio::MountOperation::set_username | ( | const Glib::ustring& | username | ) |

Sets the user name within op to username.

Parameters:

  | username | Input username.

Glib::ustring Gio::MountOperation::get_password | ( |  | ) | const

Gets a password from the mount operation.

Returns:
  A string containing the password within op.

void Gio::MountOperation::set_password | ( | const Glib::ustring& | password | ) |

Sets the mount operation's password to password.

Parameters:

  | password | Password to set.

bool Gio::MountOperation::get_anonymous | ( |  | ) | const

Check to see whether the mount operation is being used for an anonymous user.

Returns:
  `true` if mount operation is anonymous.

void Gio::MountOperation::set_anonymous | ( | bool | anonymous = `true` | ) |

Sets the mount operation to use an anonymous user if anonymous is `true`.

Parameters:

  | anonymous | Boolean value.

Glib::ustring Gio::MountOperation::get_domain | ( |  | ) | const

Gets the domain of the mount operation.

Returns:
  A string set to the domain.

void Gio::MountOperation::set_domain | ( | const Glib::ustring& | domain | ) |

Sets the mount operation's domain.

Parameters:

  | domain | The domain to set.

PasswordSave Gio::MountOperation::get_password_save | ( |  | ) | const

Gets the state of saving passwords for the mount operation.

Returns:
  A PasswordSave flag.

void Gio::MountOperation::set_password_save | ( | PasswordSave | password_save | ) |

Sets the state of saving passwords for the mount operation.

Parameters:

  | save | A set of PasswordSave flags.

int Gio::MountOperation::get_choice | ( |  | ) | const

Gets a choice from the mount operation.

Returns:
  An integer containing an index of the user's choice from the choice's list, or 0.

void Gio::MountOperation::set_choice | ( | int | choice | ) |

Sets a default choice for the mount operation.

Parameters:

  | choice | An integer.

void Gio::MountOperation::reply | ( | MountOperationResult | result | ) |

Emits the MountOperation::reply signal.

Parameters:

  | result | A MountOperationResult.

Glib::SignalProxy4<void,const Glib::ustring&,const Glib::ustring&,const Glib::ustring&,AskPasswordFlags> Gio::MountOperation::signal_ask_password | ( |  | ) |

Prototype:
  `void on_my_ask_password(const Glib::ustring& message, const Glib::ustring& default_user, const Glib::ustring& default_domain, AskPasswordFlags flags)`

Glib::SignalProxy2<void,const Glib::ustring&,const Glib::StringArrayHandle&> Gio::MountOperation::signal_ask_question | ( |  | ) |

Prototype:
  `void on_my_ask_question(const Glib::ustring& message, const Glib::StringArrayHandle& choices)`

Glib::SignalProxy1<void,MountOperationResult> Gio::MountOperation::signal_reply | ( |  | ) |

Prototype:
  `void on_my_reply(MountOperationResult result)`

Glib::PropertyProxy<Glib::ustring> Gio::MountOperation::property_username | ( |  | ) |

The user name.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<Glib::ustring> Gio::MountOperation::property_username | ( |  | ) | const

The user name.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<Glib::ustring> Gio::MountOperation::property_password | ( |  | ) |

The password.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<Glib::ustring> Gio::MountOperation::property_password | ( |  | ) | const

The password.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<bool> Gio::MountOperation::property_anonymous | ( |  | ) |

Whether to use an anonymous user.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<bool> Gio::MountOperation::property_anonymous | ( |  | ) | const

Whether to use an anonymous user.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<Glib::ustring> Gio::MountOperation::property_domain | ( |  | ) |

The domain of the mount operation.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<Glib::ustring> Gio::MountOperation::property_domain | ( |  | ) | const

The domain of the mount operation.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<PasswordSave> Gio::MountOperation::property_password_save | ( |  | ) |

How passwords should be saved.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<PasswordSave> Gio::MountOperation::property_password_save | ( |  | ) | const

How passwords should be saved.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<int> Gio::MountOperation::property_choice | ( |  | ) |

The users choice.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<int> Gio::MountOperation::property_choice | ( |  | ) | const

The users choice.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

virtual void Gio::MountOperation::on_ask_password | ( | const Glib::ustring& | message,
|  | const Glib::ustring& | default_user,
|  | const Glib::ustring& | default_domain,
|  | AskPasswordFlags | flags |
| ) |  |  | `[protected, virtual]`

virtual void Gio::MountOperation::on_ask_question | ( | const Glib::ustring& | message,
|  | const Glib::StringArrayHandle& | choices |
| ) |  |  | `[protected, virtual]`

virtual void Gio::MountOperation::on_reply | ( | MountOperationResult | result | ) | `[protected, virtual]`

## Friends And Related Function Documentation

Glib::RefPtr<Gio::MountOperation> wrap | ( | GMountOperation * | object,
|  | bool | take_copy = `false` |
| ) |  |  | `[related]`

A Glib::wrap() method for this object.

Parameters:

  | object | The C instance.
  | take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref.

Returns:
  A C++ instance that wraps this C instance.

The documentation for this class was generated from the following file:

- mountoperation.h