diff options
Diffstat (limited to 'libsylph/prefs_account.h')
| -rw-r--r-- | libsylph/prefs_account.h | 205 |
1 files changed, 205 insertions, 0 deletions
diff --git a/libsylph/prefs_account.h b/libsylph/prefs_account.h new file mode 100644 index 0000000..ad899f8 --- /dev/null +++ b/libsylph/prefs_account.h | |||
| @@ -0,0 +1,205 @@ | |||
| 1 | /* | ||
| 2 | * LibSylph -- E-Mail client library | ||
| 3 | * Copyright (C) 1999-2017 Hiroyuki Yamamoto | ||
| 4 | * | ||
| 5 | * This library is free software; you can redistribute it and/or | ||
| 6 | * modify it under the terms of the GNU Lesser General Public | ||
| 7 | * License as published by the Free Software Foundation; either | ||
| 8 | * version 2.1 of the License, or (at your option) any later version. | ||
| 9 | * | ||
| 10 | * This library 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 GNU | ||
| 13 | * Lesser General Public License for more details. | ||
| 14 | * | ||
| 15 | * You should have received a copy of the GNU Lesser General Public | ||
| 16 | * License along with this library; if not, write to the Free Software | ||
| 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 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 | #include "prefs.h" | ||
| 34 | |||
| 35 | typedef enum { | ||
| 36 | A_POP3, | ||
| 37 | A_APOP, /* deprecated */ | ||
| 38 | A_RPOP, /* deprecated */ | ||
| 39 | A_IMAP4, | ||
| 40 | A_NNTP, | ||
| 41 | A_LOCAL | ||
| 42 | } RecvProtocol; | ||
| 43 | |||
| 44 | typedef enum { | ||
| 45 | SIG_FILE, | ||
| 46 | SIG_COMMAND, | ||
| 47 | SIG_DIRECT | ||
| 48 | } SigType; | ||
| 49 | |||
| 50 | typedef enum { | ||
| 51 | SIGN_KEY_DEFAULT, | ||
| 52 | SIGN_KEY_BY_FROM, | ||
| 53 | SIGN_KEY_CUSTOM | ||
| 54 | } SignKeyType; | ||
| 55 | |||
| 56 | struct _PrefsAccount | ||
| 57 | { | ||
| 58 | gchar *account_name; | ||
| 59 | |||
| 60 | /* Personal info */ | ||
| 61 | gchar *name; | ||
| 62 | gchar *address; | ||
| 63 | gchar *organization; | ||
| 64 | |||
| 65 | /* Server info */ | ||
| 66 | RecvProtocol protocol; | ||
| 67 | gchar *recv_server; | ||
| 68 | gchar *smtp_server; | ||
| 69 | gchar *nntp_server; | ||
| 70 | gboolean use_nntp_auth; | ||
| 71 | gchar *userid; | ||
| 72 | gchar *passwd; | ||
| 73 | |||
| 74 | /* SSL */ | ||
| 75 | gint ssl_pop; | ||
| 76 | gint ssl_imap; | ||
| 77 | gint ssl_nntp; | ||
| 78 | gint ssl_smtp; | ||
| 79 | gboolean use_nonblocking_ssl; | ||
| 80 | |||
| 81 | /* Temporarily preserved password */ | ||
| 82 | gchar *tmp_pass; | ||
| 83 | |||
| 84 | /* Receive */ | ||
| 85 | gboolean use_apop_auth; | ||
| 86 | gboolean rmmail; | ||
| 87 | gint msg_leave_time; | ||
| 88 | gboolean getall; | ||
| 89 | gboolean enable_size_limit; | ||
| 90 | gint size_limit; | ||
| 91 | gboolean filter_on_recv; | ||
| 92 | gchar *inbox; | ||
| 93 | |||
| 94 | gboolean imap_check_inbox_only; | ||
| 95 | gboolean imap_filter_inbox_on_recv; | ||
| 96 | gint imap_auth_type; | ||
| 97 | |||
| 98 | gint max_nntp_articles; | ||
| 99 | |||
| 100 | gboolean recv_at_getall; | ||
| 101 | |||
| 102 | /* Send */ | ||
| 103 | gboolean add_date; | ||
| 104 | gboolean gen_msgid; | ||
| 105 | gboolean add_customhdr; | ||
| 106 | gboolean use_smtp_auth; | ||
| 107 | SMTPAuthType smtp_auth_type; | ||
| 108 | gchar *smtp_userid; | ||
| 109 | gchar *smtp_passwd; | ||
| 110 | |||
| 111 | /* Temporarily preserved password */ | ||
| 112 | gchar *tmp_smtp_pass; | ||
| 113 | |||
| 114 | gboolean pop_before_smtp; | ||
| 115 | |||
| 116 | GSList *customhdr_list; | ||
| 117 | |||
| 118 | /* Compose */ | ||
| 119 | SigType sig_type; | ||
| 120 | gchar *sig_path; | ||
| 121 | gchar *sig_text; | ||
| 122 | gboolean set_autocc; | ||
| 123 | gchar *auto_cc; | ||
| 124 | gboolean set_autobcc; | ||
| 125 | gchar *auto_bcc; | ||
| 126 | gboolean set_autoreplyto; | ||
| 127 | gchar *auto_replyto; | ||
| 128 | |||
| 129 | /* Privacy */ | ||
| 130 | gboolean default_sign; | ||
| 131 | gboolean default_encrypt; | ||
| 132 | gboolean ascii_armored; | ||
| 133 | gboolean clearsign; | ||
| 134 | gboolean encrypt_reply; | ||
| 135 | |||
| 136 | SignKeyType sign_key; | ||
| 137 | gchar *sign_key_id; | ||
| 138 | |||
| 139 | /* Advanced */ | ||
| 140 | gboolean set_smtpport; | ||
| 141 | gushort smtpport; | ||
| 142 | gboolean set_popport; | ||
| 143 | gushort popport; | ||
| 144 | gboolean set_imapport; | ||
| 145 | gushort imapport; | ||
| 146 | gboolean set_nntpport; | ||
| 147 | gushort nntpport; | ||
| 148 | gboolean set_domain; | ||
| 149 | gchar *domain; | ||
| 150 | |||
| 151 | gchar *imap_dir; | ||
| 152 | gboolean imap_clear_cache_on_exit; | ||
| 153 | |||
| 154 | gboolean set_sent_folder; | ||
| 155 | gchar *sent_folder; | ||
| 156 | gboolean set_draft_folder; | ||
| 157 | gchar *draft_folder; | ||
| 158 | gboolean set_queue_folder; | ||
| 159 | gchar *queue_folder; | ||
| 160 | gboolean set_trash_folder; | ||
| 161 | gchar *trash_folder; | ||
| 162 | |||
| 163 | /* Default or not */ | ||
| 164 | gboolean is_default; | ||
| 165 | /* Unique account ID */ | ||
| 166 | gint account_id; | ||
| 167 | |||
| 168 | RemoteFolder *folder; | ||
| 169 | |||
| 170 | /* Compose */ | ||
| 171 | gboolean sig_before_quote; | ||
| 172 | |||
| 173 | /* SOCKS proxy */ | ||
| 174 | gboolean use_socks; | ||
| 175 | gboolean use_socks_for_recv; | ||
| 176 | gboolean use_socks_for_send; | ||
| 177 | gint socks_type; | ||
| 178 | gchar *proxy_host; | ||
| 179 | gushort proxy_port; | ||
| 180 | gboolean use_proxy_auth; | ||
| 181 | gchar *proxy_name; | ||
| 182 | gchar *proxy_pass; | ||
| 183 | |||
| 184 | /* Privacy */ | ||
| 185 | gboolean encrypt_to_self; | ||
| 186 | |||
| 187 | /* Compose */ | ||
| 188 | gchar *sig_names[10]; | ||
| 189 | gchar *sig_texts[10]; | ||
| 190 | }; | ||
| 191 | |||
| 192 | PrefsAccount *prefs_account_new (void); | ||
| 193 | |||
| 194 | PrefsAccount *prefs_account_get_tmp_prefs (void); | ||
| 195 | void prefs_account_set_tmp_prefs (PrefsAccount *ac_prefs); | ||
| 196 | void prefs_account_apply_tmp_prefs (PrefsAccount *ac_prefs); | ||
| 197 | PrefParam *prefs_account_get_params (void); | ||
| 198 | |||
| 199 | void prefs_account_read_config (PrefsAccount *ac_prefs, | ||
| 200 | const gchar *label); | ||
| 201 | void prefs_account_write_config_all (GList *account_list); | ||
| 202 | |||
| 203 | void prefs_account_free (PrefsAccount *ac_prefs); | ||
| 204 | |||
| 205 | #endif /* __PREFS_ACCOUNT_H__ */ | ||
