Add support for tab-completion when selecting by rule
[alpine.git] / pith / handle.h
blobdcce14620130f18e6d4365067d19bba2d6a40a0b
1 /*
2 * $Id: handle.h 814 2007-11-14 18:39:28Z hubert@u.washington.edu $
4 * ========================================================================
5 * Copyright 2013-2022 Eduardo Chappa
6 * Copyright 2006-2007 University of Washington
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 PITH_HANDLE_INCLUDED
18 #define PITH_HANDLE_INCLUDED
21 #include "../pith/context.h"
22 #include "../pith/msgno.h"
23 #include "../pith/atttype.h"
24 #include "../pith/util.h"
25 #include "../pith/icaltype.h"
27 typedef struct screen_position_list {
28 Pos where;
29 struct screen_position_list *next;
30 } POSLIST_S;
34 * Struct to help manage embedded urls (and anythin' else we might embed)
36 typedef struct handle_s {
37 int key; /* tag number embedded in text */
38 enum {URL, iCal, Attach, Folder, Function, IMG, imgData} type;
39 unsigned force_display:1; /* Don't ask before launching */
40 unsigned using_is_used:1; /* bit below is being used */
41 unsigned is_used:1; /* if not, remove it from list */
42 unsigned color_unseen:1; /* we're coloring folders with unseen */
43 unsigned color_folder:1; /* and just folders for that matter... */
44 unsigned is_dual_do_open:1; /* choosing this handle means open */
45 union {
46 struct { /* URL corresponding to this handle */
47 char *path, /* Actual url string */
48 *tool, /* displaying application */
49 *name; /* URL's NAME attribute */
50 } url; /* stuff to describe URL handle */
51 struct {
52 char *src, /* src of image [cid:, data:] */
53 *alt, /* image alternate text */
54 *tool; /* program to display data: */
55 } img; /* stuff to describe img */
56 ATTACH_S *attach; /* Attachment struct for this handle */
57 struct {
58 ATTACH_S *attach; /* full Calendar entry */
59 int depth; /* which event to display */
60 } ical;
61 struct {
62 int index; /* folder's place in context's list */
63 CONTEXT_S *context; /* description of folders */
64 } f; /* stuff to describe Folder handle */
65 struct {
66 struct { /* function and args to pass it */
67 MAILSTREAM *stream;
68 MSGNO_S *msgmap;
69 long msgno;
70 } args;
71 void (*f)(MAILSTREAM *, MSGNO_S *, long);
72 } func;
73 } h;
74 POSLIST_S *loc; /* list of places it exists in text */
75 struct handle_s *next, *prev; /* next and previous in the list */
76 } HANDLE_S ;
81 * Function used to dispatch locally handled URL's
83 typedef int (*url_tool_t)(char *);
86 /* exported prototypes */
87 HANDLE_S *get_handle(HANDLE_S *, int);
88 void init_handles(HANDLE_S **);
89 HANDLE_S *new_handle(HANDLE_S **);
90 void delete_unused_handles(HANDLE_S **);
91 void free_handle(HANDLE_S **);
92 void free_handles(HANDLE_S **);
93 void free_handle_locations(POSLIST_S **);
96 #endif /* PITH_HANDLE_INCLUDED */