Simplify vflist_get_formatted()
[geeqie.git] / src / filefilter.h
1 /*
2  * Copyright (C) 2004 John Ellis
3  * Copyright (C) 2008 - 2016 The Geeqie Team
4  *
5  * Author: John Ellis
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License along
18  * with this program; if not, write to the Free Software Foundation, Inc.,
19  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20  */
21
22 #ifndef FILEFILTER_H
23 #define FILEFILTER_H
24
25
26 typedef struct _FilterEntry FilterEntry;
27 struct _FilterEntry {
28         gchar *key;
29         gchar *description;
30         gchar *extensions;
31         FileFormatClass file_class;
32         gboolean enabled;
33         gboolean writable;
34         gboolean allow_sidecar;
35 };
36
37 /**
38  * @headerfile filter_get_list
39  * you can change, but not add or remove entries from the returned list
40  */
41 GList *filter_get_list(void);
42 void filter_remove_entry(FilterEntry *fe);
43
44 void filter_add(const gchar *key, const gchar *description, const gchar *extensions, FileFormatClass file_class, gboolean writable, gboolean allow_sidecar, gboolean enabled);
45 void filter_add_unique(const gchar *description, const gchar *extensions, FileFormatClass file_class, gboolean writable, gboolean allow_sidecar, gboolean enabled);
46 void filter_add_defaults(void);
47 void filter_reset(void);
48 void filter_rebuild(void);
49 GList *filter_to_list(const gchar *extensions);
50
51 const gchar *registered_extension_from_path(const gchar *name);
52 gboolean filter_name_exists(const gchar *name);
53 gboolean filter_file_class(const gchar *name, FileFormatClass file_class);
54 FileFormatClass filter_file_get_class(const gchar *name);
55 gboolean filter_name_is_writable(const gchar *name);
56 gboolean filter_name_allow_sidecar(const gchar *name);
57
58 void filter_write_list(GString *outstr, gint indent);
59 void filter_load_file_type(const gchar **attribute_names, const gchar **attribute_values);
60
61
62 void sidecar_ext_parse(const gchar *text);
63 gchar *sidecar_ext_to_string(void);
64 GList *sidecar_ext_get_list(void);
65
66 #endif
67 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */