add Summary->Next/Prev labeled message
[claws.git] / src / prefs_account.h
1 /*
2  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3  * Copyright (C) 1999-2001 Hiroyuki Yamamoto
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18  */
19
20 #ifndef __PREFS_ACCOUNT_H__
21 #define __PREFS_ACCOUNT_H__
22
23 #ifdef HAVE_CONFIG_H
24 #  include "config.h"
25 #endif
26
27 #include <glib.h>
28
29 typedef struct _PrefsAccount    PrefsAccount;
30
31 #include "folder.h"
32
33 typedef enum {
34         A_POP3,
35         A_APOP,
36         A_RPOP,
37         A_IMAP4,
38         A_NNTP,
39         A_LOCAL
40 } RecvProtocol;
41
42 #if USE_GPGME
43 typedef enum {
44         SIGN_KEY_DEFAULT,
45         SIGN_KEY_BY_FROM,
46         SIGN_KEY_CUSTOM
47 } SignKeyType;
48 #endif /* USE_GPGME */
49
50 #if USE_SSL
51 typedef enum {
52         SSL_SMTP_NONE,
53         SSL_SMTP_TUNNEL,
54         SSL_SMTP_STARTTLS
55 } SSLSMTPType;
56 #endif /* USE_SSL */
57
58 struct _PrefsAccount
59 {
60         gchar *account_name;
61
62         /* Personal info */
63         gchar *name;
64         gchar *address;
65         gchar *organization;
66
67         /* Server info */
68         RecvProtocol protocol;
69         gchar *inbox;
70         gchar *recv_server;
71         gchar *smtp_server;
72         gchar *nntp_server;
73         gboolean use_nntp_auth;
74         gchar *userid;
75         gchar *passwd;
76
77         gchar * local_mbox;
78         gboolean use_mail_command;
79         gchar * mail_command;
80
81 #if USE_SSL
82         /* SSL */
83         gboolean ssl_pop;
84         gboolean ssl_imap;
85         SSLSMTPType ssl_smtp;
86 #endif /* USE_SSL */
87
88
89         /* Temporarily preserved password */
90         gchar *tmp_pass;
91
92         /* Receive */
93         gboolean rmmail;
94         gboolean getall;
95         gboolean recv_at_getall;
96         gboolean filter_on_recv;
97
98         gchar *imap_dir;
99
100         /* Send */
101         gboolean  add_date;
102         gboolean  gen_msgid;
103         gboolean  add_customhdr;
104         gboolean  set_autocc;
105         gchar    *auto_cc;
106         gboolean  set_autobcc;
107         gchar    *auto_bcc;
108         gboolean  set_autoreplyto;
109         gchar    *auto_replyto;
110         gboolean use_smtp_auth;
111         gboolean pop_before_smtp;
112
113         GSList *customhdr_list;
114
115         /* Compose */
116         gchar *sig_path;
117
118 #if USE_GPGME
119         /* Privacy */
120         SignKeyType sign_key;
121         gchar *sign_key_id;
122 #endif /* USE_GPGME */
123
124         /* Advanced */
125         gboolean  set_smtpport;
126         gushort   smtpport;
127         gboolean  set_popport;
128         gushort   popport;
129         gboolean  set_imapport;
130         gushort   imapport;
131         gboolean  set_nntpport;
132         gushort   nntpport;
133         gboolean  set_domain;
134         gchar    *domain;
135
136         /* Default or not */
137         gboolean is_default;
138         /* Unique account ID */
139         gint account_id;
140
141         RemoteFolder *folder;
142 };
143
144 void prefs_account_read_config          (PrefsAccount   *ac_prefs,
145                                          const gchar    *label);
146 void prefs_account_save_config          (PrefsAccount   *ac_prefs);
147 void prefs_account_save_config_all      (GList          *account_list);
148 void prefs_account_free                 (PrefsAccount   *ac_prefs);
149 PrefsAccount *prefs_account_open        (PrefsAccount   *ac_prefs);
150
151 #endif /* __PREFS_ACCOUNT_H__ */