8d8f364c25975e44a0fa74541c8239b5a29dc2fe
[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 struct _PrefsAccount
51 {
52         gchar *account_name;
53
54         /* Personal info */
55         gchar *name;
56         gchar *address;
57         gchar *organization;
58
59         /* Server info */
60         RecvProtocol protocol;
61         gchar *inbox;
62         gchar *recv_server;
63         gchar *smtp_server;
64         gchar *nntp_server;
65         gboolean use_nntp_auth;
66         gchar *userid;
67         gchar *passwd;
68
69         gchar * local_mbox;
70         gboolean use_mail_command;
71         gchar * mail_command;
72
73         /* Temporarily preserved password */
74         gchar *tmp_pass;
75
76         /* Receive */
77         gboolean rmmail;
78         gboolean getall;
79         gboolean recv_at_getall;
80         gboolean filter_on_recv;
81
82         gchar *imap_dir;
83
84         /* Send */
85         gboolean  add_date;
86         gboolean  gen_msgid;
87         gboolean  add_customhdr;
88         gboolean  set_autocc;
89         gchar    *auto_cc;
90         gboolean  set_autobcc;
91         gchar    *auto_bcc;
92         gboolean  set_autoreplyto;
93         gchar    *auto_replyto;
94         gboolean use_smtp_auth;
95         gboolean pop_before_smtp;
96
97         GSList *customhdr_list;
98
99         /* Compose */
100         gchar *sig_path;
101
102 #if USE_GPGME
103         /* Privacy */
104         SignKeyType sign_key;
105         gchar *sign_key_id;
106 #endif /* USE_GPGME */
107
108         /* Advanced */
109         gboolean  set_smtpport;
110         gushort   smtpport;
111         gboolean  set_popport;
112         gushort   popport;
113         gboolean  set_imapport;
114         gushort   imapport;
115         gboolean  set_nntpport;
116         gushort   nntpport;
117         gboolean  set_domain;
118         gchar    *domain;
119 #if USE_SSL
120         gboolean  smtp_ssl;
121         gboolean  pop_ssl;
122         gboolean  imap_ssl;
123 #endif
124
125         /* Default or not */
126         gboolean is_default;
127         /* Unique account ID */
128         gint account_id;
129
130         RemoteFolder *folder;
131 };
132
133 void prefs_account_read_config          (PrefsAccount   *ac_prefs,
134                                          const gchar    *label);
135 void prefs_account_save_config          (PrefsAccount   *ac_prefs);
136 void prefs_account_save_config_all      (GList          *account_list);
137 void prefs_account_free                 (PrefsAccount   *ac_prefs);
138 PrefsAccount *prefs_account_open        (PrefsAccount   *ac_prefs);
139
140 #endif /* __PREFS_ACCOUNT_H__ */