summaryrefslogtreecommitdiff
path: root/src/conf/overrides.rs
blob: 22e2bf6441d121b45ccb82da063e578824d692e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
/*
 * meli - conf/overrides.rs
 *
 * Copyright 2020 Manos Pitsidianakis
 *
 * This file is part of meli.
 *
 * meli is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * meli is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with meli. If not, see <http://www.gnu.org/licenses/>.
 */

#![allow(clippy::derivable_impls)]

//! This module is automatically generated by config_macros.rs.
use super::*;

#[derive(Debug, Serialize, Deserialize, Clone)]
#[serde(deny_unknown_fields)]
pub struct PagerSettingsOverride {
    #[doc = " Number of context lines when going to next page."]
    #[doc = " Default: 0"]
    #[serde(alias = "pager-context")]
    #[serde(default)]
    pub pager_context: Option<usize>,
    #[doc = " Stop at the end instead of displaying next mail."]
    #[doc = " Default: false"]
    #[serde(alias = "pager-stop")]
    #[serde(default)]
    pub pager_stop: Option<bool>,
    #[doc = " Always show headers when scrolling."]
    #[doc = " Default: true"]
    #[serde(alias = "headers-sticky")]
    #[serde(default)]
    pub headers_sticky: Option<bool>,
    #[doc = " The height of the pager in mail view, in percent."]
    #[doc = " Default: 80"]
    #[serde(alias = "pager-ratio")]
    #[serde(default)]
    pub pager_ratio: Option<usize>,
    #[doc = " A command to pipe mail output through for viewing in pager."]
    #[doc = " Default: None"]
    #[serde(deserialize_with = "non_empty_string")]
    #[serde(default)]
    pub filter: Option<Option<String>>,
    #[doc = " A command to pipe html output before displaying it in a pager"]
    #[doc = " Default: None"]
    #[serde(deserialize_with = "non_empty_string", alias = "html-filter")]
    #[serde(default)]
    pub html_filter: Option<Option<String>>,
    #[doc = " Respect \"format=flowed\""]
    #[doc = " Default: true"]
    #[serde(alias = "format-flowed")]
    #[serde(default)]
    pub format_flowed: Option<bool>,
    #[doc = " Split long lines that would overflow on the x axis."]
    #[doc = " Default: true"]
    #[serde(alias = "split-long-lines")]
    #[serde(default)]
    pub split_long_lines: Option<bool>,
    #[doc = " Minimum text width in columns."]
    #[doc = " Default: 80"]
    #[serde(alias = "minimum-width")]
    #[serde(default)]
    pub minimum_width: Option<usize>,
    #[doc = " Choose `text/html` alternative if `text/plain` is empty in `multipart/alternative`"]
    #[doc = " attachments."]
    #[doc = " Default: true"]
    #[serde(alias = "auto-choose-multipart-alternative")]
    #[serde(default)]
    pub auto_choose_multipart_alternative: Option<ToggleFlag>,
    #[doc = " Show Date: in my timezone"]
    #[doc = " Default: true"]
    #[serde(alias = "show-date-in-my-timezone")]
    #[serde(default)]
    pub show_date_in_my_timezone: Option<ToggleFlag>,
    #[doc = " A command to launch URLs with. The URL will be given as the first argument of the command."]
    #[doc = " Default: None"]
    #[serde(deserialize_with = "non_empty_string")]
    #[serde(default)]
    pub url_launcher: Option<Option<String>>,
    #[doc = " A command to open html files."]
    #[doc = " Default: None"]
    #[serde(deserialize_with = "non_empty_string", alias = "html-open")]
    #[serde(default)]
    pub html_open: Option<Option<String>>,
}
impl Default for PagerSettingsOverride {
    fn default() -> Self {
        PagerSettingsOverride {
            pager_context: None,
            pager_stop: None,
            headers_sticky: None,
            pager_ratio: None,
            filter: None,
            html_filter: None,
            format_flowed: None,
            split_long_lines: None,
            minimum_width: None,
            auto_choose_multipart_alternative: None,
            show_date_in_my_timezone: None,
            url_launcher: None,
            html_open: None,
        }
    }
}

#[derive(Debug, Serialize, Deserialize, Clone)]
#[serde(deny_unknown_fields)]
pub struct ListingSettingsOverride {
    #[doc = " Number of context lines when going to next page."]
    #[doc = " Default: 0"]
    #[serde(alias = "context-lines")]
    #[serde(default)]
    pub context_lines: Option<usize>,
    #[doc = "Show auto-hiding scrollbar in accounts sidebar menu."]
    #[doc = "Default: True"]
    #[serde(default)]
    pub show_menu_scrollbar: Option<bool>,
    #[doc = " Datetime formatting passed verbatim to strftime(3)."]
    #[doc = " Default: %Y-%m-%d %T"]
    #[serde(alias = "datetime-fmt")]
    #[serde(default)]
    pub datetime_fmt: Option<Option<String>>,
    #[doc = " Show recent dates as `X {minutes,hours,days} ago`, up to 7 days."]
    #[doc = " Default: true"]
    #[serde(alias = "recent-dates")]
    #[serde(default)]
    pub recent_dates: Option<bool>,
    #[doc = " Show only envelopes that match this query"]
    #[doc = " Default: None"]
    #[serde(default)]
    pub filter: Option<Option<Query>>,
    #[serde(alias = "index-style")]
    #[serde(default)]
    pub index_style: Option<IndexStyle>,
    #[doc = "Default: \" \""]
    #[serde(default)]
    pub sidebar_mailbox_tree_has_sibling: Option<Option<String>>,
    #[doc = "Default: \" \""]
    #[serde(default)]
    pub sidebar_mailbox_tree_no_sibling: Option<Option<String>>,
    #[doc = "Default: \" \""]
    #[serde(default)]
    pub sidebar_mailbox_tree_has_sibling_leaf: Option<Option<String>>,
    #[doc = "Default: \" \""]
    #[serde(default)]
    pub sidebar_mailbox_tree_no_sibling_leaf: Option<Option<String>>,
    #[doc = "Default: ' '"]
    #[serde(default)]
    pub sidebar_divider: Option<char>,
    #[doc = "Default: 90"]
    #[serde(default)]
    pub sidebar_ratio: Option<usize>,
    #[doc = " Flag to show if thread entry contains unseen mail."]
    #[doc = " Default: \"●\""]
    #[serde(default)]
    pub unseen_flag: Option<Option<String>>,
    #[doc = " Flag to show if thread has been snoozed."]
    #[doc = " Default: \"💤\""]
    #[serde(default)]
    pub thread_snoozed_flag: Option<Option<String>>,
    #[doc = " Flag to show if thread entry has been selected."]
    #[doc = " Default: \"☑\u{fe0f}\""]
    #[serde(default)]
    pub selected_flag: Option<Option<String>>,
    #[doc = " Flag to show if thread entry contains attachments."]
    #[doc = " Default: \"📎\""]
    #[serde(default)]
    pub attachment_flag: Option<Option<String>>,
    #[doc = " Should threads with differentiating Subjects show a list of those subjects on the entry"]
    #[doc = " title?"]
    #[doc = " Default: \"true\""]
    #[serde(default)]
    pub thread_subject_pack: Option<bool>,
}
impl Default for ListingSettingsOverride {
    fn default() -> Self {
        ListingSettingsOverride {
            context_lines: None,
            show_menu_scrollbar: None,
            datetime_fmt: None,
            recent_dates: None,
            filter: None,
            index_style: None,
            sidebar_mailbox_tree_has_sibling: None,
            sidebar_mailbox_tree_no_sibling: None,
            sidebar_mailbox_tree_has_sibling_leaf: None,
            sidebar_mailbox_tree_no_sibling_leaf: None,
            sidebar_divider: None,
            sidebar_ratio: None,
            unseen_flag: None,
            thread_snoozed_flag: None,
            selected_flag: None,
            attachment_flag: None,
            thread_subject_pack: None,
        }
    }
}

#[derive(Debug, Serialize, Deserialize, Clone)]
#[serde(deny_unknown_fields)]
pub struct NotificationsSettingsOverride {
    #[doc = " Enable notifications."]
    #[doc = " Default: True"]
    #[serde(default)]
    pub enable: Option<bool>,
    #[doc = " A command to pipe notifications through."]
    #[doc = " Default: None"]
    #[serde(default)]
    pub script: Option<Option<String>>,
    #[doc = " A command to pipe new mail notifications through (preferred over `script`)."]
    #[doc = " Default: None"]
    #[serde(default)]
    pub new_mail_script: Option<Option<String>>,
    #[doc = " A file location which has its size changed when new mail arrives (max 128 bytes). Can be"]
    #[doc = " used to trigger new mail notifications eg with `xbiff(1)`."]
    #[doc = " Default: None"]
    #[serde(alias = "xbiff-file-path")]
    #[serde(default)]
    pub xbiff_file_path: Option<Option<String>>,
    #[serde(alias = "play-sound")]
    #[serde(default)]
    pub play_sound: Option<ToggleFlag>,
    #[serde(alias = "sound-file")]
    #[serde(default)]
    pub sound_file: Option<Option<String>>,
}
impl Default for NotificationsSettingsOverride {
    fn default() -> Self {
        NotificationsSettingsOverride {
            enable: None,
            script: None,
            new_mail_script: None,
            xbiff_file_path: None,
            play_sound: None,
            sound_file: None,
        }
    }
}

#[derive(Debug, Serialize, Deserialize, Clone)]
#[serde(deny_unknown_fields)]
pub struct ShortcutsOverride {
    #[serde(default)]
    pub general: Option<GeneralShortcuts>,
    #[serde(default)]
    pub listing: Option<ListingShortcuts>,
    #[serde(default)]
    pub composing: Option<ComposingShortcuts>,
    #[serde(alias = "contact-list")]
    #[serde(default)]
    pub contact_list: Option<ContactListShortcuts>,
    #[serde(alias = "envelope-view")]
    #[serde(default)]
    pub envelope_view: Option<EnvelopeViewShortcuts>,
    #[serde(alias = "thread-view")]
    #[serde(default)]
    pub thread_view: Option<ThreadViewShortcuts>,
    #[serde(default)]
    pub pager: Option<PagerShortcuts>,
}
impl Default for ShortcutsOverride {
    fn default() -> Self {
        ShortcutsOverride {
            general: None,
            listing: None,
            composing: None,
            contact_list: None,
            envelope_view: None,
            thread_view: None,
            pager: None,
        }
    }
}

#[derive(Debug, Serialize, Deserialize, Clone)]
#[serde(deny_unknown_fields)]
pub struct ComposingSettingsOverride {
    #[doc = " A command to pipe new emails to"]
    #[doc = " Required"]
    #[serde(default)]
    pub send_mail: Option<SendMail>,
    #[doc = " Command to launch editor. Can have arguments. Draft filename is given as the last argument. If it's missing, the environment variable $EDITOR is looked up."]
    #[serde(alias = "editor-command", alias = "editor-cmd", alias = "editor_cmd")]
    #[serde(default)]
    pub editor_command: Option<Option<String>>,
    #[doc = " Embed editor (for terminal interfaces) instead of forking and waiting."]
    #[serde(default)]
    pub embed: Option<bool>,
    #[doc = " Set \"format=flowed\" in plain text attachments."]
    #[doc = " Default: true"]
    #[serde(alias = "format-flowed")]
    #[serde(default)]
    pub format_flowed: Option<bool>,
    #[doc = "Set User-Agent"]
    #[doc = "Default: empty"]
    #[serde(alias = "insert_user_agent")]
    #[serde(default)]
    pub insert_user_agent: Option<bool>,
    #[doc = " Set default header values for new drafts"]
    #[doc = " Default: empty"]
    #[serde(alias = "default-header-values")]
    #[serde(default)]
    pub default_header_values: Option<HashMap<String, String>>,
    #[doc = " Wrap header preample when editing a draft in an editor. This allows you to write non-plain"]
    #[doc = " text email without the preamble creating syntax errors. They are stripped when you return"]
    #[doc = " from the editor. The values should be a two element array of strings, a prefix and suffix."]
    #[doc = " Default: None"]
    #[serde(alias = "wrap-header-preample")]
    #[serde(default)]
    pub wrap_header_preamble: Option<Option<(String, String)>>,
    #[doc = " Store sent mail after successful submission. This setting is meant to be disabled for"]
    #[doc = " non-standard behaviour in gmail, which auto-saves sent mail on its own."]
    #[doc = " Default: true"]
    #[serde(default)]
    pub store_sent_mail: Option<bool>,
    #[doc = " The attribution line appears above the quoted reply text."]
    #[doc = " The format specifiers for the replied address are:"]
    #[doc = " - `%+f` — the sender's name and email address."]
    #[doc = " - `%+n` — the sender's name (or email address, if no name is included)."]
    #[doc = " - `%+a` — the sender's email address."]
    #[doc = " The format string is passed to strftime(3) with the replied envelope's date."]
    #[doc = " Default: \"On %a, %0e %b %Y %H:%M, %+f wrote:%n\""]
    #[serde(default)]
    pub attribution_format_string: Option<Option<String>>,
    #[doc = " Whether the strftime call for the attribution string uses the POSIX locale instead of"]
    #[doc = " the user's active locale"]
    #[doc = " Default: true"]
    #[serde(default)]
    pub attribution_use_posix_locale: Option<bool>,
    #[doc = " Forward emails as attachment? (Alternative is inline)"]
    #[doc = " Default: ask"]
    #[serde(alias = "forward-as-attachment")]
    #[serde(default)]
    pub forward_as_attachment: Option<ToggleFlag>,
    #[doc = " Alternative lists of reply prefixes (etc. [\"Re:\", \"RE:\", ...]) to strip"]
    #[doc = " Default: `[\"Re:\", \"RE:\", \"Fwd:\", \"Fw:\", \"回复:\", \"回覆:\", \"SV:\", \"Sv:\", \"VS:\", \"Antw:\", \"Doorst:\", \"VS:\", \"VL:\", \"REF:\", \"TR:\", \"TR:\", \"AW:\", \"WG:\", \"ΑΠ:\", \"Απ:\", \"απ:\", \"ΠΡΘ:\", \"Πρθ:\", \"πρθ:\", \"ΣΧΕΤ:\", \"Σχετ:\", \"σχετ:\", \"ΠΡΘ:\", \"Πρθ:\", \"πρθ:\", \"Vá:\", \"Továbbítás:\", \"R:\", \"I:\", \"RIF:\", \"FS:\", \"BLS:\", \"TRS:\", \"VS:\", \"VB:\", \"RV:\", \"RES:\", \"Res\", \"ENC:\", \"Odp:\", \"PD:\", \"YNT:\", \"İLT:\", \"ATB:\", \"YML:\"]`"]
    #[serde(alias = "reply-prefix-list-to-strip")]
    #[serde(default)]
    pub reply_prefix_list_to_strip: Option<Option<Vec<String>>>,
    #[doc = " The prefix to use in reply subjects. The de facto prefix is \"Re:\"."]
    #[serde(alias = "reply-prefix")]
    #[serde(default)]
    pub reply_prefix: Option<String>,
}
impl Default for ComposingSettingsOverride {
    fn default() -> Self {
        ComposingSettingsOverride {
            send_mail: None,
            editor_command: None,
            embed: None,
            format_flowed: None,
            insert_user_agent: None,
            default_header_values: None,
            wrap_header_preamble: None,
            store_sent_mail: None,
            attribution_format_string: None,
            attribution_use_posix_locale: None,
            forward_as_attachment: None,
            reply_prefix_list_to_strip: None,
            reply_prefix: None,
        }
    }
}

#[derive(Debug, Serialize, Deserialize, Clone)]
#[serde(deny_unknown_fields)]
pub struct TagsSettingsOverride {
    #[serde(deserialize_with = "tag_color_de")]
    #[serde(default)]
    pub colors: Option<HashMap<u64, Color>>,
    #[serde(deserialize_with = "tag_set_de", alias = "ignore-tags")]
    #[serde(default)]
    pub ignore_tags: Option<HashSet<u64>>,
}
impl Default for TagsSettingsOverride {
    fn default() -> Self {
        TagsSettingsOverride {
            colors: None,
            ignore_tags: None,
        }
    }
}

#[cfg(feature = "gpgme")]
#[derive(Debug, Serialize, Deserialize, Clone)]
#[serde(deny_unknown_fields)]
pub struct PGPSettingsOverride {
    #[doc = " auto verify signed e-mail according to RFC3156"]
    #[doc = " Default: true"]
    #[serde(alias = "auto-verify-signatures")]
    #[serde(default)]
    pub auto_verify_signatures: Option<bool>,
    #[doc = " auto decrypt encrypted e-mail"]
    #[doc = " Default: true"]
    #[serde(alias = "auto-decrypt")]
    #[serde(default)]
    pub auto_decrypt: Option<bool>,
    #[doc = " always sign sent e-mail"]
    #[doc = " Default: false"]
    #[serde(alias = "auto-sign")]
    #[serde(default)]
    pub auto_sign: Option<bool>,
    #[doc = " Auto encrypt sent e-mail"]
    #[doc = " Default: false"]
    #[serde(alias = "auto-encrypt")]
    #[serde(default)]
    pub auto_encrypt: Option<bool>,
    #[doc = " Default: None"]
    #[serde(alias = "sign-key")]
    #[serde(default)]
    pub sign_key: Option<Option<String>>,
    #[doc = " Default: None"]
    #[serde(alias = "decrypt-key")]
    #[serde(default)]
    pub decrypt_key: Option<Option<String>>,
    #[doc = " Default: None"]
    #[serde(alias = "encrypt-key")]
    #[serde(default)]
    pub encrypt_key: Option<Option<String>>,
    #[doc = " Allow remote lookups"]
    #[doc = " Default: None"]
    #[serde(alias = "allow-remote-lookups")]
    #[serde(default)]
    pub allow_remote_lookup: Option<ToggleFlag>,
    #[doc = " Remote lookup mechanisms."]
    #[doc = " Default: \"local,wkd\""]
    #[serde(alias = "remote-lookup-mechanisms")]
    #[serde(default)]
    pub remote_lookup_mechanisms: Option<melib::gpgme::LocateKey>,
}
#[cfg(feature = "gpgme")]
impl Default for PGPSettingsOverride {
    fn default() -> Self {
        PGPSettingsOverride {
            auto_verify_signatures: None,
            auto_decrypt: None,
            auto_sign: None,
            auto_encrypt: None,
            sign_key: None,
            decrypt_key: None,
            encrypt_key: None,
            allow_remote_lookup: None,
            remote_lookup_mechanisms: None,
        }
    }
}

#[cfg(not(feature = "gpgme"))]
#[derive(Debug, Serialize, Deserialize, Clone)]
#[serde(deny_unknown_fields)]
pub struct PGPSettingsOverride {}
#[cfg(not(feature = "gpgme"))]
impl Default for PGPSettingsOverride {
    fn default() -> Self {
        PGPSettingsOverride {}
    }
}