\hypertarget{group__Efreet__Trash}{}\doxysection{Efreet\+\_\+\+Trash\+: The XDG Trash Specification}
\label{group__Efreet__Trash}\index{Efreet\_Trash: The XDG Trash Specification@{Efreet\_Trash: The XDG Trash Specification}}


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


\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
EAPI int \mbox{\hyperlink{group__Efreet__Trash_ga2143f714828cf918e3188dafa52af190}{efreet\+\_\+trash\+\_\+init}} (void)
\begin{DoxyCompactList}\small\item\em Initializes the efreet trash system. \end{DoxyCompactList}\item 
EAPI int \mbox{\hyperlink{group__Efreet__Trash_gadabae8aa914a45470ec02a7a1ea5e82f}{efreet\+\_\+trash\+\_\+shutdown}} (void)
\begin{DoxyCompactList}\small\item\em Cleans up the efreet trash system. \end{DoxyCompactList}\item 
EAPI const char $\ast$ \mbox{\hyperlink{group__Efreet__Trash_gac0eb2bf1ec1dc22299fdbde34ef2ba58}{efreet\+\_\+trash\+\_\+dir\+\_\+get}} (const char $\ast$for\+\_\+file)
\begin{DoxyCompactList}\small\item\em Retrieves the XDG Trash local directory. \end{DoxyCompactList}\item 
EAPI int \mbox{\hyperlink{group__Efreet__Trash_ga67b6381a01374681566b35ad953e111a}{efreet\+\_\+trash\+\_\+delete\+\_\+uri}} (\mbox{\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 
EAPI \mbox{\hyperlink{group__Eina__List__Group_ga3295e1210efea1fb0fd6acbf3cbc1f29}{Eina\+\_\+\+List}} $\ast$ \mbox{\hyperlink{group__Efreet__Trash_ga4266d5821a64e4c07cd41a3c09e7c03c}{efreet\+\_\+trash\+\_\+ls}} (void)
\begin{DoxyCompactList}\small\item\em List all the files and directory currently inside the trash. \end{DoxyCompactList}\item 
EAPI int \mbox{\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 
EAPI int \mbox{\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}


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



\doxysubsection{Function Documentation}
\mbox{\Hypertarget{group__Efreet__Trash_ga2143f714828cf918e3188dafa52af190}\label{group__Efreet__Trash_ga2143f714828cf918e3188dafa52af190}} 
\index{Efreet\_Trash: The XDG Trash Specification@{Efreet\_Trash: The XDG Trash Specification}!efreet\_trash\_init@{efreet\_trash\_init}}
\index{efreet\_trash\_init@{efreet\_trash\_init}!Efreet\_Trash: The XDG Trash Specification@{Efreet\_Trash: The XDG Trash Specification}}
\doxysubsubsection{\texorpdfstring{efreet\_trash\_init()}{efreet\_trash\_init()}}
{\footnotesize\ttfamily EAPI int efreet\+\_\+trash\+\_\+init (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})}



Initializes the efreet trash system. 

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


Referenced by \mbox{\hyperlink{group__Efreet_ga37f391bd7291bf814aba6431750537a9}{elm\+\_\+need\+\_\+efreet()}}.

\mbox{\Hypertarget{group__Efreet__Trash_gadabae8aa914a45470ec02a7a1ea5e82f}\label{group__Efreet__Trash_gadabae8aa914a45470ec02a7a1ea5e82f}} 
\index{Efreet\_Trash: The XDG Trash Specification@{Efreet\_Trash: The XDG Trash Specification}!efreet\_trash\_shutdown@{efreet\_trash\_shutdown}}
\index{efreet\_trash\_shutdown@{efreet\_trash\_shutdown}!Efreet\_Trash: The XDG Trash Specification@{Efreet\_Trash: The XDG Trash Specification}}
\doxysubsubsection{\texorpdfstring{efreet\_trash\_shutdown()}{efreet\_trash\_shutdown()}}
{\footnotesize\ttfamily EAPI int efreet\+\_\+trash\+\_\+shutdown (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})}



Cleans up the efreet trash system. 

\begin{DoxyReturn}{Returns}
No value. 
\end{DoxyReturn}
\mbox{\Hypertarget{group__Efreet__Trash_gac0eb2bf1ec1dc22299fdbde34ef2ba58}\label{group__Efreet__Trash_gac0eb2bf1ec1dc22299fdbde34ef2ba58}} 
\index{Efreet\_Trash: The XDG Trash Specification@{Efreet\_Trash: The XDG Trash Specification}!efreet\_trash\_dir\_get@{efreet\_trash\_dir\_get}}
\index{efreet\_trash\_dir\_get@{efreet\_trash\_dir\_get}!Efreet\_Trash: The XDG Trash Specification@{Efreet\_Trash: The XDG Trash Specification}}
\doxysubsubsection{\texorpdfstring{efreet\_trash\_dir\_get()}{efreet\_trash\_dir\_get()}}
{\footnotesize\ttfamily EAPI const char $\ast$ efreet\+\_\+trash\+\_\+dir\+\_\+get (\begin{DoxyParamCaption}\item[{const char $\ast$}]{for\+\_\+file }\end{DoxyParamCaption})}



Retrieves the XDG Trash local directory. 

\begin{DoxyReturn}{Returns}
The XDG Trash local directory or {\ttfamily NULL} on errors. Return value must be freed with eina\+\_\+stringshare\+\_\+del. 
\end{DoxyReturn}


References \mbox{\hyperlink{group__Ecore__File__Group_gaf5a3cc8bd9bf69a3ebce0678fe799016}{ecore\+\_\+file\+\_\+exists()}}, \mbox{\hyperlink{group__Ecore__File__Group_ga12cd44f20708fcc4a123dea675a33a93}{ecore\+\_\+file\+\_\+mkpath()}}, \mbox{\hyperlink{group__Efreet__Base_ga4f315a23b8d9ad0319a55d9c70affc5e}{efreet\+\_\+data\+\_\+home\+\_\+get()}}, \mbox{\hyperlink{group__Eina__Stringshare__Group_ga4e3ce40744291c1fb8574e26883c0bf2}{eina\+\_\+stringshare\+\_\+add()}}, \mbox{\hyperlink{group__Eina__Stringshare__Group_ga5538b4a134987b8a01744fad1a845ba4}{eina\+\_\+stringshare\+\_\+del()}}, and \mbox{\hyperlink{group__Eina__Stringshare__Group_ga8c841e078a37b556e0bf91825f3df174}{eina\+\_\+stringshare\+\_\+ref()}}.



Referenced by \mbox{\hyperlink{group__Efreet__Trash_ga67b6381a01374681566b35ad953e111a}{efreet\+\_\+trash\+\_\+delete\+\_\+uri()}}, \mbox{\hyperlink{group__Efreet__Trash_ga09dd944f4567a90c04dbf6d146eb7a54}{efreet\+\_\+trash\+\_\+empty\+\_\+trash()}}, \mbox{\hyperlink{group__Efreet__Trash_ga0facfddaf103a1bf7e515b4677bd4fa0}{efreet\+\_\+trash\+\_\+is\+\_\+empty()}}, and \mbox{\hyperlink{group__Efreet__Trash_ga4266d5821a64e4c07cd41a3c09e7c03c}{efreet\+\_\+trash\+\_\+ls()}}.

\mbox{\Hypertarget{group__Efreet__Trash_ga67b6381a01374681566b35ad953e111a}\label{group__Efreet__Trash_ga67b6381a01374681566b35ad953e111a}} 
\index{Efreet\_Trash: The XDG Trash Specification@{Efreet\_Trash: The XDG Trash Specification}!efreet\_trash\_delete\_uri@{efreet\_trash\_delete\_uri}}
\index{efreet\_trash\_delete\_uri@{efreet\_trash\_delete\_uri}!Efreet\_Trash: The XDG Trash Specification@{Efreet\_Trash: The XDG Trash Specification}}
\doxysubsubsection{\texorpdfstring{efreet\_trash\_delete\_uri()}{efreet\_trash\_delete\_uri()}}
{\footnotesize\ttfamily EAPI int efreet\+\_\+trash\+\_\+delete\+\_\+uri (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{structEfreet__Uri}{Efreet\+\_\+\+Uri}} $\ast$}]{uri,  }\item[{int}]{force\+\_\+delete }\end{DoxyParamCaption})}



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 \mbox{\hyperlink{group__Ecore__File__Group_gaa32b8720b401b8677cec4b12da261a6d}{ecore\+\_\+file\+\_\+can\+\_\+write()}}, \mbox{\hyperlink{group__Ecore__File__Group_gaf5a3cc8bd9bf69a3ebce0678fe799016}{ecore\+\_\+file\+\_\+exists()}}, \mbox{\hyperlink{group__Ecore__File__Group_ga5f5fe7219c6288fecaa840f81c035cb7}{ecore\+\_\+file\+\_\+file\+\_\+get()}}, \mbox{\hyperlink{group__Ecore__File__Group_ga6e2d09d544f8e2b53c9518d521e1efd0}{ecore\+\_\+file\+\_\+recursive\+\_\+rm()}}, \mbox{\hyperlink{group__Efreet__Trash_gac0eb2bf1ec1dc22299fdbde34ef2ba58}{efreet\+\_\+trash\+\_\+dir\+\_\+get()}}, \mbox{\hyperlink{group__Efreet__Uri_ga35ddc9aa6ace8328088abb5280ae1409}{efreet\+\_\+uri\+\_\+encode()}}, \mbox{\hyperlink{group__Eina__Safety__Checks__Group_gae7cf7b1d66fa9022242e09fd53c06bb2}{EINA\+\_\+\+SAFETY\+\_\+\+ON\+\_\+\+FALSE\+\_\+\+RETURN\+\_\+\+VAL}}, \mbox{\hyperlink{group__Eina__Safety__Checks__Group_gab2b07061fc6500dedd9cd41c8d16f95d}{EINA\+\_\+\+SAFETY\+\_\+\+ON\+\_\+\+NULL\+\_\+\+RETURN\+\_\+\+VAL}}, \mbox{\hyperlink{group__Eina__Stringshare__Group_ga5538b4a134987b8a01744fad1a845ba4}{eina\+\_\+stringshare\+\_\+del()}}, and \mbox{\hyperlink{structEfreet__Uri_a7a507dff468df3ae90e107e2e6e25f6d}{Efreet\+\_\+\+Uri\+::path}}.

\mbox{\Hypertarget{group__Efreet__Trash_ga4266d5821a64e4c07cd41a3c09e7c03c}\label{group__Efreet__Trash_ga4266d5821a64e4c07cd41a3c09e7c03c}} 
\index{Efreet\_Trash: The XDG Trash Specification@{Efreet\_Trash: The XDG Trash Specification}!efreet\_trash\_ls@{efreet\_trash\_ls}}
\index{efreet\_trash\_ls@{efreet\_trash\_ls}!Efreet\_Trash: The XDG Trash Specification@{Efreet\_Trash: The XDG Trash Specification}}
\doxysubsubsection{\texorpdfstring{efreet\_trash\_ls()}{efreet\_trash\_ls()}}
{\footnotesize\ttfamily EAPI \mbox{\hyperlink{group__Eina__List__Group_ga3295e1210efea1fb0fd6acbf3cbc1f29}{Eina\+\_\+\+List}} $\ast$ efreet\+\_\+trash\+\_\+ls (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})}



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 \mbox{\hyperlink{group__Ecore__File__Group_gab7baa24c2abea205b4d1f92397f1bda0}{ecore\+\_\+file\+\_\+ls()}}, \mbox{\hyperlink{group__Efreet__Trash_gac0eb2bf1ec1dc22299fdbde34ef2ba58}{efreet\+\_\+trash\+\_\+dir\+\_\+get()}}, \mbox{\hyperlink{group__Eina__List__Group_gac6efafc19f526d916cdb9757240a8773}{EINA\+\_\+\+LIST\+\_\+\+FOREACH}}, \mbox{\hyperlink{group__Eina__Log__Group_gaca5019f970a269e25e956a73de60fe4d}{eina\+\_\+log\+\_\+domain\+\_\+level\+\_\+check()}}, and \mbox{\hyperlink{group__Eina__Log__Group_gga326699509b2e7578ace7c0a15b4a8c1aa0368139789af856a6ad9bbe4f21d195f}{EINA\+\_\+\+LOG\+\_\+\+LEVEL\+\_\+\+INFO}}.

\mbox{\Hypertarget{group__Efreet__Trash_ga0facfddaf103a1bf7e515b4677bd4fa0}\label{group__Efreet__Trash_ga0facfddaf103a1bf7e515b4677bd4fa0}} 
\index{Efreet\_Trash: The XDG Trash Specification@{Efreet\_Trash: The XDG Trash Specification}!efreet\_trash\_is\_empty@{efreet\_trash\_is\_empty}}
\index{efreet\_trash\_is\_empty@{efreet\_trash\_is\_empty}!Efreet\_Trash: The XDG Trash Specification@{Efreet\_Trash: The XDG Trash Specification}}
\doxysubsubsection{\texorpdfstring{efreet\_trash\_is\_empty()}{efreet\_trash\_is\_empty()}}
{\footnotesize\ttfamily EAPI int efreet\+\_\+trash\+\_\+is\+\_\+empty (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})}



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 \mbox{\hyperlink{group__Ecore__File__Group_ga5f6777eb4beea434372df0aa7357979b}{ecore\+\_\+file\+\_\+dir\+\_\+is\+\_\+empty()}}, and \mbox{\hyperlink{group__Efreet__Trash_gac0eb2bf1ec1dc22299fdbde34ef2ba58}{efreet\+\_\+trash\+\_\+dir\+\_\+get()}}.

\mbox{\Hypertarget{group__Efreet__Trash_ga09dd944f4567a90c04dbf6d146eb7a54}\label{group__Efreet__Trash_ga09dd944f4567a90c04dbf6d146eb7a54}} 
\index{Efreet\_Trash: The XDG Trash Specification@{Efreet\_Trash: The XDG Trash Specification}!efreet\_trash\_empty\_trash@{efreet\_trash\_empty\_trash}}
\index{efreet\_trash\_empty\_trash@{efreet\_trash\_empty\_trash}!Efreet\_Trash: The XDG Trash Specification@{Efreet\_Trash: The XDG Trash Specification}}
\doxysubsubsection{\texorpdfstring{efreet\_trash\_empty\_trash()}{efreet\_trash\_empty\_trash()}}
{\footnotesize\ttfamily EAPI int efreet\+\_\+trash\+\_\+empty\+\_\+trash (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})}



Delete all the files inside the trash. 

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


References \mbox{\hyperlink{group__Ecore__File__Group_gafdfe259d9a595dc05c8fc725342b253c}{ecore\+\_\+file\+\_\+mkdir()}}, \mbox{\hyperlink{group__Ecore__File__Group_ga6e2d09d544f8e2b53c9518d521e1efd0}{ecore\+\_\+file\+\_\+recursive\+\_\+rm()}}, and \mbox{\hyperlink{group__Efreet__Trash_gac0eb2bf1ec1dc22299fdbde34ef2ba58}{efreet\+\_\+trash\+\_\+dir\+\_\+get()}}.

