Deduplicate cr3 image loader
[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 #include <glib.h>
26
27 #include "typedefs.h"
28
29 struct FilterEntry {
30         gchar *key;
31         gchar *description;
32         gchar *extensions;
33         FileFormatClass file_class;
34         gboolean enabled;
35         gboolean writable;
36         gboolean allow_sidecar;
37 };
38
39 /**
40  * @headerfile filter_get_list
41  * you can change, but not add or remove entries from the returned list
42  */
43 GList *filter_get_list();
44 void filter_remove_entry(FilterEntry *fe);
45
46 void filter_add(const gchar *key, const gchar *description, const gchar *extensions, FileFormatClass file_class, gboolean writable, gboolean allow_sidecar, gboolean enabled);
47 void filter_add_unique(const gchar *description, const gchar *extensions, FileFormatClass file_class, gboolean writable, gboolean allow_sidecar, gboolean enabled);
48 void filter_add_defaults();
49 void filter_reset();
50 void filter_rebuild();
51 GList *filter_to_list(const gchar *extensions);
52
53 const gchar *registered_extension_from_path(const gchar *name);
54 gboolean filter_name_exists(const gchar *name);
55 gboolean filter_file_class(const gchar *name, FileFormatClass file_class);
56 FileFormatClass filter_file_get_class(const gchar *name);
57 gboolean filter_name_is_writable(const gchar *name);
58 gboolean filter_name_allow_sidecar(const gchar *name);
59
60 void filter_write_list(GString *outstr, gint indent);
61 void filter_load_file_type(const gchar **attribute_names, const gchar **attribute_values);
62
63
64 void sidecar_ext_parse(const gchar *text);
65 gchar *sidecar_ext_to_string();
66 GList *sidecar_ext_get_list();
67
68 #endif
69 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */