1 /**
2  * @file
3  * Pager functions
4  *
5  * @authors
6  * Copyright (C) 2021 Richard Russon <rich@flatcap.org>
7  *
8  * @copyright
9  * This program is free software: you can redistribute it and/or modify it under
10  * the terms of the GNU General Public License as published by the Free Software
11  * Foundation, either version 2 of the License, or (at your option) any later
12  * version.
13  *
14  * This program is distributed in the hope that it will be useful, but WITHOUT
15  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16  * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
17  * details.
18  *
19  * You should have received a copy of the GNU General Public License along with
20  * this program.  If not, see <http://www.gnu.org/licenses/>.
21  */
22 
23 #ifndef MUTT_PAGER_FUNCTIONS_H
24 #define MUTT_PAGER_FUNCTIONS_H
25 
26 #include <stdbool.h>
27 
28 struct IndexSharedData;
29 struct MuttWindow;
30 struct PagerPrivateData;
31 struct PagerView;
32 
33 /**
34  * @defgroup pager_function_api Pager Function API
35  *
36  * Prototype for a Pager Function
37  *
38  * @param shared Shared Index data
39  * @param priv   Private Index data
40  * @param op     Operation to perform, e.g. OP_MAIN_LIMIT
41  * @retval enum #IndexRetval
42  */
43 typedef int (*pager_function_t)(struct IndexSharedData *shared, struct PagerPrivateData *priv, int op);
44 
45 /**
46  * struct PagerFunction - A NeoMutt function
47  */
48 struct PagerFunction
49 {
50   int op;                    ///< Op code, e.g. OP_MAIN_LIMIT
51   pager_function_t function; ///< Function to call
52 };
53 
54 int pager_function_dispatcher(struct MuttWindow *win_index, int op);
55 bool jump_to_bottom(struct PagerPrivateData *priv, struct PagerView *pview);
56 
57 extern struct PagerFunction PagerFunctions[];
58 
59 #endif //MUTT_PAGER_FUNCTIONS_H
60