2 * $Id: mailcmd.h 1012 2008-03-26 00:44:22Z hubert@u.washington.edu $
4 * ========================================================================
5 * Copyright 2006-2008 University of Washington
6 * Copyright 2013-2022 Eduardo Chappa
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * ========================================================================
17 #ifndef PINE_MAILCMD_INCLUDED
18 #define PINE_MAILCMD_INCLUDED
26 #include "../pith/mailcmd.h"
27 #include "../pith/mailindx.h"
28 #include "../pith/state.h"
29 #include "../pith/msgno.h"
30 #include "../pith/store.h"
31 #include "../pith/filter.h"
32 #include "../pith/string.h"
33 #include "../pith/hist.h"
36 #define USER_INPUT_TIMEOUT(ps) ((ps->hours_to_timeout > 0) && \
37 ((time(0) - time_of_last_input()) > 60*60*(ps->hours_to_timeout)))
40 #define GE_NONE 0x00 /* get_export_filename flags */
41 #define GE_IS_EXPORT 0x01 /* include EXPORT: in prompt */
42 #define GE_SEQ_SENSITIVE 0x02 /* Sensitive to seq # changes */
43 #define GE_NO_APPEND 0x04 /* No appending to file allowed */
44 #define GE_IS_IMPORT 0x08 /* No writing of file */
45 #define GE_ALLPARTS 0x10 /* Add AllParts toggle to options */
46 #define GE_BINARY 0x20 /* Enable binary download */
48 #define GER_NONE 0x00 /* get_export_filename return flags */
49 #define GER_OVER 0x01 /* overwrite of existing file */
50 #define GER_APPEND 0x02 /* append of existing file */
51 #define GER_ALLPARTS 0x04 /* AllParts toggle is on */
52 #define GER_BINARY 0x08 /* Binary download enabled */
55 #define CAC_NONE 0x00 /* flags for choose_a_charset */
56 #define CAC_ALL 0x01 /* choose from entire list */
57 #define CAC_POSTING 0x02 /* choose from charsets useful for posting */
58 #define CAC_DISPLAY 0x04 /* choose from charsets useful for display */
61 typedef enum {DontAsk
, NoDel
, Del
, RetNoDel
, RetDel
} SaveDel
;
62 typedef enum {DontAskPreserve
, NoPreserve
, Preserve
, RetNoPreserve
, RetPreserve
} SavePreserveOrder
;
64 typedef enum {View
, MsgIndx
, ThrdIndx
} CmdWhere
;
67 /* exported prototypes */
68 int alpine_get_data_prompt(char *, char *, size_t);
69 int alpine_get_password(char *, char *, size_t);
70 int alpine_smime_confirm_save(char *);
71 int smime_import_certificate(char *, char *, char *, size_t);
72 int process_cmd(struct pine
*, MAILSTREAM
*, MSGNO_S
*, int, CmdWhere
, int *);
73 char *pretty_command(UCS
);
74 void bogus_command(UCS
, char *);
75 void bogus_utf8_command(char *, char *);
76 int save_prompt(struct pine
*, CONTEXT_S
**, char *, size_t,
77 char *, ENVELOPE
*, long, char *, SaveDel
*,
79 int create_for_save_prompt(CONTEXT_S
*, char *, int);
80 int expunge_prompt(MAILSTREAM
*, char *, long);
81 int save_size_changed_prompt(long, int);
82 void expunge_and_close_begins(int, char *);
83 int simple_export(struct pine
*, void *, SourceType
, char *, char *);
84 int get_export_filename(struct pine
*, char *, char *, char *, size_t, char *,
85 char *, ESCKEY_S
*, int *, int, int, HISTORY_S
**);
86 char *build_updown_cmd(char *, size_t, char *, char *, char*);
87 int bezerk_delimiter(ENVELOPE
*, MESSAGECACHE
*, gf_o_t
, int);
88 long jump_to(MSGNO_S
*, int, UCS
, SCROLL_S
*, CmdWhere
);
89 char *broach_folder(int, int, int *, CONTEXT_S
**);
90 int ask_mailbox_reopen(struct pine
*, int *);
91 void visit_folder(struct pine
*, char *, CONTEXT_S
*, MAILSTREAM
*, unsigned long);
92 int select_by_current(struct pine
*, MSGNO_S
*, CmdWhere
);
93 int apply_command(struct pine
*, MAILSTREAM
*, MSGNO_S
*, UCS
, int, int);
94 char **choose_list_of_keywords(void);
95 char *choose_a_charset(int);
96 char **choose_list_of_charsets(void);
97 char *choose_item_from_list(char **, char **, char *, char *, HelpType
, char *, char *);
98 int display_folder_list(CONTEXT_S
**, char *, int,
99 int (*)(struct pine
*, CONTEXT_S
**, char *, int));
100 int file_lister(char *, char *, size_t, char *, size_t, int, int);
101 int read_msg_prompt(long, char *);
102 void advance_cur_after_delete(struct pine
*, MAILSTREAM
*, MSGNO_S
*, CmdWhere
);
103 void free_list_sel(LIST_SEL_S
**);
105 int header_mode_callback(int, long);
106 int zoom_mode_callback(int, long);
107 int any_selected_callback(int, long);
108 int flag_callback(int, long);
109 MPopup
*flag_submenu(MESSAGECACHE
*);
113 #endif /* PINE_MAILCMD_INCLUDED */