\section{Prefs}
\label{group__Prefs}\index{Prefs@{Prefs}}
\begin{DoxyCompactItemize}
\item 
Eina\+\_\+\+Bool \hyperlink{group__Prefs_gaec5a0c4ea7f8e54909c5cdbc05e9b064}{elm\+\_\+prefs\+\_\+file\+\_\+set} (Eo $\ast$obj, const char $\ast$file, const char $\ast$page)
\begin{DoxyCompactList}\small\item\em Set file and page to populate a given prefs widget's interface. \end{DoxyCompactList}\item 
Eina\+\_\+\+Bool \hyperlink{group__Prefs_gaa9220046adf093b046c2002c751c0501}{elm\+\_\+prefs\+\_\+file\+\_\+get} (const Eo $\ast$obj, const char $\ast$$\ast$file, const char $\ast$$\ast$page)
\begin{DoxyCompactList}\small\item\em Retrieve file and page bound to a given prefs widget. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
\hypertarget{group__Prefs_elm-prefs-widget}{}\subsection{Prefs}\label{group__Prefs_elm-prefs-widget}
 
\begin{DoxyImage}
\includegraphics{img/widget/prefs/preview-00}
\caption{width=}
\end{DoxyImage}


 
\begin{DoxyImageNoCaption}
  \mbox{\includegraphics{prefs_inheritance_tree}}
\end{DoxyImageNoCaption}


Prefs is a special widget inside Elementary. It is mainly targeted to configuration dialogs. Its viewport is blank until you associate a definition file to it. That file (usually with {\bfseries }.epb extension), is a binary format (Eet) one, coming from a human-\/readable textual declaration. This textual form, an {\bfseries Elementary prefs collection} (usually with {\bfseries }.epc extension), is translated to the binary form by means of the {\bfseries prefs\+\_\+cc} compiler.

On it one declares U\+I elements to populate prefs widgets, which are contained in {\bfseries pages} (a prefs widget is always bound to one page). Those elements get properties like\+:
\begin{DoxyItemize}
\item default value,
\item maximum and minumum ranges,
\item acceptance and denial regular expressions, for strings,
\item visibility,
\item persistence,
\item editability, etc.
\end{DoxyItemize}

Once a prefs widget is created, after \hyperlink{group__Prefs_gaec5a0c4ea7f8e54909c5cdbc05e9b064}{elm\+\_\+prefs\+\_\+file\+\_\+set()} is issued on it, all of its U\+I elements will get default values, declared on that file. To fetch an user's own, personal set of those values, one gets to pair an {\bfseries \hyperlink{group__Elm__Prefs_elm-prefs-data}{Prefs Data}} handle to the prefs widget.

Personal, prefs data values with keys matching the ones present on the file passed on \hyperlink{group__Prefs_gaec5a0c4ea7f8e54909c5cdbc05e9b064}{elm\+\_\+prefs\+\_\+file\+\_\+set()} to will have their values applied to the respective U\+I elements of the widget.

When a prefs widget dies, the values of the elements declared on its {\bfseries }.epb file marked as permanent {\bfseries will be written back} to the user prefs data handle, if it is writable. One is also able to make this writing event to take place automatically after each U\+I element modification by using elm\+\_\+prefs\+\_\+autosave\+\_\+set().

This widget emits the following signals\+:
\begin{DoxyItemize}
\item {\ttfamily \char`\"{}page,saved\char`\"{}}\+: a given page has had its values saved back on user config file (event info is the page's name)
\item {\ttfamily \char`\"{}page,reset\char`\"{}}\+: a given page has had its values reset (event info is the page's name)
\item {\ttfamily \char`\"{}page,changed\char`\"{}}\+: a given page has been loaded {\bfseries with user ({\ttfamily }.cfg) values} (event info is the page's name)
\item {\ttfamily \char`\"{}page,loaded\char`\"{}}\+: a given page has been loaded {\bfseries with system ({\ttfamily }.epb) values} (event info is the page's name)
\item {\ttfamily \char`\"{}item,changed\char`\"{}}\+: a given page's item has changed (event info is the item's full hierarchical name, in the form {\ttfamily \char`\"{}page\+:subpage\+:subsubpage\+:item\char`\"{}})
\item {\ttfamily \char`\"{}action\char`\"{}}\+: an action item has been triggered (event info is the item's full hierarchical name, in the form {\ttfamily \char`\"{}page\+:subpage\+:subsubpage\+:item\char`\"{}})
\end{DoxyItemize}

\begin{DoxyItemize}
\item \hyperlink{epcref}{Elementary Prefs Data Collection Reference}\end{DoxyItemize}
The following are examples on how to use prefs\+: \begin{DoxyItemize}
\item \hyperlink{prefs_example_01}{Prefs Example 01} \item \hyperlink{prefs_example_02}{Prefs Example 02} \item \hyperlink{prefs_example_03}{Prefs Example 03} \end{DoxyItemize}


\subsection{Function Documentation}
\index{Prefs@{Prefs}!elm\+\_\+prefs\+\_\+file\+\_\+get@{elm\+\_\+prefs\+\_\+file\+\_\+get}}
\index{elm\+\_\+prefs\+\_\+file\+\_\+get@{elm\+\_\+prefs\+\_\+file\+\_\+get}!Prefs@{Prefs}}
\subsubsection[{elm\+\_\+prefs\+\_\+file\+\_\+get}]{\setlength{\rightskip}{0pt plus 5cm}Eina\+\_\+\+Bool elm\+\_\+prefs\+\_\+file\+\_\+get (
\begin{DoxyParamCaption}
\item[{const Eo $\ast$}]{obj, }
\item[{const char $\ast$$\ast$}]{file, }
\item[{const char $\ast$$\ast$}]{page}
\end{DoxyParamCaption}
)}\label{group__Prefs_gaa9220046adf093b046c2002c751c0501}


Retrieve file and page bound to a given prefs widget. 

\begin{DoxyReturn}{Returns}
{\ttfamily E\+I\+N\+A\+\_\+\+T\+R\+U\+E}, on success, {\ttfamily E\+I\+N\+A\+\_\+\+F\+A\+L\+S\+E} otherwise
\end{DoxyReturn}
\begin{DoxyNote}{Note}
Use {\ttfamily N\+U\+L\+L} pointers on the components you're not interested in\+: they'll be ignored by the function.
\end{DoxyNote}
\begin{DoxySeeAlso}{See also}
\hyperlink{group__Prefs_gaec5a0c4ea7f8e54909c5cdbc05e9b064}{elm\+\_\+prefs\+\_\+file\+\_\+set()} for more information
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
1.\+8
\end{DoxySince}

\begin{DoxyParams}[1]{Parameters}
\mbox{\tt out}  & {\em file} & The {\bfseries }.epb (binary) file to get contents from \\
\hline
\mbox{\tt out}  & {\em page} & The page, inside {\itshape file}, where to get item contents from \\
\hline
\end{DoxyParams}
\index{Prefs@{Prefs}!elm\+\_\+prefs\+\_\+file\+\_\+set@{elm\+\_\+prefs\+\_\+file\+\_\+set}}
\index{elm\+\_\+prefs\+\_\+file\+\_\+set@{elm\+\_\+prefs\+\_\+file\+\_\+set}!Prefs@{Prefs}}
\subsubsection[{elm\+\_\+prefs\+\_\+file\+\_\+set}]{\setlength{\rightskip}{0pt plus 5cm}Eina\+\_\+\+Bool elm\+\_\+prefs\+\_\+file\+\_\+set (
\begin{DoxyParamCaption}
\item[{Eo $\ast$}]{obj, }
\item[{const char $\ast$}]{file, }
\item[{const char $\ast$}]{page}
\end{DoxyParamCaption}
)}\label{group__Prefs_gaec5a0c4ea7f8e54909c5cdbc05e9b064}


Set file and page to populate a given prefs widget's interface. 

\begin{DoxyReturn}{Returns}
{\ttfamily E\+I\+N\+A\+\_\+\+T\+R\+U\+E}, on success, {\ttfamily E\+I\+N\+A\+\_\+\+F\+A\+L\+S\+E} otherwise
\end{DoxyReturn}
Elm prefs widgets start blank, with no child widgets. It's meant to have its viewport populated with child elements coming from a declaration file. That file (usually with {\bfseries }.epb extension), is a binary format (Eet) one, coming from a human-\/readable textual declaration. This textual form (usually with {\bfseries }.epc extension) is translated to the binary form by means of the {\bfseries prefs\+\_\+cc} compiler.

With this function, one thus populates a prefs widget with U\+I elements.

If {\itshape file} is {\ttfamily N\+U\+L\+L}, \char`\"{}elm\+\_\+app\+\_\+data\+\_\+dir\+\_\+get()/preferences.\+epb\char`\"{} will be used, by default. If {\itshape file} is a {\bfseries relative} path, the prefix \char`\"{}elm\+\_\+app\+\_\+data\+\_\+dir\+\_\+get()/\char`\"{} will be implicitly used with it. If {\itshape page} is {\ttfamily N\+U\+L\+L}, it is considered \char`\"{}main\char`\"{}, as default.

\begin{DoxyWarning}{Warning}
If your binary is not properly installed and \hyperlink{group__App_ga92a09dbf88cc1ca3eab51c51dea589d0}{elm\+\_\+app\+\_\+data\+\_\+dir\+\_\+get()} can't be figured out, a fallback value of \char`\"{}.\char`\"{} will be tryed, instead.
\end{DoxyWarning}
\begin{DoxySeeAlso}{See also}
\hyperlink{group__Prefs_gaa9220046adf093b046c2002c751c0501}{elm\+\_\+prefs\+\_\+file\+\_\+get()}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
1.\+8
\end{DoxySince}

\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em file} & The {\bfseries }.epb (binary) file to get contents from \\
\hline
\mbox{\tt in}  & {\em page} & The page, inside {\itshape file}, where to get item contents from \\
\hline
\end{DoxyParams}
\begin{Desc}
\item[Examples\+: ]\par
\hyperlink{prefs_example_01_8c-example}{prefs\+\_\+example\+\_\+01.\+c}, \hyperlink{prefs_example_02_8c-example}{prefs\+\_\+example\+\_\+02.\+c}, and \hyperlink{prefs_example_03_8c-example}{prefs\+\_\+example\+\_\+03.\+c}.\end{Desc}
