PCManFM-Qt
fm-search.h
1 /*
2  * fm-search-uri.h
3  *
4  * Copyright 2015 Hong Jen Yee (PCMan) <pcman.tw@gmail.com>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19  * MA 02110-1301, USA.
20  */
21 
22 /* FmSearch implements a tool used to generate a search:// URI used by libfm to search for files.
23  * This API might become part of libfm in the future.
24  */
25 
26 #ifndef _FM_SEARCH_H_
27 #define _FM_SEARCH_H_
28 
29 #include <libfm/fm.h>
30 
31 G_BEGIN_DECLS
32 
33 typedef struct _FmSearch FmSearch;
34 
35 FmSearch* fm_search_new(void);
36 void fm_search_free(FmSearch* search);
37 
38 FmPath* fm_search_dup_path(FmSearch* search);
39 
40 gboolean fm_search_get_recursive(FmSearch* search);
41 void fm_search_set_recursive(FmSearch* search, gboolean recursive);
42 
43 gboolean fm_search_get_show_hidden(FmSearch* search);
44 void fm_search_set_show_hidden(FmSearch* search, gboolean show_hidden);
45 
46 const char* fm_search_get_name_patterns(FmSearch* search);
47 void fm_search_set_name_patterns(FmSearch* search, const char* name_patterns);
48 
49 gboolean fm_search_get_name_ci(FmSearch* search);
50 void fm_search_set_name_ci(FmSearch* search, gboolean name_ci);
51 
52 gboolean fm_search_get_name_regex(FmSearch* search);
53 void fm_search_set_name_regex(FmSearch* search, gboolean name_regex);
54 
55 const char* fm_search_get_content_pattern(FmSearch* search);
56 void fm_search_set_content_pattern(FmSearch* search, const char* content_pattern);
57 
58 gboolean fm_search_get_content_ci(FmSearch* search);
59 void fm_search_set_content_ci(FmSearch* search, gboolean content_ci);
60 
61 gboolean fm_search_get_content_regex(FmSearch* search);
62 void fm_search_set_content_regex(FmSearch* search, gboolean content_regex);
63 
64 void fm_search_add_dir(FmSearch* search, const char* dir);
65 void fm_search_remove_dir(FmSearch* search, const char* dir);
66 GList* fm_search_get_dirs(FmSearch* search);
67 
68 void fm_search_add_mime_type(FmSearch* search, const char* mime_type);
69 void fm_search_remove_mime_type(FmSearch* search, const char* mime_type);
70 GList* fm_search_get_mime_types(FmSearch* search);
71 
72 guint64 fm_search_get_max_size(FmSearch* search);
73 void fm_search_set_max_size(FmSearch* search, guint64 size);
74 
75 guint64 fm_search_get_min_size(FmSearch* search);
76 void fm_search_set_min_size(FmSearch* search, guint64 size);
77 
78 /* format of mtime: YYYY-MM-DD */
79 const char* fm_search_get_max_mtime(FmSearch* search);
80 void fm_search_set_max_mtime(FmSearch* search, const char* mtime);
81 
82 /* format of mtime: YYYY-MM-DD */
83 const char* fm_search_get_min_mtime(FmSearch* search);
84 void fm_search_set_min_mtime(FmSearch* search, const char* mtime);
85 
86 G_END_DECLS
87 
88 #endif /* _FM_SEARCH_H_ */