~ubuntu-branches/ubuntu/saucy/geary/saucy-updates

« back to all changes in this revision

Viewing changes to src/engine/api/geary-credentials-mediator.vala

  • Committer: Package Import Robot
  • Author(s): Sebastien Bacher
  • Date: 2013-03-14 13:48:23 UTC
  • mfrom: (1.1.3)
  • Revision ID: package-import@ubuntu.com-20130314134823-gyk5av1g508zyj8a
Tags: 0.3.0~pr1-0ubuntu1
New upstream version (FFE lp: #1154316), supports multiple account as
well as full conversation views with inline replies

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright 2011-2012 Yorba Foundation
 
2
 *
 
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.
 
5
 */
 
6
 
 
7
public interface Geary.CredentialsMediator : Object {
 
8
    public enum Service {
 
9
        IMAP,
 
10
        SMTP;
 
11
    }
 
12
    
 
13
    [Flags]
 
14
    public enum ServiceFlag {
 
15
        IMAP,
 
16
        SMTP;
 
17
        
 
18
        public bool has_imap() {
 
19
            return (this & IMAP) == IMAP;
 
20
        }
 
21
        
 
22
        public bool has_smtp() {
 
23
            return (this & SMTP) == SMTP;
 
24
        }
 
25
    }
 
26
    
 
27
    /**
 
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
 
30
     * password if it was.
 
31
     */
 
32
    public abstract async string? get_password_async(Service service, string username) throws Error;
 
33
    
 
34
    /**
 
35
     * Add or update the key store's password entry for the given credentials
 
36
     * for the given service.
 
37
     */
 
38
    public abstract async void set_password_async(Service service,
 
39
        Geary.Credentials credentials) throws Error;
 
40
    
 
41
    /**
 
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.
 
45
     */
 
46
    public abstract async void clear_password_async(Service service, string username) throws Error;
 
47
    
 
48
    /**
 
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.
 
54
     */
 
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;
 
59
}