Fix #314: Remote commands for thumbnail maintenance
[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 /* you can change, but not add or remove entries from the returned list */
38 GList *filter_get_list(void);
39 void filter_remove_entry(FilterEntry *fe);
40
41 void filter_add(const gchar *key, const gchar *description, const gchar *extensions, FileFormatClass file_class, gboolean writable, gboolean allow_sidecar, gboolean enabled);
42 void filter_add_unique(const gchar *description, const gchar *extensions, FileFormatClass file_class, gboolean writable, gboolean allow_sidecar, gboolean enabled);
43 void filter_add_defaults(void);
44 void filter_reset(void);
45 void filter_rebuild(void);
46 GList *filter_to_list(const gchar *extensions);
47
48 const gchar *registered_extension_from_path(const gchar *name);
49 gboolean filter_name_exists(const gchar *name);
50 gboolean filter_file_class(const gchar *name, FileFormatClass file_class);
51 gboolean filter_name_is_writable(const gchar *name);
52 gboolean filter_name_allow_sidecar(const gchar *name);
53
54 void filter_write_list(GString *outstr, gint indent);
55 void filter_load_file_type(const gchar **attribute_names, const gchar **attribute_values);
56
57
58 void sidecar_ext_parse(const gchar *text);
59 gchar *sidecar_ext_to_string(void);
60 GList *sidecar_ext_get_list(void);
61
62 #endif
63 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */