1 /* dzl-directory-reaper.h
2  *
3  * Copyright (C) 2017 Christian Hergert <chergert@redhat.com>
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef DZL_DIRECTORY_REAPER_H
20 #define DZL_DIRECTORY_REAPER_H
21 
22 #include <gio/gio.h>
23 
24 #include "dzl-version-macros.h"
25 
26 G_BEGIN_DECLS
27 
28 #define DZL_TYPE_DIRECTORY_REAPER (dzl_directory_reaper_get_type())
29 
30 DZL_AVAILABLE_IN_ALL
31 G_DECLARE_FINAL_TYPE (DzlDirectoryReaper, dzl_directory_reaper, DZL, DIRECTORY_REAPER, GObject)
32 
33 DZL_AVAILABLE_IN_ALL
34 DzlDirectoryReaper *dzl_directory_reaper_new               (void);
35 DZL_AVAILABLE_IN_ALL
36 void                dzl_directory_reaper_add_directory     (DzlDirectoryReaper   *self,
37                                                             GFile                *directory,
38                                                             GTimeSpan             min_age);
39 DZL_AVAILABLE_IN_ALL
40 void                dzl_directory_reaper_add_file          (DzlDirectoryReaper   *self,
41                                                             GFile                *file,
42                                                             GTimeSpan             min_age);
43 DZL_AVAILABLE_IN_ALL
44 void                dzl_directory_reaper_add_glob          (DzlDirectoryReaper   *self,
45                                                             GFile                *directory,
46                                                             const gchar          *glob,
47                                                             GTimeSpan             min_age);
48 DZL_AVAILABLE_IN_ALL
49 gboolean            dzl_directory_reaper_execute           (DzlDirectoryReaper   *self,
50                                                             GCancellable         *cancellable,
51                                                             GError              **error);
52 DZL_AVAILABLE_IN_ALL
53 void                dzl_directory_reaper_execute_async     (DzlDirectoryReaper   *self,
54                                                             GCancellable         *cancellable,
55                                                             GAsyncReadyCallback   callback,
56                                                             gpointer              user_data);
57 DZL_AVAILABLE_IN_ALL
58 gboolean            dzl_directory_reaper_execute_finish    (DzlDirectoryReaper   *self,
59                                                             GAsyncResult         *result,
60                                                             GError              **error);
61 
62 G_END_DECLS
63 
64 #endif /* DZL_DIRECTORY_REAPER_H */
65