EFL 1.7 svn doobies
[profile/ivi/efreet.git] / src / lib / Efreet_Trash.h
1 #ifndef EFREET_TRASH_H
2 #define EFREET_TRASH_H
3
4 #ifdef EAPI
5 # undef EAPI
6 #endif
7
8 #ifdef _WIN32
9 # ifdef EFL_EFREET_TRASH_BUILD
10 #  ifdef DLL_EXPORT
11 #   define EAPI __declspec(dllexport)
12 #  else
13 #   define EAPI
14 #  endif /* ! DLL_EXPORT */
15 # else
16 #  define EAPI __declspec(dllimport)
17 # endif /* ! EFL_EFREET_TRASH_BUILD */
18 #else
19 # ifdef __GNUC__
20 #  if __GNUC__ >= 4
21 #   define EAPI __attribute__ ((visibility("default")))
22 #  else
23 #   define EAPI
24 #  endif
25 # else
26 #  define EAPI
27 # endif
28 #endif
29
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33
34 /**
35  * @file Efreet_Trash.h
36  * @brief Contains the methods used to support the FDO trash specification.
37  * @addtogroup Efreet_Trash Efreet_Trash: The XDG Trash Specification
38  * Efreet_Trash.h provides all of the necessary headers and includes to
39  * work with Efreet_Trash.
40  * @{
41  */
42
43 /**
44  * @return @c 1 on success or @c 0 on failure.
45  * @brief Initializes the efreet trash system
46  */
47 EAPI int         efreet_trash_init(void);
48
49 /**
50  * @return No value.
51  * @brief Cleans up the efreet trash system
52  */
53 EAPI int         efreet_trash_shutdown(void);
54
55 /**
56  * @return The XDG Trash local directory or @c NULL on errors.
57  * Return value must be freed with eina_stringshare_del.
58  * @brief Retrieves the XDG Trash local directory
59  */
60 EAPI const char *efreet_trash_dir_get(const char *for_file);
61
62 /**
63  * @param uri The local uri to move in the trash
64  * @param force_delete If you set this to @c 1 than files on different filesystems
65  * will be deleted permanently
66  * @return @c 1 on success, @c 0 on failure or @c -1 in case the uri is not on
67  * the same filesystem and force_delete is not set.
68  * @brief This function try to move the given uri to the trash. Files on 
69  * different filesystem can't be moved to trash. If force_delete
70  * is @c 0 than non-local files will be ignored and @c -1 is returned, if you set
71  * force_delete to @c 1 non-local files will be deleted without asking.
72  */
73 EAPI int         efreet_trash_delete_uri(Efreet_Uri *uri, int force_delete);
74
75 /**
76  * @return A list of strings with filename (remember to free the list
77  * when you don't need anymore).
78  * @brief List all the files and directory currently inside the trash.
79  */
80 EAPI Eina_List  *efreet_trash_ls(void);
81
82 /**
83  * @return @c 1 if the trash is empty or @c 0 if some file are in.
84  * @brief Check if the trash is currently empty
85  */
86 EAPI int         efreet_trash_is_empty(void);
87
88 /**
89  * @return @c 1 on success or @c 0 on failure.
90  * @brief Delete all the files inside the trash.
91  */
92 EAPI int         efreet_trash_empty_trash(void);
93
94 /**
95  * @}
96  */
97
98 #ifdef __cplusplus
99 }
100 #endif
101
102 #endif