f6b44fa30a86c8e5125c61e6d792ab75dbf3c44a
[claws.git] / src / prefs_account.h
1 /*
2  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3  * Copyright (C) 1999,2000 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         /* Send */
83         gboolean  add_date;
84         gboolean  gen_msgid;
85         gboolean  add_customhdr;
86         gboolean  set_autocc;
87         gchar    *auto_cc;
88         gboolean  set_autobcc;
89         gchar    *auto_bcc;
90         gboolean  set_autoreplyto;
91         gchar    *auto_replyto;
92         gboolean use_smtp_auth;
93         gboolean pop_before_smtp;
94
95         GSList *customhdr_list;
96
97         /* Compose */
98         gchar *sig_path;
99
100 #if USE_GPGME
101         /* Privacy */
102         SignKeyType sign_key;
103         gchar *sign_key_id;
104 #endif /* USE_GPGME */
105
106         /* Advanced */
107         gboolean  set_smtpport;
108         gushort   smtpport;
109         gboolean  set_popport;
110         gushort   popport;
111         gboolean  set_nntpport;
112         gushort   nntpport;
113         gboolean  set_domain;
114         gchar    *domain;
115
116         /* Default or not */
117         gboolean is_default;
118         /* Unique account ID */
119         gint account_id;
120
121         RemoteFolder *folder;
122 };
123
124 void prefs_account_read_config          (PrefsAccount   *ac_prefs,
125                                          const gchar    *label);
126 void prefs_account_save_config          (PrefsAccount   *ac_prefs);
127 void prefs_account_save_config_all      (GList          *account_list);
128 void prefs_account_free                 (PrefsAccount   *ac_prefs);
129 PrefsAccount *prefs_account_open        (PrefsAccount   *ac_prefs);
130
131 #endif /* __PREFS_ACCOUNT_H__ */