\hypertarget{group__Efreet__Trash}{}\section{Efreet\+\_\+\+Trash\+: The X\+D\+G Trash Specification}
\label{group__Efreet__Trash}\index{Efreet\+\_\+\+Trash\+: The X\+D\+G Trash Specification@{Efreet\+\_\+\+Trash\+: The X\+D\+G Trash Specification}}


\hyperlink{Efreet__Trash_8h}{Efreet\+\_\+\+Trash.\+h} provides all of the necessary headers and includes to work with Efreet\+\_\+\+Trash.  


\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{Elua_8h_a3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+P\+I} int \hyperlink{group__Efreet__Trash_ga2143f714828cf918e3188dafa52af190}{efreet\+\_\+trash\+\_\+init} (void)
\begin{DoxyCompactList}\small\item\em Initializes the efreet trash system. \end{DoxyCompactList}\item 
\hyperlink{Elua_8h_a3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+P\+I} int \hyperlink{group__Efreet__Trash_gadabae8aa914a45470ec02a7a1ea5e82f}{efreet\+\_\+trash\+\_\+shutdown} (void)
\begin{DoxyCompactList}\small\item\em Cleans up the efreet trash system. \end{DoxyCompactList}\item 
\hyperlink{Elua_8h_a3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+P\+I} const char $\ast$ \hyperlink{group__Efreet__Trash_gac019e8cb4554d7f7190bf6bc9961d5b4}{efreet\+\_\+trash\+\_\+dir\+\_\+get} (const char $\ast$for\+\_\+file)
\begin{DoxyCompactList}\small\item\em Retrieves the X\+D\+G Trash local directory. \end{DoxyCompactList}\item 
\hyperlink{Elua_8h_a3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+P\+I} int \hyperlink{group__Efreet__Trash_ga67b6381a01374681566b35ad953e111a}{efreet\+\_\+trash\+\_\+delete\+\_\+uri} (\hyperlink{structEfreet__Uri}{Efreet\+\_\+\+Uri} $\ast$uri, int force\+\_\+delete)
\begin{DoxyCompactList}\small\item\em This function try to move the given uri to the trash. Files on different filesystem can\textquotesingle{}t be moved to trash. If force\+\_\+delete is {\ttfamily 0} than non-\/local files will be ignored and {\ttfamily -\/1} is returned, if you set force\+\_\+delete to {\ttfamily 1} non-\/local files will be deleted without asking. \end{DoxyCompactList}\item 
\hyperlink{Elua_8h_a3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+P\+I} \hyperlink{group__Eina__List__Group_ga3295e1210efea1fb0fd6acbf3cbc1f29}{Eina\+\_\+\+List} $\ast$ \hyperlink{group__Efreet__Trash_ga95dc95aca84e04f74709779eb2bebda7}{efreet\+\_\+trash\+\_\+ls} (void)
\begin{DoxyCompactList}\small\item\em List all the files and directory currently inside the trash. \end{DoxyCompactList}\item 
\hyperlink{Elua_8h_a3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+P\+I} int \hyperlink{group__Efreet__Trash_ga0facfddaf103a1bf7e515b4677bd4fa0}{efreet\+\_\+trash\+\_\+is\+\_\+empty} (void)
\begin{DoxyCompactList}\small\item\em Check if the trash is currently empty. \end{DoxyCompactList}\item 
\hyperlink{Elua_8h_a3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+P\+I} int \hyperlink{group__Efreet__Trash_ga09dd944f4567a90c04dbf6d146eb7a54}{efreet\+\_\+trash\+\_\+empty\+\_\+trash} (void)
\begin{DoxyCompactList}\small\item\em Delete all the files inside the trash. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
\hyperlink{Efreet__Trash_8h}{Efreet\+\_\+\+Trash.\+h} provides all of the necessary headers and includes to work with Efreet\+\_\+\+Trash. 



\subsection{Function Documentation}
\hypertarget{group__Efreet__Trash_ga2143f714828cf918e3188dafa52af190}{}\index{Efreet\+\_\+\+Trash\+: The X\+D\+G Trash Specification@{Efreet\+\_\+\+Trash\+: The X\+D\+G Trash Specification}!efreet\+\_\+trash\+\_\+init@{efreet\+\_\+trash\+\_\+init}}
\index{efreet\+\_\+trash\+\_\+init@{efreet\+\_\+trash\+\_\+init}!Efreet\+\_\+\+Trash\+: The X\+D\+G Trash Specification@{Efreet\+\_\+\+Trash\+: The X\+D\+G Trash Specification}}
\subsubsection[{efreet\+\_\+trash\+\_\+init}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} int efreet\+\_\+trash\+\_\+init (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}\label{group__Efreet__Trash_ga2143f714828cf918e3188dafa52af190}


Initializes the efreet trash system. 

\begin{DoxyReturn}{Returns}
{\ttfamily 1} on success or {\ttfamily 0} on failure. 
\end{DoxyReturn}


References eina\+\_\+init(), eina\+\_\+log\+\_\+domain\+\_\+register(), E\+I\+N\+A\+\_\+\+L\+O\+G\+\_\+\+E\+R\+R, and eina\+\_\+shutdown().

\hypertarget{group__Efreet__Trash_gadabae8aa914a45470ec02a7a1ea5e82f}{}\index{Efreet\+\_\+\+Trash\+: The X\+D\+G Trash Specification@{Efreet\+\_\+\+Trash\+: The X\+D\+G Trash Specification}!efreet\+\_\+trash\+\_\+shutdown@{efreet\+\_\+trash\+\_\+shutdown}}
\index{efreet\+\_\+trash\+\_\+shutdown@{efreet\+\_\+trash\+\_\+shutdown}!Efreet\+\_\+\+Trash\+: The X\+D\+G Trash Specification@{Efreet\+\_\+\+Trash\+: The X\+D\+G Trash Specification}}
\subsubsection[{efreet\+\_\+trash\+\_\+shutdown}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} int efreet\+\_\+trash\+\_\+shutdown (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}\label{group__Efreet__Trash_gadabae8aa914a45470ec02a7a1ea5e82f}


Cleans up the efreet trash system. 

\begin{DoxyReturn}{Returns}
No value. 
\end{DoxyReturn}


References eina\+\_\+log\+\_\+domain\+\_\+unregister(), and eina\+\_\+shutdown().

\hypertarget{group__Efreet__Trash_gac019e8cb4554d7f7190bf6bc9961d5b4}{}\index{Efreet\+\_\+\+Trash\+: The X\+D\+G Trash Specification@{Efreet\+\_\+\+Trash\+: The X\+D\+G Trash Specification}!efreet\+\_\+trash\+\_\+dir\+\_\+get@{efreet\+\_\+trash\+\_\+dir\+\_\+get}}
\index{efreet\+\_\+trash\+\_\+dir\+\_\+get@{efreet\+\_\+trash\+\_\+dir\+\_\+get}!Efreet\+\_\+\+Trash\+: The X\+D\+G Trash Specification@{Efreet\+\_\+\+Trash\+: The X\+D\+G Trash Specification}}
\subsubsection[{efreet\+\_\+trash\+\_\+dir\+\_\+get}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} const char$\ast$ efreet\+\_\+trash\+\_\+dir\+\_\+get (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{for\+\_\+file}
\end{DoxyParamCaption}
)}\label{group__Efreet__Trash_gac019e8cb4554d7f7190bf6bc9961d5b4}


Retrieves the X\+D\+G Trash local directory. 

\begin{DoxyReturn}{Returns}
The X\+D\+G Trash local directory or {\ttfamily N\+U\+L\+L} on errors. Return value must be freed with eina\+\_\+stringshare\+\_\+del. 
\end{DoxyReturn}


References ecore\+\_\+file\+\_\+exists(), ecore\+\_\+file\+\_\+mkpath(), efreet\+\_\+data\+\_\+home\+\_\+get(), eina\+\_\+stringshare\+\_\+add(), eina\+\_\+stringshare\+\_\+del(), and eina\+\_\+stringshare\+\_\+ref().



Referenced by efreet\+\_\+trash\+\_\+delete\+\_\+uri(), efreet\+\_\+trash\+\_\+empty\+\_\+trash(), efreet\+\_\+trash\+\_\+is\+\_\+empty(), and efreet\+\_\+trash\+\_\+ls().

\hypertarget{group__Efreet__Trash_ga67b6381a01374681566b35ad953e111a}{}\index{Efreet\+\_\+\+Trash\+: The X\+D\+G Trash Specification@{Efreet\+\_\+\+Trash\+: The X\+D\+G Trash Specification}!efreet\+\_\+trash\+\_\+delete\+\_\+uri@{efreet\+\_\+trash\+\_\+delete\+\_\+uri}}
\index{efreet\+\_\+trash\+\_\+delete\+\_\+uri@{efreet\+\_\+trash\+\_\+delete\+\_\+uri}!Efreet\+\_\+\+Trash\+: The X\+D\+G Trash Specification@{Efreet\+\_\+\+Trash\+: The X\+D\+G Trash Specification}}
\subsubsection[{efreet\+\_\+trash\+\_\+delete\+\_\+uri}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} int efreet\+\_\+trash\+\_\+delete\+\_\+uri (
\begin{DoxyParamCaption}
\item[{{\bf Efreet\+\_\+\+Uri} $\ast$}]{uri, }
\item[{int}]{force\+\_\+delete}
\end{DoxyParamCaption}
)}\label{group__Efreet__Trash_ga67b6381a01374681566b35ad953e111a}


This function try to move the given uri to the trash. Files on different filesystem can\textquotesingle{}t be moved to trash. If force\+\_\+delete is {\ttfamily 0} than non-\/local files will be ignored and {\ttfamily -\/1} is returned, if you set force\+\_\+delete to {\ttfamily 1} non-\/local files will be deleted without asking. 


\begin{DoxyParams}{Parameters}
{\em uri} & The local uri to move in the trash \\
\hline
{\em force\+\_\+delete} & If you set this to {\ttfamily 1} than files on different filesystems will be deleted permanently \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
{\ttfamily 1} on success, {\ttfamily 0} on failure or {\ttfamily -\/1} in case the uri is not on the same filesystem and force\+\_\+delete is not set. 
\end{DoxyReturn}


References ecore\+\_\+file\+\_\+can\+\_\+write(), ecore\+\_\+file\+\_\+exists(), ecore\+\_\+file\+\_\+file\+\_\+get(), ecore\+\_\+file\+\_\+recursive\+\_\+rm(), efreet\+\_\+trash\+\_\+dir\+\_\+get(), efreet\+\_\+uri\+\_\+encode(), eina\+\_\+stringshare\+\_\+del(), E\+R\+R, Efreet\+\_\+\+Uri\+::path, and rename.

\hypertarget{group__Efreet__Trash_ga95dc95aca84e04f74709779eb2bebda7}{}\index{Efreet\+\_\+\+Trash\+: The X\+D\+G Trash Specification@{Efreet\+\_\+\+Trash\+: The X\+D\+G Trash Specification}!efreet\+\_\+trash\+\_\+ls@{efreet\+\_\+trash\+\_\+ls}}
\index{efreet\+\_\+trash\+\_\+ls@{efreet\+\_\+trash\+\_\+ls}!Efreet\+\_\+\+Trash\+: The X\+D\+G Trash Specification@{Efreet\+\_\+\+Trash\+: The X\+D\+G Trash Specification}}
\subsubsection[{efreet\+\_\+trash\+\_\+ls}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} {\bf Eina\+\_\+\+List}$\ast$ efreet\+\_\+trash\+\_\+ls (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}\label{group__Efreet__Trash_ga95dc95aca84e04f74709779eb2bebda7}


List all the files and directory currently inside the trash. 

\begin{DoxyReturn}{Returns}
A list of strings with filename (remember to free the list when you don\textquotesingle{}t need anymore). 
\end{DoxyReturn}


References ecore\+\_\+file\+\_\+ls(), efreet\+\_\+trash\+\_\+dir\+\_\+get(), E\+I\+N\+A\+\_\+\+L\+I\+S\+T\+\_\+\+F\+O\+R\+E\+A\+C\+H, E\+I\+N\+A\+\_\+\+L\+O\+G\+\_\+\+L\+E\+V\+E\+L\+\_\+\+I\+N\+F\+O, and I\+N\+F.

\hypertarget{group__Efreet__Trash_ga0facfddaf103a1bf7e515b4677bd4fa0}{}\index{Efreet\+\_\+\+Trash\+: The X\+D\+G Trash Specification@{Efreet\+\_\+\+Trash\+: The X\+D\+G Trash Specification}!efreet\+\_\+trash\+\_\+is\+\_\+empty@{efreet\+\_\+trash\+\_\+is\+\_\+empty}}
\index{efreet\+\_\+trash\+\_\+is\+\_\+empty@{efreet\+\_\+trash\+\_\+is\+\_\+empty}!Efreet\+\_\+\+Trash\+: The X\+D\+G Trash Specification@{Efreet\+\_\+\+Trash\+: The X\+D\+G Trash Specification}}
\subsubsection[{efreet\+\_\+trash\+\_\+is\+\_\+empty}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} int efreet\+\_\+trash\+\_\+is\+\_\+empty (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}\label{group__Efreet__Trash_ga0facfddaf103a1bf7e515b4677bd4fa0}


Check if the trash is currently empty. 

\begin{DoxyReturn}{Returns}
{\ttfamily 1} if the trash is empty or {\ttfamily 0} if some file are in. 
\end{DoxyReturn}


References ecore\+\_\+file\+\_\+dir\+\_\+is\+\_\+empty(), and efreet\+\_\+trash\+\_\+dir\+\_\+get().

\hypertarget{group__Efreet__Trash_ga09dd944f4567a90c04dbf6d146eb7a54}{}\index{Efreet\+\_\+\+Trash\+: The X\+D\+G Trash Specification@{Efreet\+\_\+\+Trash\+: The X\+D\+G Trash Specification}!efreet\+\_\+trash\+\_\+empty\+\_\+trash@{efreet\+\_\+trash\+\_\+empty\+\_\+trash}}
\index{efreet\+\_\+trash\+\_\+empty\+\_\+trash@{efreet\+\_\+trash\+\_\+empty\+\_\+trash}!Efreet\+\_\+\+Trash\+: The X\+D\+G Trash Specification@{Efreet\+\_\+\+Trash\+: The X\+D\+G Trash Specification}}
\subsubsection[{efreet\+\_\+trash\+\_\+empty\+\_\+trash}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} int efreet\+\_\+trash\+\_\+empty\+\_\+trash (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}\label{group__Efreet__Trash_ga09dd944f4567a90c04dbf6d146eb7a54}


Delete all the files inside the trash. 

\begin{DoxyReturn}{Returns}
{\ttfamily 1} on success or {\ttfamily 0} on failure. 
\end{DoxyReturn}


References ecore\+\_\+file\+\_\+mkdir(), ecore\+\_\+file\+\_\+recursive\+\_\+rm(), and efreet\+\_\+trash\+\_\+dir\+\_\+get().

