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