move lots of deprecated stuff into deprecated files. need 2 right now.
[framework/uifw/elementary.git] / src / lib / elc_fileselector_entry.h
1 /**
2  * @defgroup File_Selector_Entry File Selector Entry
3  *
4  * @image html img/widget/fileselector_entry/preview-00.png
5  * @image latex img/widget/fileselector_entry/preview-00.eps
6  *
7  * This is an entry made to be filled with or display a <b>file
8  * system path string</b>. Besides the entry itself, the widget has
9  * a @ref File_Selector_Button "file selector button" on its side,
10  * which will raise an internal @ref Fileselector "file selector widget",
11  * when clicked, for path selection aided by file system
12  * navigation.
13  *
14  * This file selector may appear in an Elementary window or in an
15  * inner window. When a file is chosen from it, the (inner) window
16  * is closed and the selected file's path string is exposed both as
17  * an smart event and as the new text on the entry.
18  *
19  * This widget encapsulates operations on its internal file
20  * selector on its own API. There is less control over its file
21  * selector than that one would have instatiating one directly.
22  *
23  * Smart callbacks one can register to:
24  * - @c "changed" - The text within the entry was changed
25  * - @c "activated" - The entry has had editing finished and
26  *   changes are to be "committed"
27  * - @c "press" - The entry has been clicked
28  * - @c "longpressed" - The entry has been clicked (and held) for a
29  *   couple seconds
30  * - @c "clicked" - The entry has been clicked
31  * - @c "clicked,double" - The entry has been double clicked
32  * - @c "focused" - The entry has received focus
33  * - @c "unfocused" - The entry has lost focus
34  * - @c "selection,paste" - A paste action has occurred on the
35  *   entry
36  * - @c "selection,copy" - A copy action has occurred on the entry
37  * - @c "selection,cut" - A cut action has occurred on the entry
38  * - @c "unpressed" - The file selector entry's button was released
39  *   after being pressed.
40  * - @c "file,chosen" - The user has selected a path via the file
41  *   selector entry's internal file selector, whose string pointer
42  *   comes as the @c event_info data (a stringshared string)
43  *
44  * Here is an example on its usage:
45  * @li @ref fileselector_entry_example
46  *
47  * @see @ref File_Selector_Button for a similar widget.
48  * @{
49  */
50
51 /**
52  * Add a new file selector entry widget to the given parent
53  * Elementary (container) object
54  *
55  * @param parent The parent object
56  * @return a new file selector entry widget handle or @c NULL, on
57  * errors
58  */
59 EAPI Evas_Object                *elm_fileselector_entry_add(Evas_Object *parent) EINA_ARG_NONNULL(1);
60
61 /**
62  * Set the icon on a given file selector entry widget's button
63  *
64  * @param obj The file selector entry widget
65  * @param icon The icon object for the entry's button
66  *
67  * Once the icon object is set, a previously set one will be
68  * deleted. If you want to keep the latter, use the
69  * elm_fileselector_entry_button_icon_unset() function.
70  *
71  * @see elm_fileselector_entry_button_icon_get()
72  */
73 EAPI void                        elm_fileselector_entry_button_icon_set(Evas_Object *obj, Evas_Object *icon) EINA_ARG_NONNULL(1);
74
75 /**
76  * Get the icon set for a given file selector entry widget's button
77  *
78  * @param obj The file selector entry widget
79  * @return The icon object currently set on @p obj widget's button
80  * or @c NULL, if none is
81  *
82  * @see elm_fileselector_entry_button_icon_set()
83  */
84 EAPI Evas_Object                *elm_fileselector_entry_button_icon_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
85
86 /**
87  * Unset the icon used in a given file selector entry widget's
88  * button
89  *
90  * @param obj The file selector entry widget
91  * @return The icon object that was being used on @p obj widget's
92  * button or @c NULL, on errors
93  *
94  * Unparent and return the icon object which was set for this
95  * widget's button.
96  *
97  * @see elm_fileselector_entry_button_icon_set()
98  */
99 EAPI Evas_Object                *elm_fileselector_entry_button_icon_unset(Evas_Object *obj) EINA_ARG_NONNULL(1);
100
101 /**
102  * Set the title for a given file selector entry widget's window
103  *
104  * @param obj The file selector entry widget
105  * @param title The title string
106  *
107  * This will change the window's title, when the file selector pops
108  * out after a click on the entry's button. Those windows have the
109  * default (unlocalized) value of @c "Select a file" as titles.
110  *
111  * @note It will only take any effect if the file selector
112  * entry widget is @b not under "inwin mode".
113  *
114  * @see elm_fileselector_entry_window_title_get()
115  */
116 EAPI void                        elm_fileselector_entry_window_title_set(Evas_Object *obj, const char *title) EINA_ARG_NONNULL(1);
117
118 /**
119  * Get the title set for a given file selector entry widget's
120  * window
121  *
122  * @param obj The file selector entry widget
123  * @return Title of the file selector entry's window
124  *
125  * @see elm_fileselector_entry_window_title_get() for more details
126  */
127 EAPI const char                 *elm_fileselector_entry_window_title_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
128
129 /**
130  * Set the size of a given file selector entry widget's window,
131  * holding the file selector itself.
132  *
133  * @param obj The file selector entry widget
134  * @param width The window's width
135  * @param height The window's height
136  *
137  * @note it will only take any effect if the file selector entry
138  * widget is @b not under "inwin mode". The default size for the
139  * window (when applicable) is 400x400 pixels.
140  *
141  * @see elm_fileselector_entry_window_size_get()
142  */
143 EAPI void                        elm_fileselector_entry_window_size_set(Evas_Object *obj, Evas_Coord width, Evas_Coord height) EINA_ARG_NONNULL(1);
144
145 /**
146  * Get the size of a given file selector entry widget's window,
147  * holding the file selector itself.
148  *
149  * @param obj The file selector entry widget
150  * @param width Pointer into which to store the width value
151  * @param height Pointer into which to store the height value
152  *
153  * @note Use @c NULL pointers on the size values you're not
154  * interested in: they'll be ignored by the function.
155  *
156  * @see elm_fileselector_entry_window_size_set(), for more details
157  */
158 EAPI void                        elm_fileselector_entry_window_size_get(const Evas_Object *obj, Evas_Coord *width, Evas_Coord *height) EINA_ARG_NONNULL(1);
159
160 /**
161  * Set the initial file system path and the entry's path string for
162  * a given file selector entry widget
163  *
164  * @param obj The file selector entry widget
165  * @param path The path string
166  *
167  * It must be a <b>directory</b> path, which will have the contents
168  * displayed initially in the file selector's view, when invoked
169  * from @p obj. The default initial path is the @c "HOME"
170  * environment variable's value.
171  *
172  * @see elm_fileselector_entry_path_get()
173  */
174 EAPI void                        elm_fileselector_entry_path_set(Evas_Object *obj, const char *path) EINA_ARG_NONNULL(1);
175
176 /**
177  * Get the entry's path string for a given file selector entry
178  * widget
179  *
180  * @param obj The file selector entry widget
181  * @return path The path string
182  *
183  * @see elm_fileselector_entry_path_set() for more details
184  */
185 EAPI const char                 *elm_fileselector_entry_path_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
186
187 /**
188  * Enable/disable a tree view in the given file selector entry
189  * widget's internal file selector
190  *
191  * @param obj The file selector entry widget
192  * @param value @c EINA_TRUE to enable tree view, @c EINA_FALSE to disable
193  *
194  * This has the same effect as elm_fileselector_expandable_set(),
195  * but now applied to a file selector entry's internal file
196  * selector.
197  *
198  * @note There's no way to put a file selector entry's internal
199  * file selector in "grid mode", as one may do with "pure" file
200  * selectors.
201  *
202  * @see elm_fileselector_expandable_get()
203  */
204 EAPI void                        elm_fileselector_entry_expandable_set(Evas_Object *obj, Eina_Bool value) EINA_ARG_NONNULL(1);
205
206 /**
207  * Get whether tree view is enabled for the given file selector
208  * entry widget's internal file selector
209  *
210  * @param obj The file selector entry widget
211  * @return @c EINA_TRUE if @p obj widget's internal file selector
212  * is in tree view, @c EINA_FALSE otherwise (and or errors)
213  *
214  * @see elm_fileselector_expandable_set() for more details
215  */
216 EAPI Eina_Bool                   elm_fileselector_entry_expandable_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
217
218 /**
219  * Set whether a given file selector entry widget's internal file
220  * selector is to display folders only or the directory contents,
221  * as well.
222  *
223  * @param obj The file selector entry widget
224  * @param value @c EINA_TRUE to make @p obj widget's internal file
225  * selector only display directories, @c EINA_FALSE to make files
226  * to be displayed in it too
227  *
228  * This has the same effect as elm_fileselector_folder_only_set(),
229  * but now applied to a file selector entry's internal file
230  * selector.
231  *
232  * @see elm_fileselector_folder_only_get()
233  */
234 EAPI void                        elm_fileselector_entry_folder_only_set(Evas_Object *obj, Eina_Bool value) EINA_ARG_NONNULL(1);
235
236 /**
237  * Get whether a given file selector entry widget's internal file
238  * selector is displaying folders only or the directory contents,
239  * as well.
240  *
241  * @param obj The file selector entry widget
242  * @return @c EINA_TRUE if @p obj widget's internal file
243  * selector is only displaying directories, @c EINA_FALSE if files
244  * are being displayed in it too (and on errors)
245  *
246  * @see elm_fileselector_entry_folder_only_set() for more details
247  */
248 EAPI Eina_Bool                   elm_fileselector_entry_folder_only_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
249
250 /**
251  * Enable/disable the file name entry box where the user can type
252  * in a name for a file, in a given file selector entry widget's
253  * internal file selector.
254  *
255  * @param obj The file selector entry widget
256  * @param value @c EINA_TRUE to make @p obj widget's internal
257  * file selector a "saving dialog", @c EINA_FALSE otherwise
258  *
259  * This has the same effect as elm_fileselector_is_save_set(),
260  * but now applied to a file selector entry's internal file
261  * selector.
262  *
263  * @see elm_fileselector_is_save_get()
264  */
265 EAPI void                        elm_fileselector_entry_is_save_set(Evas_Object *obj, Eina_Bool value) EINA_ARG_NONNULL(1);
266
267 /**
268  * Get whether the given file selector entry widget's internal
269  * file selector is in "saving dialog" mode
270  *
271  * @param obj The file selector entry widget
272  * @return @c EINA_TRUE, if @p obj widget's internal file selector
273  * is in "saving dialog" mode, @c EINA_FALSE otherwise (and on
274  * errors)
275  *
276  * @see elm_fileselector_entry_is_save_set() for more details
277  */
278 EAPI Eina_Bool                   elm_fileselector_entry_is_save_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
279
280 /**
281  * Set whether a given file selector entry widget's internal file
282  * selector will raise an Elementary "inner window", instead of a
283  * dedicated Elementary window. By default, it won't.
284  *
285  * @param obj The file selector entry widget
286  * @param value @c EINA_TRUE to make it use an inner window, @c
287  * EINA_TRUE to make it use a dedicated window
288  *
289  * @see elm_win_inwin_add() for more information on inner windows
290  * @see elm_fileselector_entry_inwin_mode_get()
291  */
292 EAPI void                        elm_fileselector_entry_inwin_mode_set(Evas_Object *obj, Eina_Bool value) EINA_ARG_NONNULL(1);
293
294 /**
295  * Get whether a given file selector entry widget's internal file
296  * selector will raise an Elementary "inner window", instead of a
297  * dedicated Elementary window.
298  *
299  * @param obj The file selector entry widget
300  * @return @c EINA_TRUE if will use an inner window, @c EINA_TRUE
301  * if it will use a dedicated window
302  *
303  * @see elm_fileselector_entry_inwin_mode_set() for more details
304  */
305 EAPI Eina_Bool                   elm_fileselector_entry_inwin_mode_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
306
307 /**
308  * Set the initial file system path for a given file selector entry
309  * widget
310  *
311  * @param obj The file selector entry widget
312  * @param path The path string
313  *
314  * It must be a <b>directory</b> path, which will have the contents
315  * displayed initially in the file selector's view, when invoked
316  * from @p obj. The default initial path is the @c "HOME"
317  * environment variable's value.
318  *
319  * @see elm_fileselector_entry_path_get()
320  */
321 EAPI void                        elm_fileselector_entry_selected_set(Evas_Object *obj, const char *path) EINA_ARG_NONNULL(1);
322
323 /**
324  * Get the parent directory's path to the latest file selection on
325  * a given filer selector entry widget
326  *
327  * @param obj The file selector object
328  * @return The (full) path of the directory of the last selection
329  * on @p obj widget, a @b stringshared string
330  *
331  * @see elm_fileselector_entry_path_set()
332  */
333 EAPI const char                 *elm_fileselector_entry_selected_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
334
335 /**
336  * @}
337  */