2 * $Id: mailview.h 1074 2008-06-04 00:08:43Z hubert@u.washington.edu $
4 * ========================================================================
5 * Copyright 2006-2008 University of Washington
6 * Copyright 2013-2018 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_MAILVIEW_INCLUDED
18 #define PINE_MAILVIEW_INCLUDED
22 #include "../pith/mailview.h"
25 #include "../pith/handle.h"
26 #include "../pith/store.h"
27 #include "../pith/bitmap.h"
31 * display_output_file mode flags
38 #define STYLE_NAME(s) ((s)->text.desc ? (s)->text.desc : "text")
42 * Struct defining scrolltool operating parameters.
44 typedef struct scrolltool_s
{
45 struct { /* Data and its attributes to scroll */
46 void *text
; /* what to scroll */
47 SourceType src
; /* it's form (char **,char *,FILE *) */
48 char *desc
; /* Description of "type" of data shown */
49 HANDLE_S
*handles
; /* embedded data descriptions */
51 struct { /* titlebar state */
52 char *title
; /* screen's title */
53 TitleBarType style
; /* it's type */
56 struct { /* screen's keymenu/command bindings */
57 struct key_menu
*menu
;
60 void (*each_cmd
)(struct scrolltool_s
*, int);
62 struct { /* help for this attachment */
63 HelpType text
; /* help text */
64 char *title
; /* title for help screen */
67 int (*click
)(struct scrolltool_s
*);
68 int (*clickclick
)(struct scrolltool_s
*);
71 * For systems that support it, allow caller to do popup menu
73 int (*popup
)(struct scrolltool_s
*, int);
76 struct { /* where to start paging from */
77 enum {FirstPage
= 0, LastPage
, Fragment
, Offset
, Handle
} on
;
79 char *frag
; /* fragment in html text to start on */
83 struct { /* Non-default Command Processor */
84 int (*tool
)(int, MSGNO_S
*, struct scrolltool_s
*);
85 /* The union below is opaque as far as scrolltool itself is
86 * concerned, but is provided as a container to pass data
87 * between the scrolltool caller and the given "handler"
88 * callback (or any other callback that takes a scrolltool_s *).
95 /* End of page processing */
96 int (*end_scroll
)(struct scrolltool_s
*);
97 /* Handler for invalid command input */
98 int (*bogus_input
)(UCS
);
99 unsigned resize_exit
:1; /* Return from scrolltool if resized */
100 unsigned body_valid
:1; /* Screen's body already displayed */
101 unsigned no_stat_msg
:1; /* Don't display status messages */
102 unsigned vert_handle
:1; /* hunt up and down on arrows/ctrl-[np] */
103 unsigned srch_handle
:1; /* search to next handle */
104 unsigned quell_help
:1; /* Don't show handle nav help message */
105 unsigned quell_newmail
:1; /* Don't check for new mail */
106 unsigned quell_first_view
:1; /* Don't act special first time through */
107 unsigned jump_is_debug
:1;
108 unsigned use_indexline_color
:1;
112 /* exported protoypes */
113 void mail_view_screen(struct pine
*);
114 url_tool_t
url_local_handler(char *);
115 int url_local_mailto(char *);
116 int url_local_mailto_and_atts(char *, PATMT
*);
117 int url_local_fragment(char *);
118 int scrolltool(SCROLL_S
*);
119 int ng_scroll_edit(CONTEXT_S
*, int);
120 int folder_select_update(CONTEXT_S
*, int);
121 int scroll_add_listmode(CONTEXT_S
*, int);
122 void display_output_file(char *, char *, char *, int);
123 int rfc2369_editorial(long, HANDLE_S
**, int, int, gf_io_t
);
124 void view_writec_init(STORE_S
*, HANDLE_S
**, int, int);
125 void view_writec_destroy(void);
126 int view_writec(int);
129 #endif /* PINE_MAILVIEW_INCLUDED */