1
/* Copyright 2011-2012 Yorba Foundation
3
* This software is licensed under the GNU Lesser General Public License
4
* (version 2.1 or later). See the COPYING file in this distribution.
7
public interface Geary.CredentialsMediator : Object {
14
public enum ServiceFlag {
18
public bool has_imap() {
19
return (this & IMAP) == IMAP;
22
public bool has_smtp() {
23
return (this & SMTP) == SMTP;
28
* Query the key store for the password of the given username for the given
29
* service. Return null if the password wasn't in the key store, or the
32
public abstract async string? get_password_async(Service service, string username) throws Error;
35
* Add or update the key store's password entry for the given credentials
36
* for the given service.
38
public abstract async void set_password_async(Service service,
39
Geary.Credentials credentials) throws Error;
42
* Deletes the key store's password entry for the given credentials for the
43
* given service. Do nothing (and do *not* throw an error) if the
44
* credentials weren't in the key store.
46
public abstract async void clear_password_async(Service service, string username) throws Error;
49
* Prompt the user to enter passwords for the given services in the given
50
* account. Set the out parameters for the services to the values entered
51
* by the user (out parameters for services not being prompted for are
52
* ignored). Return false if the user tried to cancel the interaction, or
53
* true if they tried to proceed.
55
public abstract async bool prompt_passwords_async(ServiceFlag services,
56
AccountInformation account_information,
57
out string? imap_password, out string? smtp_password,
58
out bool imap_remember_password, out bool smtp_remember_password) throws Error;