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-2021 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 */
66 UCS (*decode_aux_rv_value
)(void *, void *); /* transforms a reply to a command */
67 int (*aux_condition
)(void *); /* has the condition been met to execute aux_function, 0 = success */
68 void (*aux_function
)(void *, void *); /* auxiliary function to help us decide what to do */
69 void *aux_value
; /* argument of aux_function */
70 void *aux_rv_value
; /* the return value of aux_function in (void *) */
72 int (*click
)(struct scrolltool_s
*);
73 int (*clickclick
)(struct scrolltool_s
*);
76 * For systems that support it, allow caller to do popup menu
78 int (*popup
)(struct scrolltool_s
*, int);
81 struct { /* where to start paging from */
82 enum {FirstPage
= 0, LastPage
, Fragment
, Offset
, Handle
} on
;
84 char *frag
; /* fragment in html text to start on */
88 struct { /* Non-default Command Processor */
89 int (*tool
)(int, MSGNO_S
*, struct scrolltool_s
*);
90 /* The union below is opaque as far as scrolltool itself is
91 * concerned, but is provided as a container to pass data
92 * between the scrolltool caller and the given "handler"
93 * callback (or any other callback that takes a scrolltool_s *).
100 /* End of page processing */
101 int (*end_scroll
)(struct scrolltool_s
*);
102 /* Handler for invalid command input */
103 int (*bogus_input
)(UCS
);
104 unsigned resize_exit
:1; /* Return from scrolltool if resized */
105 unsigned body_valid
:1; /* Screen's body already displayed */
106 unsigned no_stat_msg
:1; /* Don't display status messages */
107 unsigned vert_handle
:1; /* hunt up and down on arrows/ctrl-[np] */
108 unsigned srch_handle
:1; /* search to next handle */
109 unsigned quell_help
:1; /* Don't show handle nav help message */
110 unsigned quell_newmail
:1; /* Don't check for new mail */
111 unsigned quell_first_view
:1; /* Don't act special first time through */
112 unsigned jump_is_debug
:1;
113 unsigned use_indexline_color
:1;
117 /* exported prototypes */
118 char *get_url_external_handler(char *, int);
119 int do_url_launch(char *, char *);
120 int do_imgdata_open(char *, char *);
121 void mail_view_screen(struct pine
*);
122 url_tool_t
url_local_handler(char *);
123 int url_local_mailto(char *);
124 int url_local_mailto_and_atts(char *, PATMT
*);
125 int url_local_fragment(char *);
126 int scrolltool(SCROLL_S
*);
127 int ng_scroll_edit(CONTEXT_S
*, int);
128 int folder_select_update(CONTEXT_S
*, int);
129 int scroll_add_listmode(CONTEXT_S
*, int);
130 void display_output_file(char *, char *, char *, int);
131 int rfc2369_editorial(long, HANDLE_S
**, int, int, gf_io_t
);
132 void view_writec_init(STORE_S
*, HANDLE_S
**, int, int);
133 void view_writec_destroy(void);
134 int view_writec(int);
137 #endif /* PINE_MAILVIEW_INCLUDED */