glibmm  2.31.22
Public Member Functions | Static Public Member Functions | Protected Member Functions | Related Functions
Gio::MountOperation Class Reference

Authentication methods for mountable locations. More...

#include <giomm/mountoperation.h>

Inheritance diagram for Gio::MountOperation:
Inheritance graph
[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::signal_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::SignalProxy0< void > signal_aborted ()
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< PasswordSaveproperty_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)
 This is a default handler for the signal signal_ask_password().
virtual void on_ask_question (const Glib::ustring& message, const Glib::StringArrayHandle& choices)
 This is a default handler for the signal signal_ask_question().
virtual void on_reply (MountOperationResult result)
 This is a default handler for the signal signal_reply().

Related Functions

(Note that these are not member functions.)

Glib::RefPtr< Gio::MountOperationwrap (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]

Member Function Documentation

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

Returns:
true if mount operation is anonymous.

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.

Gets the domain of the mount operation.

Returns:
A string set to the domain.

Gets a password from the mount operation.

Returns:
A string containing the password within op.

Gets the state of saving passwords for the mount operation.

Returns:
A PasswordSave flag.

Get the user name from the mount operation.

Returns:
A string containing the user name.
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.

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]

This is a default handler for the signal signal_ask_password().

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

This is a default handler for the signal signal_ask_question().

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

This is a default handler for the signal signal_reply().

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

Emits the MountOperation::signal_reply() signal.

Parameters:
resultA MountOperationResult.
void Gio::MountOperation::set_anonymous ( bool  anonymous = true)

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

Parameters:
anonymousBoolean value.
void Gio::MountOperation::set_choice ( int  choice)

Sets a default choice for the mount operation.

Parameters:
choiceAn integer.

Sets the mount operation's domain.

Parameters:
domainThe domain to set.

Sets the mount operation's password to password.

Parameters:
passwordPassword to set.

Sets the state of saving passwords for the mount operation.

Parameters:
saveA set of PasswordSave flags.

Sets the user name within op to username.

Parameters:
usernameInput username.
Slot Prototype:
void on_my_aborted()

Emitted by the backend when e.g. a device becomes unavailable while a mount operation is in progress.

Implementations of GMountOperation should handle this signal by dismissing open password dialogs.

Since glibmm 2.20:
Slot Prototype:
void on_my_ask_password(const Glib::ustring& message, const Glib::ustring& default_user, const Glib::ustring& default_domain, AskPasswordFlags flags)

Emitted when a mount operation asks the user for a password.

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 Gtk::MessageDialog.

Parameters:
messageString containing a message to display to the user.
default_userString containing the default user name.
default_domainString containing the default domain.
flagsA set of AskPasswordFlags.
Slot Prototype:
void on_my_ask_question(const Glib::ustring& message, const Glib::StringArrayHandle& choices)

Emitted when asking the user a question and gives a list of choices for the user to choose from.

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 Gtk::MessageDialog.

Parameters:
messageString containing a message to display to the user.
choicesAn array of strings for each possible choice.
Slot Prototype:
void on_my_reply(MountOperationResult result)

Emitted when the user has replied to the mount operation.

Parameters:
resultA MountOperationResult indicating how the request was handled.

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:
objectThe C instance.
take_copyFalse 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.