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