summaryrefslogtreecommitdiff
path: root/legacy/elementary/src/lib/elc_fileselector.h
diff options
context:
space:
mode:
authorDaniel Zaoui <daniel.zaoui@samsung.com>2013-04-28 09:02:06 +0300
committerDaniel Zaoui <daniel.zaoui@samsung.com>2013-04-28 09:02:06 +0300
commit4d6b7083bf5fbfcae6966148f0af95147b286951 (patch)
treeee6f25a771140ae06203cbc80dbc33e2d6b074d4 /legacy/elementary/src/lib/elc_fileselector.h
parent961fc60e3d9d3ac75dcd77d44d7cf0295fcf1817 (diff)
Elementary: File selectors header split.
Diffstat (limited to 'legacy/elementary/src/lib/elc_fileselector.h')
-rw-r--r--legacy/elementary/src/lib/elc_fileselector.h467
1 files changed, 7 insertions, 460 deletions
diff --git a/legacy/elementary/src/lib/elc_fileselector.h b/legacy/elementary/src/lib/elc_fileselector.h
index 24d37e1..8ad6ae9 100644
--- a/legacy/elementary/src/lib/elc_fileselector.h
+++ b/legacy/elementary/src/lib/elc_fileselector.h
@@ -52,471 +52,18 @@
52 * @li @ref fileselector_example 52 * @li @ref fileselector_example
53 */ 53 */
54 54
55#define ELM_OBJ_FILESELECTOR_CLASS elm_obj_fileselector_class_get()
56
57const Eo_Class *elm_obj_fileselector_class_get(void) EINA_CONST;
58
59extern EAPI Eo_Op ELM_OBJ_FILESELECTOR_BASE_ID;
60
61enum
62{
63 ELM_OBJ_FILESELECTOR_SUB_ID_IS_SAVE_SET,
64 ELM_OBJ_FILESELECTOR_SUB_ID_IS_SAVE_GET,
65 ELM_OBJ_FILESELECTOR_SUB_ID_FOLDER_ONLY_SET,
66 ELM_OBJ_FILESELECTOR_SUB_ID_FOLDER_ONLY_GET,
67 ELM_OBJ_FILESELECTOR_SUB_ID_BUTTONS_OK_CANCEL_SET,
68 ELM_OBJ_FILESELECTOR_SUB_ID_BUTTONS_OK_CANCEL_GET,
69 ELM_OBJ_FILESELECTOR_SUB_ID_EXPANDABLE_SET,
70 ELM_OBJ_FILESELECTOR_SUB_ID_EXPANDABLE_GET,
71 ELM_OBJ_FILESELECTOR_SUB_ID_PATH_SET,
72 ELM_OBJ_FILESELECTOR_SUB_ID_PATH_GET,
73 ELM_OBJ_FILESELECTOR_SUB_ID_MODE_SET,
74 ELM_OBJ_FILESELECTOR_SUB_ID_MODE_GET,
75 ELM_OBJ_FILESELECTOR_SUB_ID_SELECTED_GET,
76 ELM_OBJ_FILESELECTOR_SUB_ID_SELECTED_SET,
77 ELM_OBJ_FILESELECTOR_SUB_ID_LAST
78};
79
80#define ELM_OBJ_FILESELECTOR_ID(sub_id) (ELM_OBJ_FILESELECTOR_BASE_ID + sub_id)
81
82
83/**
84 * @def elm_obj_fileselector_is_save_set
85 * @since 1.8
86 *
87 * Enable/disable the file name entry box where the user can type
88 * in a name for a file, in a given file selector widget
89 *
90 * @param[in] is_save
91 *
92 * @see elm_fileselector_is_save_set
93 */
94#define elm_obj_fileselector_is_save_set(is_save) ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_IS_SAVE_SET), EO_TYPECHECK(Eina_Bool, is_save)
95
96/**
97 * @def elm_obj_fileselector_is_save_get
98 * @since 1.8
99 *
100 * Get whether the given file selector is in "saving dialog" mode
101 *
102 * @param[out] ret
103 *
104 * @see elm_fileselector_is_save_get
105 */
106#define elm_obj_fileselector_is_save_get(ret) ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_IS_SAVE_GET), EO_TYPECHECK(Eina_Bool *, ret)
107
108/**
109 * @def elm_obj_fileselector_folder_only_set
110 * @since 1.8
111 *
112 * Enable/disable folder-only view for a given file selector widget
113 *
114 * @param[in] only
115 *
116 * @see elm_fileselector_folder_only_set
117 */
118#define elm_obj_fileselector_folder_only_set(only) ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_FOLDER_ONLY_SET), EO_TYPECHECK(Eina_Bool, only)
119
120/**
121 * @def elm_obj_fileselector_folder_only_get
122 * @since 1.8
123 *
124 * Get whether folder-only view is set for a given file selector
125 *
126 * @param[out] ret
127 *
128 * @see elm_fileselector_folder_only_get
129 */
130#define elm_obj_fileselector_folder_only_get(ret) ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_FOLDER_ONLY_GET), EO_TYPECHECK(Eina_Bool *, ret)
131
132/**
133 * @def elm_obj_fileselector_buttons_ok_cancel_set
134 * @since 1.8
135 *
136 * Enable/disable the "ok" and "cancel" buttons on a given file
137 *
138 * @param[in] visible
139 *
140 * @see elm_fileselector_buttons_ok_cancel_set
141 */
142#define elm_obj_fileselector_buttons_ok_cancel_set(visible) ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_BUTTONS_OK_CANCEL_SET), EO_TYPECHECK(Eina_Bool, visible)
143
144/**
145 * @def elm_obj_fileselector_buttons_ok_cancel_get
146 * @since 1.8
147 *
148 * Get whether the "ok" and "cancel" buttons on a given file
149 *
150 * @param[out] ret
151 *
152 * @see elm_fileselector_buttons_ok_cancel_get
153 */
154#define elm_obj_fileselector_buttons_ok_cancel_get(ret) ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_BUTTONS_OK_CANCEL_GET), EO_TYPECHECK(Eina_Bool *, ret)
155
156/**
157 * @def elm_obj_fileselector_expandable_set
158 * @since 1.8
159 *
160 * Enable/disable a tree view in the given file selector widget,
161 * <b>if it's in @c #ELM_FILESELECTOR_LIST mode</b>
162 *
163 * @param[in] expand
164 *
165 * @see elm_fileselector_expandable_set
166 */
167#define elm_obj_fileselector_expandable_set(expand) ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_EXPANDABLE_SET), EO_TYPECHECK(Eina_Bool, expand)
168
169/**
170 * @def elm_obj_fileselector_expandable_get
171 * @since 1.8
172 *
173 * Get whether tree view is enabled for the given file selector
174 *
175 * @param[out] ret
176 *
177 * @see elm_fileselector_expandable_get
178 */
179#define elm_obj_fileselector_expandable_get(ret) ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_EXPANDABLE_GET), EO_TYPECHECK(Eina_Bool *, ret)
180
181/**
182 * @def elm_obj_fileselector_path_set
183 * @since 1.8
184 *
185 * Set, programmatically, the directory that a given file
186 * selector widget will display contents from
187 *
188 * @param[in] _path
189 *
190 * @see elm_fileselector_path_set
191 */
192#define elm_obj_fileselector_path_set(_path) ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_PATH_SET), EO_TYPECHECK(const char *, _path)
193
194/**
195 * @def elm_obj_fileselector_path_get
196 * @since 1.8
197 *
198 * Get the parent directory's path that a given file selector
199 * selector widget will display contents from
200 *
201 * @param[out] ret
202 *
203 * @see elm_fileselector_path_get
204 */
205#define elm_obj_fileselector_path_get(ret) ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_PATH_GET), EO_TYPECHECK(const char **, ret)
206
207/**
208 * @def elm_obj_fileselector_mode_set
209 * @since 1.8
210 *
211 * Set the mode in which a given file selector widget will display
212 * (layout) file system entries in its view
213 *
214 * @param[in] mode
215 *
216 * @see elm_fileselector_mode_set
217 */
218#define elm_obj_fileselector_mode_set(mode) ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_MODE_SET), EO_TYPECHECK(Elm_Fileselector_Mode, mode)
219
220/**
221 * @def elm_obj_fileselector_mode_get
222 * @since 1.8
223 *
224 * Get the mode in which a given file selector widget is displaying
225 *
226 * @param[out] ret
227 *
228 * @see elm_fileselector_mode_get
229 */
230#define elm_obj_fileselector_mode_get(ret) ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_MODE_GET), EO_TYPECHECK(Elm_Fileselector_Mode *, ret)
231
232/**
233 * @def elm_obj_fileselector_selected_get
234 * @since 1.8
235 *
236 * Get the currently selected item's (full) path, in the given file
237 * the given file selector widget
238 *
239 * @param[out] ret
240 *
241 * @see elm_fileselector_selected_get
242 */
243#define elm_obj_fileselector_selected_get(ret) ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_SELECTED_GET), EO_TYPECHECK(const char **, ret)
244
245/**
246 * @def elm_obj_fileselector_selected_set
247 * @since 1.8
248 *
249 * Set, programmatically, the currently selected file/directory in
250 * the given file selector widget
251 *
252 * @param[in] _path
253 * @param[out] ret
254 *
255 * @see elm_fileselector_selected_set
256 */
257#define elm_obj_fileselector_selected_set(_path, ret) ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_SELECTED_SET), EO_TYPECHECK(const char *, _path), EO_TYPECHECK(Eina_Bool *, ret)
258
259/** 55/**
260 * @addtogroup Fileselector 56 * @addtogroup Fileselector
261 * @{ 57 * @{
262 */ 58 */
263 59
264/** 60#include "elc_fileselector_common.h"
265 * Defines how a file selector widget is to layout its contents 61#ifdef EFL_EO_API_SUPPORT
266 * (file system entries). 62#include "elc_fileselector_eo.h"
267 */ 63#endif
268typedef enum 64#ifndef EFL_NOLEGACY_API_SUPPORT
269{ 65#include "elc_fileselector_legacy.h"
270 ELM_FILESELECTOR_LIST = 0, /**< layout as a list */ 66#endif
271 ELM_FILESELECTOR_GRID, /**< layout as a grid */
272 ELM_FILESELECTOR_LAST /**< sentinel (helper) value, not used */
273} Elm_Fileselector_Mode;
274
275/**
276 * Add a new file selector widget to the given parent Elementary
277 * (container) object
278 *
279 * @param parent The parent object
280 * @return a new file selector widget handle or @c NULL, on errors
281 *
282 * This function inserts a new file selector widget on the canvas.
283 *
284 * @ingroup Fileselector
285 */
286EAPI Evas_Object *elm_fileselector_add(Evas_Object *parent);
287
288/**
289 * Enable/disable the file name entry box where the user can type
290 * in a name for a file, in a given file selector widget
291 *
292 * @param obj The file selector object
293 * @param is_save @c EINA_TRUE to make the file selector a "saving
294 * dialog", @c EINA_FALSE otherwise
295 *
296 * Having the entry editable is useful on file saving dialogs on
297 * applications, where one gives a file name to save contents to,
298 * in a given directory in the system. This custom file name will
299 * be reported on the @c "done" smart callback.
300 *
301 * @see elm_fileselector_is_save_get()
302 *
303 * @ingroup Fileselector
304 */
305EAPI void elm_fileselector_is_save_set(Evas_Object *obj, Eina_Bool is_save);
306
307/**
308 * Get whether the given file selector is in "saving dialog" mode
309 *
310 * @param obj The file selector object
311 * @return @c EINA_TRUE, if the file selector is in "saving dialog"
312 * mode, @c EINA_FALSE otherwise (and on errors)
313 *
314 * @see elm_fileselector_is_save_set() for more details
315 *
316 * @ingroup Fileselector
317 */
318EAPI Eina_Bool elm_fileselector_is_save_get(const Evas_Object *obj);
319
320/**
321 * Enable/disable folder-only view for a given file selector widget
322 *
323 * @param obj The file selector object
324 * @param only @c EINA_TRUE to make @p obj only display
325 * directories, @c EINA_FALSE to make files to be displayed in it
326 * too
327 *
328 * If enabled, the widget's view will only display folder items,
329 * naturally.
330 *
331 * @see elm_fileselector_folder_only_get()
332 *
333 * @ingroup Fileselector
334 */
335EAPI void elm_fileselector_folder_only_set(Evas_Object *obj, Eina_Bool only);
336
337/**
338 * Get whether folder-only view is set for a given file selector
339 * widget
340 *
341 * @param obj The file selector object
342 * @return only @c EINA_TRUE if @p obj is only displaying
343 * directories, @c EINA_FALSE if files are being displayed in it
344 * too (and on errors)
345 *
346 * @see elm_fileselector_folder_only_get()
347 *
348 * @ingroup Fileselector
349 */
350EAPI Eina_Bool elm_fileselector_folder_only_get(const Evas_Object *obj);
351
352/**
353 * Enable/disable the "ok" and "cancel" buttons on a given file
354 * selector widget
355 *
356 * @param obj The file selector object
357 * @param buttons @c EINA_TRUE to show buttons, @c EINA_FALSE to hide.
358 *
359 * @note A file selector without those buttons will never emit the
360 * @c "done" smart event, and is only usable if one is just hooking
361 * to the other two events.
362 *
363 * @see elm_fileselector_buttons_ok_cancel_get()
364 *
365 * @ingroup Fileselector
366 */
367EAPI void elm_fileselector_buttons_ok_cancel_set(Evas_Object *obj, Eina_Bool buttons);
368
369/**
370 * Get whether the "ok" and "cancel" buttons on a given file
371 * selector widget are being shown.
372 *
373 * @param obj The file selector object
374 * @return @c EINA_TRUE if they are being shown, @c EINA_FALSE
375 * otherwise (and on errors)
376 *
377 * @see elm_fileselector_buttons_ok_cancel_set() for more details
378 *
379 * @ingroup Fileselector
380 */
381EAPI Eina_Bool elm_fileselector_buttons_ok_cancel_get(const Evas_Object *obj);
382
383/**
384 * Enable/disable a tree view in the given file selector widget,
385 * <b>if it's in @c #ELM_FILESELECTOR_LIST mode</b>
386 *
387 * @param obj The file selector object
388 * @param expand @c EINA_TRUE to enable tree view, @c EINA_FALSE to
389 * disable
390 *
391 * In a tree view, arrows are created on the sides of directories,
392 * allowing them to expand in place.
393 *
394 * @note If it's in other mode, the changes made by this function
395 * will only be visible when one switches back to "list" mode.
396 *
397 * @see elm_fileselector_expandable_get()
398 *
399 * @ingroup Fileselector
400 */
401EAPI void elm_fileselector_expandable_set(Evas_Object *obj, Eina_Bool expand);
402
403/**
404 * Get whether tree view is enabled for the given file selector
405 * widget
406 *
407 * @param obj The file selector object
408 * @return @c EINA_TRUE if @p obj is in tree view, @c EINA_FALSE
409 * otherwise (and or errors)
410 *
411 * @see elm_fileselector_expandable_set() for more details
412 *
413 * @ingroup Fileselector
414 */
415EAPI Eina_Bool elm_fileselector_expandable_get(const Evas_Object *obj);
416
417/**
418 * Set, programmatically, the @b directory that a given file
419 * selector widget will display contents from
420 *
421 * @param obj The file selector object
422 * @param path The path to display in @p obj
423 *
424 * This will change the @b directory that @p obj is displaying. It
425 * will also clear the text entry area on the @p obj object, which
426 * displays select files' names.
427 *
428 * @see elm_fileselector_path_get()
429 *
430 * @ingroup Fileselector
431 */
432EAPI void elm_fileselector_path_set(Evas_Object *obj, const char *path);
433
434/**
435 * Get the parent directory's path that a given file selector
436 * widget is displaying
437 *
438 * @param obj The file selector object
439 * @return The (full) path of the directory the file selector is
440 * displaying, a @b stringshared string
441 *
442 * @see elm_fileselector_path_set()
443 *
444 * @ingroup Fileselector
445 */
446EAPI const char *elm_fileselector_path_get(const Evas_Object *obj);
447
448/**
449 * Set, programmatically, the currently selected file/directory in
450 * the given file selector widget
451 *
452 * @param obj The file selector object
453 * @param path The (full) path to a file or directory
454 * @return @c EINA_TRUE on success, @c EINA_FALSE on failure. The
455 * latter case occurs if the directory or file pointed to do not
456 * exist.
457 *
458 * @see elm_fileselector_selected_get()
459 *
460 * @ingroup Fileselector
461 */
462EAPI Eina_Bool elm_fileselector_selected_set(Evas_Object *obj, const char *path);
463
464/**
465 * Get the currently selected item's (full) path, in the given file
466 * selector widget
467 *
468 * @param obj The file selector object
469 * @return The absolute path of the selected item, a @b
470 * stringshared string
471 *
472 * @note Custom editions on @p obj object's text entry, if made,
473 * will appear on the return string of this function, naturally.
474 *
475 * @see elm_fileselector_selected_set() for more details
476 *
477 * @ingroup Fileselector
478 */
479EAPI const char *elm_fileselector_selected_get(const Evas_Object *obj);
480
481/**
482 * Set the mode in which a given file selector widget will display
483 * (layout) file system entries in its view
484 *
485 * @param obj The file selector object
486 * @param mode The mode of the fileselector, being it one of #ELM_FILESELECTOR_LIST
487 * (default) or #ELM_FILESELECTOR_GRID. The first one, naturally, will display
488 * the files in a list. The latter will make the widget to display its entries
489 * in a grid form.
490 *
491 * @note By using elm_fileselector_expandable_set(), the user may
492 * trigger a tree view for that list.
493 *
494 * @note If Elementary is built with support of the Ethumb
495 * thumbnailing library, the second form of view will display
496 * preview thumbnails of files which it supports. You must have
497 * elm_need_ethumb() called in your Elementary for thumbnailing to
498 * work, though.
499 *
500 * @see elm_fileselector_expandable_set().
501 * @see elm_fileselector_mode_get().
502 *
503 * @ingroup Fileselector
504 */
505EAPI void elm_fileselector_mode_set(Evas_Object *obj, Elm_Fileselector_Mode mode);
506
507/**
508 * Get the mode in which a given file selector widget is displaying
509 * (layouting) file system entries in its view
510 *
511 * @param obj The fileselector object
512 * @return The mode in which the fileselector is at
513 *
514 * @see elm_fileselector_mode_set() for more details
515 *
516 * @ingroup Fileselector
517 */
518EAPI Elm_Fileselector_Mode elm_fileselector_mode_get(const Evas_Object *obj);
519
520/** 67/**
521 * @} 68 * @}
522 */ 69 */