1 /* vifm
2  * Copyright (C) 2001 Ken Steen.
3  * Copyright (C) 2011 xaizek.
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
18  */
19 
20 #ifndef VIFM__MODES__VISUAL_H__
21 #define VIFM__MODES__VISUAL_H__
22 
23 struct view_t;
24 
25 /* Generic submodes of the visual mode. */
26 typedef enum
27 {
28 	VS_NORMAL,  /* With initial clearing of selection. */
29 	VS_RESTORE, /* With restoring of previous selection if available. */
30 	VS_AMEND,   /* Amending existing selection. */
31 }
32 VisualSubmodes;
33 
34 /* Initializes visual mode. */
35 void modvis_init(void);
36 
37 /* Starts visual mode in a given submode. */
38 void modvis_enter(VisualSubmodes sub_mode);
39 
40 /* Leaves visual mode in various ways. */
41 void modvis_leave(int save_msg, int goto_top, int clear_selection);
42 
43 /* Should be used to ask visual mode to redraw file list correctly.
44  * Intended to be used after setting list position from side. */
45 void modvis_update(void);
46 
47 /* Kind of callback to allow starting searches from the module and rely on other
48  * modules.  Returns new value for status bar message flag, but when
49  * print_errors isn't requested can return -1 to indicate issues with the
50  * pattern. */
51 int modvis_find(struct view_t *view, const char pattern[], int backward,
52 		int print_errors);
53 
54 /* Formats concise description of current visual mode state.  Returns pointer
55  * to a statically allocated buffer. */
56 const char * modvis_describe(void);
57 
58 #endif /* VIFM__MODES__VISUAL_H__ */
59 
60 /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */
61 /* vim: set cinoptions+=t0 filetype=c : */
62