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