Gio::TlsInteraction Class Reference

TlsInteraction - Interaction with the user during TLS operations. More...

`#include <giomm/tlsinteraction.h>`

Inheritance diagram for Gio::TlsInteraction:
[legend]

## Public Member Functions

virtual | ~TlsInteraction ()
GTlsInteraction* | gobj ()
| Provides access to the underlying C GObject. More...
const GTlsInteraction* | gobj () const
| Provides access to the underlying C GObject. More...
GTlsInteraction* | gobj_copy ()
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More...
TlsInteractionResult | ask_password (const Glib::RefPtr< TlsPassword >& password, const Glib::RefPtr< Cancellable >& cancellable)
| Run synchronous interaction to ask the user for a password. More...
TlsInteractionResult | ask_password (const Glib::RefPtr< TlsPassword >& password)
| A ask_password() convenience overload. More...
void | ask_password_async (const Glib::RefPtr< TlsPassword >& password, const SlotAsyncReady& slot, const Glib::RefPtr< Cancellable >& cancellable)
| Run asynchronous interaction to ask the user for a password. More...
void | ask_password_async (const Glib::RefPtr< TlsPassword >& password, const SlotAsyncReady& slot)
| A ask_password_async() convenience overload. More...
void | ask_password_async (const Glib::RefPtr< TlsPassword >& password, const Glib::RefPtr< Cancellable >& cancellable)
| A ask_password_async() convenience overload. More...
void | ask_password_async (const Glib::RefPtr< TlsPassword >& password)
| A ask_password_async() convenience overload. More...
TlsInteractionResult | ask_password_finish (const Glib::RefPtr< AsyncResult >& result)
| Complete an ask password user interaction request. More...
TlsInteractionResult | invoke_ask_password (const Glib::RefPtr< TlsPassword >& password, const Glib::RefPtr< Cancellable >& cancellable)
| Invoke the interaction to ask the user for a password. More...
TlsInteractionResult | invoke_ask_password (const Glib::RefPtr< TlsPassword >& password)
| A invoke_ask_password() convenience overload. More...
virtual TlsInteractionResult | ask_password_vfunc (const Glib::RefPtr< TlsPassword >& password, const Glib::RefPtr< Cancellable >& cancellable)
virtual void | ask_password_async_vfunc (const Glib::RefPtr< TlsPassword >& password, const SlotAsyncReady& slot, const Glib::RefPtr< Cancellable >& cancellable)
virtual TlsInteractionResult | ask_password_finish_vfunc (const Glib::RefPtr< AsyncResult >& result)
Public Member Functions inherited from Glib::Object
void* | get_data (const QueryQuark& key)
void | set_data (const Quark& key, void* data)
void | set_data (const Quark& key, void* data, DestroyNotify notify)
void | remove_data (const QueryQuark& quark)
void* | steal_data (const QueryQuark& quark)
Public Member Functions inherited from Glib::ObjectBase
void | set_property_value (const Glib::ustring& property_name, const Glib::ValueBase& value)
| You probably want to use a specific property_*() accessor method instead. More...
void | get_property_value (const Glib::ustring& property_name, Glib::ValueBase& value) const
| You probably want to use a specific property_*() accessor method instead. More...
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. More...
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. More...
void | 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, but this is necessary when using the reduced API. More...
sigc::connection | connect_property_changed_with_return (const Glib::ustring& property_name, const sigc::slot< void >& slot)
| You can use the signal_changed() signal of the property proxy instead, but this is necessary when using the reduced API. More...
void | freeze_notify ()
| Increases the freeze count on object. More...
void | thaw_notify ()
| Reverts the effect of a previous call to freeze_notify(). More...
virtual void | reference () const
| Increment the reference count for this object. More...
virtual void | unreference () const
| Decrement the reference count for this object. More...
GObject* | gobj ()
| Provides access to the underlying C GObject. More...
const GObject* | gobj () const
| Provides access to the underlying C GObject. More...
GObject* | gobj_copy () const
| Give a ref-ed copy to someone. Use for direct struct access. More...

## Static Public Member Functions

static GType | get_type ()
| Get the GType for this class, for use with the underlying GObject type system. More...

## Protected Member Functions

| TlsInteraction ()
Protected Member Functions inherited from Glib::Object
| Object ()
| Object (const Glib::ConstructParams& construct_params)
| Object (GObject* castitem)
virtual | ~Object ()
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. More...
| ObjectBase (const char* custom_type_name)
| A derived constructor always overrides this choice. More...
| 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. More...
virtual | ~ObjectBase ()=0
void | initialize (GObject* castitem)

## Related Functions

(Note that these are not member functions.)
Glib::RefPtr< Gio::TlsInteraction > | wrap (GTlsInteraction* object, bool take_copy=false)
| A Glib::wrap() method for this object. More...
Related Functions inherited from Glib::Object
Glib::RefPtr< Glib::Object > | wrap (GObject* object, bool take_copy=false)

## Additional Inherited Members

Public Types inherited from Glib::Object
typedef void(* | DestroyNotify )(gpointer data)

## Detailed Description

TlsInteraction - Interaction with the user during TLS operations.

TlsInteraction provides a mechanism for the TLS connection and database code to interact with the user. It can be used to ask the user for passwords.

To use a TlsInteraction with a TLS connection use Gio::TlsConnection::set_interaction().

Callers should instantiate a derived class that implements the various interaction methods to show the required dialogs.

Callers should use the 'invoke' functions like invoke_ask_password() to run interaction methods. These functions make sure that the interaction is invoked in the main loop and not in the current thread, if the current thread is not running the main loop.

Derived classes can choose to implement whichever interactions methods they'd like to support by overriding those virtual methods. Any interactions not implemented will return Gio::TLS_INTERACTION_UNHANDLED. If a derived class implements an async method, it must also implement the corresponding finish method.

Since glibmm 2.36:

## Constructor & Destructor Documentation

virtual Gio::TlsInteraction::~TlsInteraction | ( |  | ) |

virtual

Gio::TlsInteraction::TlsInteraction | ( |  | ) |

protected

## Member Function Documentation

TlsInteractionResult Gio::TlsInteraction::ask_password | ( | const Glib::RefPtr< TlsPassword >& | password,
|  | const Glib::RefPtr< Cancellable >& | cancellable
| ) |  |

Run synchronous interaction to ask the user for a password.

In general, g_tls_interaction_invoke_ask_password() should be used instead of this function.

Derived subclasses usually implement a password prompt, although they may also choose to provide a password from elsewhere. The password value will be filled in and then callback will be called. Alternatively the user may abort this password request, which will usually abort the TLS connection.

If the interaction is cancelled by the cancellation object, or by the user then TLS_INTERACTION_FAILED will be returned with an error that contains a IO_ERROR_CANCELLED error code. Certain implementations may not support immediate cancellation.

Since glibmm 2.30:

Parameters

  password | A TlsPassword object.
  cancellable | An optional Cancellable cancellation object.

Returns
  The status of the ask password interaction.

TlsInteractionResult Gio::TlsInteraction::ask_password | ( | const Glib::RefPtr< TlsPassword >& | password | ) |

A ask_password() convenience overload.

void Gio::TlsInteraction::ask_password_async | ( | const Glib::RefPtr< TlsPassword >& | password,
|  | const SlotAsyncReady& | slot,
|  | const Glib::RefPtr< Cancellable >& | cancellable
| ) |  |

Run asynchronous interaction to ask the user for a password.

In general, g_tls_interaction_invoke_ask_password() should be used instead of this function.

Derived subclasses usually implement a password prompt, although they may also choose to provide a password from elsewhere. The password value will be filled in and then slot will be called. Alternatively the user may abort this password request, which will usually abort the TLS connection.

If the interaction is cancelled by the cancellation object, or by the user then TLS_INTERACTION_FAILED will be returned with an error that contains a IO_ERROR_CANCELLED error code. Certain implementations may not support immediate cancellation.

Certain implementations may not support immediate cancellation.

Since glibmm 2.30:

Parameters

  password | A TlsPassword object.
  cancellable | An optional Cancellable cancellation object.
  slot | Will be called when the interaction completes.

void Gio::TlsInteraction::ask_password_async | ( | const Glib::RefPtr< TlsPassword >& | password,
|  | const SlotAsyncReady& | slot
| ) |  |

A ask_password_async() convenience overload.

void Gio::TlsInteraction::ask_password_async | ( | const Glib::RefPtr< TlsPassword >& | password,
|  | const Glib::RefPtr< Cancellable >& | cancellable
| ) |  |

A ask_password_async() convenience overload.

void Gio::TlsInteraction::ask_password_async | ( | const Glib::RefPtr< TlsPassword >& | password | ) |

A ask_password_async() convenience overload.

virtual void Gio::TlsInteraction::ask_password_async_vfunc | ( | const Glib::RefPtr< TlsPassword >& | password,
|  | const SlotAsyncReady& | slot,
|  | const Glib::RefPtr< Cancellable >& | cancellable
| ) |  |

virtual

TlsInteractionResult Gio::TlsInteraction::ask_password_finish | ( | const Glib::RefPtr< AsyncResult >& | result | ) |

Complete an ask password user interaction request.

This should be once the g_tls_interaction_ask_password_async() completion callback is called.

If TLS_INTERACTION_HANDLED is returned, then the TlsPassword passed to g_tls_interaction_ask_password() will have its password filled in.

If the interaction is cancelled by the cancellation object, or by the user then TLS_INTERACTION_FAILED will be returned with an error that contains a IO_ERROR_CANCELLED error code.

Since glibmm 2.30:

Parameters

  result | The result passed to the callback.

Returns
  The status of the ask password interaction.

virtual TlsInteractionResult Gio::TlsInteraction::ask_password_finish_vfunc | ( | const Glib::RefPtr< AsyncResult >& | result | ) |

virtual

Exceptions

  Glib::Error. |

virtual TlsInteractionResult Gio::TlsInteraction::ask_password_vfunc | ( | const Glib::RefPtr< TlsPassword >& | password,
|  | const Glib::RefPtr< Cancellable >& | cancellable
| ) |  |

virtual

Exceptions

  Glib::Error. |

static GType Gio::TlsInteraction::get_type | ( |  | ) |

static

Get the GType for this class, for use with the underlying GObject type system.

GTlsInteraction* Gio::TlsInteraction::gobj | ( |  | ) |

inline

Provides access to the underlying C GObject.

const GTlsInteraction* Gio::TlsInteraction::gobj | ( |  | ) | const

inline

Provides access to the underlying C GObject.

GTlsInteraction* Gio::TlsInteraction::gobj_copy | ( |  | ) |

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

TlsInteractionResult Gio::TlsInteraction::invoke_ask_password | ( | const Glib::RefPtr< TlsPassword >& | password,
|  | const Glib::RefPtr< Cancellable >& | cancellable
| ) |  |

Invoke the interaction to ask the user for a password.

It invokes this interaction in the main loop, specifically the MainContext returned by Glib::main_context_get_thread_default() when the interaction is created. This is called by called by TlsConnection or TlsDatabase to ask the user for a password.

Derived subclasses usually implement a password prompt, although they may also choose to provide a password from elsewhere. The password value will be filled in and then callback will be called. Alternatively the user may abort this password request, which will usually abort the TLS connection.

The implementation can either be a synchronous (eg: modal dialog) or an asynchronous one (eg: modeless dialog). This function will take care of calling which ever one correctly.

If the interaction is cancelled by the cancellation object, or by the user then TLS_INTERACTION_FAILED will be returned with an error that contains a IO_ERROR_CANCELLED error code. Certain implementations may not support immediate cancellation.

Since glibmm 2.30:

Parameters

  password | A TlsPassword object.
  cancellable | An optional Cancellable cancellation object.

Returns
  The status of the ask password interaction.

TlsInteractionResult Gio::TlsInteraction::invoke_ask_password | ( | const Glib::RefPtr< TlsPassword >& | password | ) |

A invoke_ask_password() convenience overload.

## Friends And Related Function Documentation

Glib::RefPtr< Gio::TlsInteraction > wrap | ( | GTlsInteraction * | 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.