2008-07-16 12:45:12 -07:00
|
|
|
#ifndef EFREET_TRASH_H
|
|
|
|
#define EFREET_TRASH_H
|
|
|
|
|
|
|
|
#ifdef EAPI
|
2009-04-20 16:20:40 -07:00
|
|
|
# undef EAPI
|
2008-07-16 12:45:12 -07:00
|
|
|
#endif
|
2009-04-20 16:20:40 -07:00
|
|
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
# ifdef EFL_EFREET_TRASH_BUILD
|
|
|
|
# ifdef DLL_EXPORT
|
|
|
|
# define EAPI __declspec(dllexport)
|
|
|
|
# else
|
|
|
|
# define EAPI
|
|
|
|
# endif /* ! DLL_EXPORT */
|
2008-07-16 12:45:12 -07:00
|
|
|
# else
|
|
|
|
# define EAPI __declspec(dllimport)
|
2009-04-20 16:20:40 -07:00
|
|
|
# endif /* ! EFL_EFREET_TRASH_BUILD */
|
2008-07-16 12:45:12 -07:00
|
|
|
#else
|
|
|
|
# ifdef __GNUC__
|
|
|
|
# if __GNUC__ >= 4
|
|
|
|
# define EAPI __attribute__ ((visibility("default")))
|
|
|
|
# else
|
|
|
|
# define EAPI
|
|
|
|
# endif
|
|
|
|
# else
|
|
|
|
# define EAPI
|
|
|
|
# endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
2008-08-02 17:07:17 -07:00
|
|
|
* @file Efreet_Trash.h
|
|
|
|
* @brief Contains the methods used to support the FDO trash specification.
|
|
|
|
* @addtogroup Efreet_Trash Efreet_Trash: The XDG Trash Specification
|
|
|
|
* Efreet_Trash.h provides all of the necessary headers and includes to
|
|
|
|
* work with Efreet_Trash.
|
2012-12-29 15:04:40 -08:00
|
|
|
*
|
|
|
|
* @ingroup Efreet
|
2008-08-02 17:07:17 -07:00
|
|
|
* @{
|
2008-07-16 12:45:12 -07:00
|
|
|
*/
|
|
|
|
|
2011-04-08 04:01:08 -07:00
|
|
|
/**
|
2012-06-18 03:06:17 -07:00
|
|
|
* @return @c 1 on success or @c 0 on failure.
|
2011-04-08 04:01:08 -07:00
|
|
|
* @brief Initializes the efreet trash system
|
|
|
|
*/
|
2008-07-16 12:45:12 -07:00
|
|
|
EAPI int efreet_trash_init(void);
|
2011-04-08 04:01:08 -07:00
|
|
|
|
|
|
|
/**
|
2012-06-18 03:06:17 -07:00
|
|
|
* @return No value.
|
2011-04-08 04:01:08 -07:00
|
|
|
* @brief Cleans up the efreet trash system
|
|
|
|
*/
|
2009-10-09 23:19:13 -07:00
|
|
|
EAPI int efreet_trash_shutdown(void);
|
2008-07-16 12:45:12 -07:00
|
|
|
|
2011-04-08 04:01:08 -07:00
|
|
|
/**
|
2012-06-18 03:06:17 -07:00
|
|
|
* @return The XDG Trash local directory or @c NULL on errors.
|
|
|
|
* Return value must be freed with eina_stringshare_del.
|
2011-04-08 04:01:08 -07:00
|
|
|
* @brief Retrieves the XDG Trash local directory
|
|
|
|
*/
|
2010-05-15 00:51:49 -07:00
|
|
|
EAPI const char *efreet_trash_dir_get(const char *for_file);
|
2011-04-08 04:01:08 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @param uri The local uri to move in the trash
|
2012-06-18 03:06:17 -07:00
|
|
|
* @param force_delete If you set this to @c 1 than files on different filesystems
|
2011-04-08 04:01:08 -07:00
|
|
|
* will be deleted permanently
|
2012-06-18 03:06:17 -07:00
|
|
|
* @return @c 1 on success, @c 0 on failure or @c -1 in case the uri is not on
|
|
|
|
* the same filesystem and force_delete is not set.
|
2011-04-08 04:01:08 -07:00
|
|
|
* @brief This function try to move the given uri to the trash. Files on
|
|
|
|
* different filesystem can't be moved to trash. If force_delete
|
2012-06-18 03:06:17 -07:00
|
|
|
* is @c 0 than non-local files will be ignored and @c -1 is returned, if you set
|
|
|
|
* force_delete to @c 1 non-local files will be deleted without asking.
|
2011-04-08 04:01:08 -07:00
|
|
|
*/
|
2008-07-16 12:45:12 -07:00
|
|
|
EAPI int efreet_trash_delete_uri(Efreet_Uri *uri, int force_delete);
|
2011-04-08 04:01:08 -07:00
|
|
|
|
|
|
|
/**
|
2012-06-18 03:06:17 -07:00
|
|
|
* @return A list of strings with filename (remember to free the list
|
|
|
|
* when you don't need anymore).
|
2011-04-08 04:01:08 -07:00
|
|
|
* @brief List all the files and directory currently inside the trash.
|
|
|
|
*/
|
* estickies,
* etk,
* PROTO/exalt,
* E-MODULES-EXTRA/diskio,
* E-MODULES-EXTRA/drawer,
* E-MODULES-EXTRA/penguins,
* E-MODULES-EXTRA/slideshow,
* E-MODULES-EXTRA/mail,
* E-MODULES-EXTRA/forecasts,
* E-MODULES-EXTRA/iiirk,
* E-MODULES-EXTRA/places,
* e,
* ewl,
* ecore,
* elitaire,
* entrance,
* e_dbus,
* efreet: Here we go, move from Ecore_List to Eina_List.
NOTE: This patch is huge, I did test it a lot, and I hope nothing is
broken. But if you think something change after this commit, please
contact me ASAP.
SVN revision: 39200
2009-02-25 03:03:47 -08:00
|
|
|
EAPI Eina_List *efreet_trash_ls(void);
|
2011-04-08 04:01:08 -07:00
|
|
|
|
|
|
|
/**
|
2012-06-18 03:06:17 -07:00
|
|
|
* @return @c 1 if the trash is empty or @c 0 if some file are in.
|
2011-04-08 04:01:08 -07:00
|
|
|
* @brief Check if the trash is currently empty
|
|
|
|
*/
|
2008-07-16 12:45:12 -07:00
|
|
|
EAPI int efreet_trash_is_empty(void);
|
2011-04-08 04:01:08 -07:00
|
|
|
|
|
|
|
/**
|
2012-06-18 03:06:17 -07:00
|
|
|
* @return @c 1 on success or @c 0 on failure.
|
2011-04-08 04:01:08 -07:00
|
|
|
* @brief Delete all the files inside the trash.
|
|
|
|
*/
|
2008-07-16 12:45:12 -07:00
|
|
|
EAPI int efreet_trash_empty_trash(void);
|
2008-08-02 17:07:17 -07:00
|
|
|
|
2008-07-16 12:45:12 -07:00
|
|
|
/**
|
|
|
|
* @}
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|