glibmm 2.80.0
|
Authentication methods for mountable locations. More...
#include <giomm/mountoperation.h>
Public Member Functions | |
MountOperation (MountOperation &&src) noexcept | |
MountOperation & | operator= (MountOperation &&src) noexcept |
~MountOperation () noexcept override | |
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 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::SignalProxy< void(const Glib::ustring &, const Glib::ustring &, const Glib::ustring &, AskPasswordFlags)> | signal_ask_password () |
Glib::SignalProxy< void(const Glib::ustring &, const std::vector< Glib::ustring > &)> | signal_ask_question () |
Glib::SignalProxy< void(MountOperationResult)> | signal_reply () |
Glib::SignalProxy< void()> | signal_aborted () |
Glib::SignalProxy< void(const Glib::ustring &, gint64, gint64)> | signal_show_unmount_progress () |
Glib::PropertyProxy< Glib::ustring > | property_username () |
The user name that is used for authentication when carrying out the mount operation. | |
Glib::PropertyProxy_ReadOnly< Glib::ustring > | property_username () const |
The user name that is used for authentication when carrying out the mount operation. | |
Glib::PropertyProxy< Glib::ustring > | property_password () |
The password that is used for authentication when carrying out the mount operation. | |
Glib::PropertyProxy_ReadOnly< Glib::ustring > | property_password () const |
The password that is used for authentication when carrying out the mount operation. | |
Glib::PropertyProxy< bool > | property_anonymous () |
Whether to use an anonymous user when authenticating. | |
Glib::PropertyProxy_ReadOnly< bool > | property_anonymous () const |
Whether to use an anonymous user when authenticating. | |
Glib::PropertyProxy< Glib::ustring > | property_domain () |
The domain to use for the mount operation. | |
Glib::PropertyProxy_ReadOnly< Glib::ustring > | property_domain () const |
The domain to use for the mount operation. | |
Glib::PropertyProxy< PasswordSave > | property_password_save () |
Determines if and how the password information should be saved. | |
Glib::PropertyProxy_ReadOnly< PasswordSave > | property_password_save () const |
Determines if and how the password information should be saved. | |
Glib::PropertyProxy< int > | property_choice () |
The index of the user's choice when a question is asked during the mount operation. | |
Glib::PropertyProxy_ReadOnly< int > | property_choice () const |
The index of the user's choice when a question is asked during the mount operation. | |
Public Member Functions inherited from Glib::Object | |
Object (const Object &)=delete | |
Object & | operator= (const Object &)=delete |
Object (Object &&src) noexcept | |
Object & | operator= (Object &&src) noexcept |
void * | get_data (const QueryQuark & key) |
void | set_data (const Quark & key, void *data) |
void | set_data_with_c_callback (const Quark & key, void *data, GDestroyNotify notify) |
void | set_data (const Quark & key, void *data, DestroyNotify notify) |
Prefer set_data_with_c_callback() with a callback with C linkage. | |
void | remove_data (const QueryQuark &quark) |
void * | steal_data (const QueryQuark &quark) |
Public Member Functions inherited from Glib::ObjectBase | |
ObjectBase (const ObjectBase &)=delete | |
ObjectBase & | operator= (const ObjectBase &)=delete |
void | set_property_value (const Glib::ustring & property_name, const Glib::ValueBase & value) |
You probably want to use a specific property_*() accessor method instead. | |
void | get_property_value (const Glib::ustring & property_name, Glib::ValueBase & value) const |
You probably want to use a specific property_*() accessor method instead. | |
template<class PropertyType > | |
void | set_property (const Glib::ustring & property_name, const PropertyType & value) |
You probably want to use a specific property_*() accessor method instead. | |
template<class PropertyType > | |
void | get_property (const Glib::ustring & property_name, PropertyType & value) const |
You probably want to use a specific property_*() accessor method instead. | |
template<class PropertyType > | |
PropertyType | get_property (const Glib::ustring & property_name) const |
You probably want to use a specific property_*() accessor method instead. | |
sigc::connection | connect_property_changed (const Glib::ustring & property_name, const sigc::slot< void()> &slot) |
You can use the signal_changed() signal of the property proxy instead. | |
sigc::connection | connect_property_changed (const Glib::ustring & property_name, sigc::slot< void()> &&slot) |
You can use the signal_changed() signal of the property proxy instead. | |
void | freeze_notify () |
Increases the freeze count on object. | |
void | thaw_notify () |
Reverts the effect of a previous call to freeze_notify(). | |
virtual void | reference () const |
Increment the reference count for this object. | |
virtual void | unreference () const |
Decrement the reference count for this object. | |
GObject * | gobj () |
Provides access to the underlying C GObject. | |
const GObject * | gobj () const |
Provides access to the underlying C GObject. | |
GObject * | gobj_copy () const |
Give a ref-ed copy to someone. Use for direct struct access. | |
Static Public Member Functions | |
static GType | get_type () |
Get the GType for this class, for use with the underlying GObject type system. | |
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 std::vector< Glib::ustring > &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(). | |
virtual void | on_aborted () |
This is a default handler for the signal signal_aborted(). | |
virtual void | on_show_unmount_progress (const Glib::ustring & message, gint64 time_left, gint64 bytes_left) |
This is a default handler for the signal signal_show_unmount_progress(). | |
Protected Member Functions inherited from Glib::Object | |
Object () | |
Object (const Glib::ConstructParams &construct_params) | |
Object (GObject *castitem) | |
~Object () noexcept override | |
Protected Member Functions inherited from Glib::ObjectBase | |
ObjectBase () | |
This default constructor is called implicitly from the constructor of user-derived classes, even if, for instance, Gtk::Button calls a different ObjectBase constructor. | |
ObjectBase (const char *custom_type_name) | |
A derived constructor always overrides this choice. | |
ObjectBase (const std::type_info &custom_type_info) | |
This constructor is a special feature to allow creation of derived types on the fly, without having to use g_object_new() manually. | |
ObjectBase (ObjectBase &&src) noexcept | |
ObjectBase & | operator= (ObjectBase &&src) noexcept |
virtual | ~ObjectBase () noexcept=0 |
void | initialize (GObject *castitem) |
void | initialize_move (GObject *castitem, Glib::ObjectBase *previous_wrapper) |
Related Symbols | |
(Note that these are not member symbols.) | |
Glib::RefPtr< Gio::MountOperation > | wrap (GMountOperation *object, bool take_copy=false) |
A Glib::wrap() method for this object. | |
Related Symbols inherited from Glib::Object | |
Glib::RefPtr< Glib::Object > | wrap (GObject *object, bool take_copy=false) |
Additional Inherited Members | |
Public Types inherited from Glib::Object | |
using | DestroyNotify = void(*)(gpointer data) |
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.
|
noexcept |
|
overridenoexcept |
|
protected |
|
static |
bool Gio::MountOperation::get_anonymous | ( | ) | const |
Check to see whether the mount operation is being used for an anonymous user.
true
if mount operation is anonymous. int Gio::MountOperation::get_choice | ( | ) | const |
Gets a choice from the mount operation.
0
. Glib::ustring Gio::MountOperation::get_domain | ( | ) | const |
Gets the domain of the mount operation.
Glib::ustring Gio::MountOperation::get_password | ( | ) | const |
Gets a password from the mount operation.
PasswordSave Gio::MountOperation::get_password_save | ( | ) | const |
Gets the state of saving passwords for the mount operation.
Get the GType for this class, for use with the underlying GObject type system.
Glib::ustring Gio::MountOperation::get_username | ( | ) | const |
Get the user name from the mount operation.
|
inline |
Provides access to the underlying C GObject.
|
inline |
Provides access to the underlying C GObject.
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.
This is a default handler for the signal signal_aborted().
|
protectedvirtual |
This is a default handler for the signal signal_ask_password().
|
protectedvirtual |
This is a default handler for the signal signal_ask_question().
|
protectedvirtual |
This is a default handler for the signal signal_reply().
|
protectedvirtual |
This is a default handler for the signal signal_show_unmount_progress().
|
noexcept |
Glib::PropertyProxy< bool > Gio::MountOperation::property_anonymous | ( | ) |
Whether to use an anonymous user when authenticating.
Default value: false
Glib::PropertyProxy_ReadOnly< bool > Gio::MountOperation::property_anonymous | ( | ) | const |
Whether to use an anonymous user when authenticating.
Default value: false
Glib::PropertyProxy< int > Gio::MountOperation::property_choice | ( | ) |
The index of the user's choice when a question is asked during the mount operation.
See the MountOperation::signal_ask_question() signal.
Default value: 0
Glib::PropertyProxy_ReadOnly< int > Gio::MountOperation::property_choice | ( | ) | const |
The index of the user's choice when a question is asked during the mount operation.
See the MountOperation::signal_ask_question() signal.
Default value: 0
Glib::PropertyProxy< Glib::ustring > Gio::MountOperation::property_domain | ( | ) |
The domain to use for the mount operation.
Default value: ""
Glib::PropertyProxy_ReadOnly< Glib::ustring > Gio::MountOperation::property_domain | ( | ) | const |
The domain to use for the mount operation.
Default value: ""
Glib::PropertyProxy< Glib::ustring > Gio::MountOperation::property_password | ( | ) |
The password that is used for authentication when carrying out the mount operation.
Default value: ""
Glib::PropertyProxy_ReadOnly< Glib::ustring > Gio::MountOperation::property_password | ( | ) | const |
The password that is used for authentication when carrying out the mount operation.
Default value: ""
Glib::PropertyProxy< PasswordSave > Gio::MountOperation::property_password_save | ( | ) |
Determines if and how the password information should be saved.
Default value: Gio::PasswordSave::NEVER
Glib::PropertyProxy_ReadOnly< PasswordSave > Gio::MountOperation::property_password_save | ( | ) | const |
Determines if and how the password information should be saved.
Default value: Gio::PasswordSave::NEVER
Glib::PropertyProxy< Glib::ustring > Gio::MountOperation::property_username | ( | ) |
The user name that is used for authentication when carrying out the mount operation.
Default value: ""
Glib::PropertyProxy_ReadOnly< Glib::ustring > Gio::MountOperation::property_username | ( | ) | const |
The user name that is used for authentication when carrying out the mount operation.
Default value: ""
void Gio::MountOperation::reply | ( | MountOperationResult | result | ) |
Emits the MountOperation::signal_reply() signal.
result | A MountOperationResult. |
Sets the mount operation to use an anonymous user if anonymous is true
.
anonymous | Boolean value. |
Sets a default choice for the mount operation.
choice | An integer. |
void Gio::MountOperation::set_domain | ( | const Glib::ustring & | domain | ) |
Sets the mount operation's domain.
domain | The domain to set. |
void Gio::MountOperation::set_password | ( | const Glib::ustring & | password | ) |
Sets the mount operation's password to password.
password | Password to set. |
void Gio::MountOperation::set_password_save | ( | PasswordSave | save | ) |
Sets the state of saving passwords for the mount operation.
save | A set of PasswordSave flags. |
void Gio::MountOperation::set_username | ( | const Glib::ustring & | username | ) |
Sets the user name within op to username.
username | Input username. |
Glib::SignalProxy< void()> Gio::MountOperation::signal_aborted | ( | ) |
void on_my_aborted()
Flags: Run Last
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.
Glib::SignalProxy< void(const Glib::ustring &, const Glib::ustring &, const Glib::ustring &, AskPasswordFlags)> Gio::MountOperation::signal_ask_password | ( | ) |
void on_my_ask_password(const Glib::ustring& message, const Glib::ustring& default_user, const Glib::ustring& default_domain, AskPasswordFlags flags)
Flags: Run Last
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.
message | String containing a message to display to the user. |
default_user | String containing the default user name. |
default_domain | String containing the default domain. |
flags | A set of AskPasswordFlags. |
Glib::SignalProxy< void(const Glib::ustring &, const std::vector< Glib::ustring > &)> Gio::MountOperation::signal_ask_question | ( | ) |
void on_my_ask_question(const Glib::ustring& message, const std::vector<Glib::ustring>& choices)
Flags: Run Last
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.
message | String containing a message to display to the user. |
choices | An array of strings for each possible choice. |
Glib::SignalProxy< void(MountOperationResult)> Gio::MountOperation::signal_reply | ( | ) |
void on_my_reply(MountOperationResult result)
Flags: Run Last
Emitted when the user has replied to the mount operation.
result | A MountOperationResult indicating how the request was handled. |
Glib::SignalProxy< void(const Glib::ustring &, gint64, gint64)> Gio::MountOperation::signal_show_unmount_progress | ( | ) |
void on_my_show_unmount_progress(const Glib::ustring& message, gint64 time_left, gint64 bytes_left)
Flags: Run Last
Emitted when an unmount operation has been busy for more than some time (typically 1.5 seconds).
When unmounting or ejecting a volume, the kernel might need to flush pending data in its buffers to the volume stable storage, and this operation can take a considerable amount of time. This signal may be emitted several times as long as the unmount operation is outstanding, and then one last time when the operation is completed, with bytes_left set to zero.
Implementations of GMountOperation should handle this signal by showing an UI notification, and then dismiss it, or show another notification of completion, when bytes_left reaches zero.
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.
message | String containing a message to display to the user. |
time_left | The estimated time left before the operation completes, in microseconds, or -1. |
bytes_left | The amount of bytes to be written before the operation completes (or -1 if such amount is not known), or zero if the operation is completed. |
|
related |
A Glib::wrap() method for this object.
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. |