mutt stable branch with some hacks
1/*
2 * Copyright (C) 1996-2000 Michael R. Elkins <me@mutt.org>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 */
18
19/* common protos for compose / attach menus */
20
21#ifndef _ATTACH_H_
22#define _ATTACH_H_ 1
23
24#include "mutt_menu.h"
25
26typedef struct attachptr
27{
28 BODY *content;
29 FILE *fp; /* used in the recvattach menu. */
30 int parent_type;
31 char *tree;
32 int level;
33 int num;
34 unsigned int unowned : 1; /* don't unlink on detach */
35 unsigned int decrypted : 1; /* not part of message as stored in the hdr->content. */
36} ATTACHPTR;
37
38typedef struct attach_ctx
39{
40 HEADER *hdr; /* used by recvattach for updating */
41 FILE *root_fp; /* used by recvattach for updating */
42
43 ATTACHPTR **idx;
44 short idxlen;
45 short idxmax;
46
47 short *v2r; /* mapping from virtual to real attachment */
48 short vcount; /* the number of virtual attachments */
49
50 FILE **fp_idx; /* Extra FILE* used for decryption */
51 short fp_len;
52 short fp_max;
53
54 BODY **body_idx; /* Extra BODY* used for decryption */
55 short body_len;
56 short body_max;
57} ATTACH_CONTEXT;
58
59void mutt_attach_init (ATTACH_CONTEXT *);
60void mutt_update_tree (ATTACH_CONTEXT *);
61int mutt_view_attachment (FILE*, BODY *, int, HEADER *, ATTACH_CONTEXT *);
62
63int mutt_tag_attach (MUTTMENU *menu, int n, int m);
64int mutt_attach_display_loop (MUTTMENU *menu, int op, HEADER *hdr,
65 ATTACH_CONTEXT *acvtx, int recv);
66
67
68void mutt_save_attachment_list (ATTACH_CONTEXT *actx, FILE *fp, int tag, BODY *top, HEADER *hdr, MUTTMENU *menu);
69void mutt_pipe_attachment_list (ATTACH_CONTEXT *actx, FILE *fp, int tag, BODY *top, int filter);
70void mutt_print_attachment_list (ATTACH_CONTEXT *actx, FILE *fp, int tag, BODY *top);
71
72void mutt_attach_bounce (FILE *, HEADER *, ATTACH_CONTEXT *, BODY *);
73void mutt_attach_resend (FILE *, HEADER *, ATTACH_CONTEXT *, BODY *);
74void mutt_attach_forward (FILE *, HEADER *, ATTACH_CONTEXT *, BODY *);
75void mutt_attach_reply (FILE *, HEADER *, ATTACH_CONTEXT *, BODY *, int);
76void mutt_attach_mail_sender (FILE *, HEADER *, ATTACH_CONTEXT *, BODY *);
77
78void mutt_actx_add_attach (ATTACH_CONTEXT *actx, ATTACHPTR *attach);
79void mutt_actx_add_fp (ATTACH_CONTEXT *actx, FILE *new_fp);
80void mutt_actx_add_body (ATTACH_CONTEXT *actx, BODY *new_body);
81void mutt_actx_free_entries (ATTACH_CONTEXT *actx);
82void mutt_free_attach_context (ATTACH_CONTEXT **pactx);
83
84/* This function is also used in send.c for inline-forwarding attachments */
85void mutt_generate_recvattach_list (ATTACH_CONTEXT *actx, HEADER *hdr, BODY *parts,
86 FILE *fp, int parent_type, int level, int decrypted);
87
88#endif /* _ATTACH_H_ */