TnyPasswordGetter

TnyPasswordGetter — A type for asking the user for a password

Synopsis

                    TnyPasswordGetter;
                    TnyPasswordGetterIface;
const gchar*        tny_password_getter_get_password    (TnyPasswordGetter *self,
                                                         const gchar *aid,
                                                         const gchar *prompt,
                                                         gboolean *cancel);
void                tny_password_getter_forget_password (TnyPasswordGetter *self,
                                                         const gchar *aid);

Object Hierarchy

  GInterface
   +----TnyPasswordGetter

Known Implementations

TnyPasswordGetter is implemented by TnyGtkPasswordDialog.

Description

A type for asking the user for a password

Details

TnyPasswordGetter

typedef struct _TnyPasswordGetter TnyPasswordGetter;

Gets a password

free-function: g_object_unref


TnyPasswordGetterIface

typedef struct {
	GTypeInterface parent;

	const gchar* (*get_password) (TnyPasswordGetter *self, const gchar *aid, const gchar *prompt, gboolean *cancel);
	void (*forget_password) (TnyPasswordGetter *self, const gchar *aid);
} TnyPasswordGetterIface;


tny_password_getter_get_password ()

const gchar*        tny_password_getter_get_password    (TnyPasswordGetter *self,
                                                         const gchar *aid,
                                                         const gchar *prompt,
                                                         gboolean *cancel);

Get the password of self identified by aid. If you set the by reference boolean cancel to TRUE, the caller (who requested the password) will see this as a negative answer (For example when the user didn't know the password, and therefore pressed a cancel button).

The aid string can be used for so called password stores. It will contain a unique string. Possible values of this string are "acap.server.com" or the result of a tny_account_get_id(), or a combination of things.

self :

a TnyPasswordGetter

aid :

a unique string identifying the requested password

prompt :

(null-ok): A human-readable password question

cancel :

(out): by reference whether or not the user cancelled

Returns :

(null-ok) (caller-owns): the password

Since 1.0 audience: application-developer, type-implementer, platform-developer


tny_password_getter_forget_password ()

void                tny_password_getter_forget_password (TnyPasswordGetter *self,
                                                         const gchar *aid);

Forget the password in self identified by aid. This usually indicates that the password was wrong. A subsequent call to tny_password_getter_get_password() should not result in returning the same password anymore.

self :

a TnyPasswordGetter object

aid :

a unique string identifying the requested password

Since 1.0 audience: application-developer, type-implementer, platform-developer

See Also

TnyGtkPasswordDialog