Merge remote-tracking branch 'remotes/origin/upstream'
[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 <<<<<<< HEAD
18  * an smart event and as the new text on the entry.
19  *
20  * This widget encapsulates operations on its internal file
21  * selector on its own API. There is less control over its file
22  * selector than that one would have instatiating one directly.
23 =======
24  * a smart event and as the new text on the entry.
25  *
26  * This widget encapsulates operations on its internal file
27  * selector on its own API. There is less control over its file
28  * selector than that one would have instantiating one directly.
29 >>>>>>> remotes/origin/upstream
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 <<<<<<< HEAD
57  * Default contents parts of the fileselector_entry widget that you can use for
58 =======
59  * Default content parts of the fileselector_entry widget that you can use for
60 >>>>>>> remotes/origin/upstream
61  * are:
62  * @li "button icon" - Button icon of the fileselector_entry
63  *
64  * Supported elm_object common APIs.
65  * @li elm_object_part_text_set
66  * @li elm_object_part_text_get
67  * @li elm_object_part_content_set
68  * @li elm_object_part_content_get
69  * @li elm_object_part_content_unset
70  * @li elm_object_disabled_set
71  * @li elm_object_disabled_get
72  *
73  * Here is an example on its usage:
74  * @li @ref fileselector_entry_example
75  *
76  * @see @ref File_Selector_Button for a similar widget.
77  * @{
78  */
79
80 /**
81  * Add a new file selector entry widget to the given parent
82  * Elementary (container) object
83  *
84  * @param parent The parent object
85  * @return a new file selector entry widget handle or @c NULL, on
86  * errors
87  */
88 EAPI Evas_Object                *elm_fileselector_entry_add(Evas_Object *parent);
89
90 /**
91  * Set the title for a given file selector entry widget's window
92  *
93  * @param obj The file selector entry widget
94  * @param title The title string
95  *
96  * This will change the window's title, when the file selector pops
97  * out after a click on the entry's button. Those windows have the
98  * default (unlocalized) value of @c "Select a file" as titles.
99  *
100  * @note It will only take any effect if the file selector
101  * entry widget is @b not under "inwin mode".
102  *
103  * @see elm_fileselector_entry_window_title_get()
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 EAPI const char                 *elm_fileselector_entry_window_title_get(const Evas_Object *obj);
117
118 /**
119  * Set the size of a given file selector entry widget's window,
120  * holding the file selector itself.
121  *
122  * @param obj The file selector entry widget
123  * @param width The window's width
124  * @param height The window's height
125  *
126  * @note it will only take any effect if the file selector entry
127  * widget is @b not under "inwin mode". The default size for the
128  * window (when applicable) is 400x400 pixels.
129  *
130  * @see elm_fileselector_entry_window_size_get()
131  */
132 EAPI void                        elm_fileselector_entry_window_size_set(Evas_Object *obj, Evas_Coord width, Evas_Coord height);
133
134 /**
135  * Get the size of a given file selector entry widget's window,
136  * holding the file selector itself.
137  *
138  * @param obj The file selector entry widget
139  * @param width Pointer into which to store the width value
140  * @param height Pointer into which to store the height value
141  *
142  * @note Use @c NULL pointers on the size values you're not
143  * interested in: they'll be ignored by the function.
144  *
145  * @see elm_fileselector_entry_window_size_set(), for more details
146  */
147 EAPI void                        elm_fileselector_entry_window_size_get(const Evas_Object *obj, Evas_Coord *width, Evas_Coord *height);
148
149 /**
150  * Set the initial file system path and the entry's path string for
151  * a given file selector entry widget
152  *
153  * @param obj The file selector entry widget
154  * @param path The path string
155  *
156  * It must be a <b>directory</b> path, which will have the contents
157  * displayed initially in the file selector's view, when invoked
158  * from @p obj. The default initial path is the @c "HOME"
159  * environment variable's value.
160  *
161  * @see elm_fileselector_entry_path_get()
162  */
163 EAPI void                        elm_fileselector_entry_path_set(Evas_Object *obj, const char *path);
164
165 /**
166  * Get the entry's path string for a given file selector entry
167  * widget
168  *
169  * @param obj The file selector entry widget
170  * @return path The path string
171  *
172  * @see elm_fileselector_entry_path_set() for more details
173  */
174 EAPI const char                 *elm_fileselector_entry_path_get(const Evas_Object *obj);
175
176 /**
177  * Enable/disable a tree view in the given file selector entry
178  * widget's internal file selector
179  *
180  * @param obj The file selector entry widget
181  * @param value @c EINA_TRUE to enable tree view, @c EINA_FALSE to disable
182  *
183  * This has the same effect as elm_fileselector_expandable_set(),
184  * but now applied to a file selector entry's internal file
185  * selector.
186  *
187  * @note There's no way to put a file selector entry's internal
188  * file selector in "grid mode", as one may do with "pure" file
189  * selectors.
190  *
191  * @see elm_fileselector_expandable_get()
192  */
193 EAPI void                        elm_fileselector_entry_expandable_set(Evas_Object *obj, Eina_Bool value);
194
195 /**
196  * Get whether tree view is enabled for the given file selector
197  * entry widget's internal file selector
198  *
199  * @param obj The file selector entry widget
200  * @return @c EINA_TRUE if @p obj widget's internal file selector
201  * is in tree view, @c EINA_FALSE otherwise (and or errors)
202  *
203  * @see elm_fileselector_expandable_set() for more details
204  */
205 EAPI Eina_Bool                   elm_fileselector_entry_expandable_get(const Evas_Object *obj);
206
207 /**
208  * Set whether a given file selector entry widget's internal file
209  * selector is to display folders only or the directory contents,
210  * as well.
211  *
212  * @param obj The file selector entry widget
213  * @param value @c EINA_TRUE to make @p obj widget's internal file
214  * selector only display directories, @c EINA_FALSE to make files
215  * to be displayed in it too
216  *
217  * This has the same effect as elm_fileselector_folder_only_set(),
218  * but now applied to a file selector entry's internal file
219  * selector.
220  *
221  * @see elm_fileselector_folder_only_get()
222  */
223 EAPI void                        elm_fileselector_entry_folder_only_set(Evas_Object *obj, Eina_Bool value);
224
225 /**
226  * Get whether a given file selector entry widget's internal file
227  * selector is displaying folders only or the directory contents,
228  * as well.
229  *
230  * @param obj The file selector entry widget
231  * @return @c EINA_TRUE if @p obj widget's internal file
232  * selector is only displaying directories, @c EINA_FALSE if files
233  * are being displayed in it too (and on errors)
234  *
235  * @see elm_fileselector_entry_folder_only_set() for more details
236  */
237 EAPI Eina_Bool                   elm_fileselector_entry_folder_only_get(const Evas_Object *obj);
238
239 /**
240  * Enable/disable the file name entry box where the user can type
241  * in a name for a file, in a given file selector entry widget's
242  * internal file selector.
243  *
244  * @param obj The file selector entry widget
245  * @param value @c EINA_TRUE to make @p obj widget's internal
246  * file selector a "saving dialog", @c EINA_FALSE otherwise
247  *
248  * This has the same effect as elm_fileselector_is_save_set(),
249  * but now applied to a file selector entry's internal file
250  * selector.
251  *
252  * @see elm_fileselector_is_save_get()
253  */
254 EAPI void                        elm_fileselector_entry_is_save_set(Evas_Object *obj, Eina_Bool value);
255
256 /**
257  * Get whether the given file selector entry widget's internal
258  * file selector is in "saving dialog" mode
259  *
260  * @param obj The file selector entry widget
261  * @return @c EINA_TRUE, if @p obj widget's internal file selector
262  * is in "saving dialog" mode, @c EINA_FALSE otherwise (and on
263  * errors)
264  *
265  * @see elm_fileselector_entry_is_save_set() for more details
266  */
267 EAPI Eina_Bool                   elm_fileselector_entry_is_save_get(const Evas_Object *obj);
268
269 /**
270  * Set whether a given file selector entry widget's internal file
271  * selector will raise an Elementary "inner window", instead of a
272  * dedicated Elementary window. By default, it won't.
273  *
274  * @param obj The file selector entry widget
275  * @param value @c EINA_TRUE to make it use an inner window, @c
276  * EINA_TRUE to make it use a dedicated window
277  *
278  * @see elm_win_inwin_add() for more information on inner windows
279  * @see elm_fileselector_entry_inwin_mode_get()
280  */
281 EAPI void                        elm_fileselector_entry_inwin_mode_set(Evas_Object *obj, Eina_Bool value);
282
283 /**
284  * Get whether a given file selector entry widget's internal file
285  * selector will raise an Elementary "inner window", instead of a
286  * dedicated Elementary window.
287  *
288  * @param obj The file selector entry widget
289  * @return @c EINA_TRUE if will use an inner window, @c EINA_TRUE
290  * if it will use a dedicated window
291  *
292  * @see elm_fileselector_entry_inwin_mode_set() for more details
293  */
294 EAPI Eina_Bool                   elm_fileselector_entry_inwin_mode_get(const Evas_Object *obj);
295
296 /**
297  * Set the initial file system path for a given file selector entry
298  * widget
299  *
300  * @param obj The file selector entry widget
301  * @param path The path string
302  *
303  * It must be a <b>directory</b> path, which will have the contents
304  * displayed initially in the file selector's view, when invoked
305  * from @p obj. The default initial path is the @c "HOME"
306  * environment variable's value.
307  *
308  * @see elm_fileselector_entry_path_get()
309  */
310 EAPI void                        elm_fileselector_entry_selected_set(Evas_Object *obj, const char *path);
311
312 /**
313  * Get the parent directory's path to the latest file selection on
314  * a given filer selector entry widget
315  *
316  * @param obj The file selector object
317  * @return The (full) path of the directory of the last selection
318  * on @p obj widget, a @b stringshared string
319  *
320  * @see elm_fileselector_entry_path_set()
321  */
322 EAPI const char                 *elm_fileselector_entry_selected_get(const Evas_Object *obj);
323
324 /**
325  * @}
326  */