root / src / prefs_account.h @ 1
History | View | Annotate | Download (3.5 kB)
| 1 | /*
|
|---|---|
| 2 | * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client |
| 3 | * Copyright (C) 1999-2004 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 | #include "smtp.h" |
| 33 | |
| 34 | typedef enum { |
| 35 | A_POP3, |
| 36 | A_APOP, /* deprecated */
|
| 37 | A_RPOP, /* deprecated */
|
| 38 | A_IMAP4, |
| 39 | A_NNTP, |
| 40 | A_LOCAL |
| 41 | } RecvProtocol; |
| 42 | |
| 43 | typedef enum { |
| 44 | SIG_FILE, |
| 45 | SIG_COMMAND, |
| 46 | SIG_DIRECT |
| 47 | } SigType; |
| 48 | |
| 49 | #if USE_GPGME
|
| 50 | typedef enum { |
| 51 | SIGN_KEY_DEFAULT, |
| 52 | SIGN_KEY_BY_FROM, |
| 53 | SIGN_KEY_CUSTOM |
| 54 | } SignKeyType; |
| 55 | #endif /* USE_GPGME */ |
| 56 | |
| 57 | struct _PrefsAccount
|
| 58 | {
|
| 59 | gchar *account_name; |
| 60 | |
| 61 | /* Personal info */
|
| 62 | gchar *name; |
| 63 | gchar *address; |
| 64 | gchar *organization; |
| 65 | |
| 66 | /* Server info */
|
| 67 | RecvProtocol protocol; |
| 68 | gchar *recv_server; |
| 69 | gchar *smtp_server; |
| 70 | gchar *nntp_server; |
| 71 | gboolean use_nntp_auth; |
| 72 | gchar *userid; |
| 73 | gchar *passwd; |
| 74 | |
| 75 | #if USE_SSL
|
| 76 | /* SSL */
|
| 77 | SSLType ssl_pop; |
| 78 | SSLType ssl_imap; |
| 79 | SSLType ssl_nntp; |
| 80 | SSLType ssl_smtp; |
| 81 | gboolean use_nonblocking_ssl; |
| 82 | #endif /* USE_SSL */ |
| 83 | |
| 84 | /* Temporarily preserved password */
|
| 85 | gchar *tmp_pass; |
| 86 | |
| 87 | /* Receive */
|
| 88 | gboolean use_apop_auth; |
| 89 | gboolean rmmail; |
| 90 | gint msg_leave_time; |
| 91 | gboolean getall; |
| 92 | gboolean recv_at_getall; |
| 93 | gboolean enable_size_limit; |
| 94 | gint size_limit; |
| 95 | gboolean filter_on_recv; |
| 96 | gchar *inbox; |
| 97 | |
| 98 | gint imap_auth_type; |
| 99 | |
| 100 | /* Send */
|
| 101 | gboolean add_date; |
| 102 | gboolean gen_msgid; |
| 103 | gboolean add_customhdr; |
| 104 | gboolean use_smtp_auth; |
| 105 | SMTPAuthType smtp_auth_type; |
| 106 | gchar *smtp_userid; |
| 107 | gchar *smtp_passwd; |
| 108 | |
| 109 | /* Temporarily preserved password */
|
| 110 | gchar *tmp_smtp_pass; |
| 111 | |
| 112 | gboolean pop_before_smtp; |
| 113 | |
| 114 | GSList *customhdr_list; |
| 115 | |
| 116 | /* Compose */
|
| 117 | SigType sig_type; |
| 118 | gchar *sig_path; |
| 119 | gboolean set_autocc; |
| 120 | gchar *auto_cc; |
| 121 | gboolean set_autobcc; |
| 122 | gchar *auto_bcc; |
| 123 | gboolean set_autoreplyto; |
| 124 | gchar *auto_replyto; |
| 125 | |
| 126 | #if USE_GPGME
|
| 127 | /* Privacy */
|
| 128 | gboolean default_encrypt; |
| 129 | gboolean default_sign; |
| 130 | gboolean ascii_armored; |
| 131 | gboolean clearsign; |
| 132 | SignKeyType sign_key; |
| 133 | gchar *sign_key_id; |
| 134 | #endif /* USE_GPGME */ |
| 135 | |
| 136 | /* Advanced */
|
| 137 | gboolean set_smtpport; |
| 138 | gushort smtpport; |
| 139 | gboolean set_popport; |
| 140 | gushort popport; |
| 141 | gboolean set_imapport; |
| 142 | gushort imapport; |
| 143 | gboolean set_nntpport; |
| 144 | gushort nntpport; |
| 145 | gboolean set_domain; |
| 146 | gchar *domain; |
| 147 | |
| 148 | gchar *imap_dir; |
| 149 | |
| 150 | gboolean set_sent_folder; |
| 151 | gchar *sent_folder; |
| 152 | gboolean set_draft_folder; |
| 153 | gchar *draft_folder; |
| 154 | gboolean set_trash_folder; |
| 155 | gchar *trash_folder; |
| 156 | |
| 157 | /* Default or not */
|
| 158 | gboolean is_default; |
| 159 | /* Unique account ID */
|
| 160 | gint account_id; |
| 161 | |
| 162 | RemoteFolder *folder; |
| 163 | }; |
| 164 | |
| 165 | PrefsAccount *prefs_account_new (void);
|
| 166 | |
| 167 | void prefs_account_read_config (PrefsAccount *ac_prefs,
|
| 168 | const gchar *label);
|
| 169 | void prefs_account_write_config_all (GList *account_list);
|
| 170 | |
| 171 | void prefs_account_free (PrefsAccount *ac_prefs);
|
| 172 | |
| 173 | PrefsAccount *prefs_account_open (PrefsAccount *ac_prefs); |
| 174 | |
| 175 | #endif /* __PREFS_ACCOUNT_H__ */ |