Macros | |
#define | ELM_FILESELECTOR_CLASS elm_fileselector_class_get() |
Elementary fileselector class. | |
#define | ELM_FILESELECTOR_EVENT_DONE (&(_ELM_FILESELECTOR_EVENT_DONE)) |
Called when OK button was pressed. More... | |
#define | ELM_FILESELECTOR_EVENT_ACTIVATED (&(_ELM_FILESELECTOR_EVENT_ACTIVATED)) |
Called when the filesector was activated. | |
#define | ELM_FILESELECTOR_EVENT_SELECTED_INVALID (&(_ELM_FILESELECTOR_EVENT_SELECTED_INVALID)) |
Called when fileselector was selected. | |
#define | ELM_FILESELECTOR_EVENT_DIRECTORY_OPEN (&(_ELM_FILESELECTOR_EVENT_DIRECTORY_OPEN)) |
Called when a directory was opened. | |
Functions | |
Evas_Object * | elm_fileselector_add (Evas_Object *parent) |
Add a new file selector widget to the given parent Elementary (container) object. More... | |
void | elm_fileselector_is_save_set (Evas_Object *obj, Eina_Bool is_save) |
Enable/disable the file name entry box where the user can type in a name for a file, in a given file selector widget. More... | |
Eina_Bool | elm_fileselector_is_save_get (const Evas_Object *obj) |
Get whether the given file selector is in "saving dialog" mode. More... | |
void | elm_fileselector_folder_only_set (Evas_Object *obj, Eina_Bool only) |
Enable/disable folder-only view for a given file selector widget. More... | |
Eina_Bool | elm_fileselector_folder_only_get (const Evas_Object *obj) |
Get whether folder-only view is set for a given file selector widget. More... | |
void | elm_fileselector_expandable_set (Evas_Object *obj, Eina_Bool expand) |
Enable/disable a tree view in the given file selector widget, if it's in ELM_FILESELECTOR_LIST mode More... | |
Eina_Bool | elm_fileselector_expandable_get (const Evas_Object *obj) |
Get whether tree view is enabled for the given file selector widget. More... | |
void | elm_fileselector_path_set (Evas_Object *obj, const char *path) |
Set, programmatically, the directory that a given file selector widget will display contents from. More... | |
const char * | elm_fileselector_path_get (const Evas_Object *obj) |
Get the parent directory's path that a given file selector widget is displaying. More... | |
void | elm_fileselector_mode_set (Evas_Object *obj, Elm_Fileselector_Mode mode) |
Set the mode in which a given file selector widget will display (layout) file system entries in its view. More... | |
Elm_Fileselector_Mode | elm_fileselector_mode_get (const Evas_Object *obj) |
Get the mode in which a given file selector widget is displaying (layouting) file system entries in its view. More... | |
void | elm_fileselector_multi_select_set (Evas_Object *obj, Eina_Bool multi) |
Enable or disable multi-selection in the file selector widget. More... | |
Eina_Bool | elm_fileselector_multi_select_get (const Evas_Object *obj) |
Get if multi-selection in the file selector is enabled or disabled. More... | |
Eina_Bool | elm_fileselector_selected_set (Evas_Object *obj, const char *path) |
Set, programmatically, the currently selected file/directory in the given file selector widget. More... | |
const char * | elm_fileselector_selected_get (const Evas_Object *obj) |
Get the currently selected item's (full) path, in the given file selector widget. More... | |
const Eina_List * | elm_fileselector_selected_paths_get (const Evas_Object *obj) |
Get a list of selected paths in the file selector. More... | |
Eina_Bool | elm_fileselector_mime_types_filter_append (Evas_Object *obj, const char *mime_types, const char *filter_name) |
Append mime types filter into filter list. More... | |
Eina_Bool | elm_fileselector_custom_filter_append (Evas_Object *obj, Elm_Fileselector_Filter_Func func, void *data, const char *filter_name) |
Append custom filter into filter list. More... | |
void | elm_fileselector_filters_clear (Evas_Object *obj) |
Clear all filters registered. More... | |
void | elm_fileselector_hidden_visible_set (Evas_Object *obj, Eina_Bool visible) |
Enable or disable visibility of hidden files/directories in the file selector widget. More... | |
Eina_Bool | elm_fileselector_hidden_visible_get (const Evas_Object *obj) |
Get if hidden files/directories in the file selector widget are visible or not. More... | |
void | elm_fileselector_thumbnail_size_set (Evas_Object *obj, Evas_Coord w, Evas_Coord h) |
Set the size for the thumbnail of the file selector widget's view. More... | |
void | elm_fileselector_thumbnail_size_get (const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) |
Get the size for the thumbnail of a given file selector widget. More... | |
Elm_Fileselector_Sort | elm_fileselector_sort_method_get (const Evas_Object *obj) |
Get the sort method of the file selector widget. More... | |
void | elm_fileselector_sort_method_set (Evas_Object *obj, Elm_Fileselector_Sort sort) |
Set the sort method of the file selector widget. More... | |
EOAPI void | elm_obj_fileselector_buttons_ok_cancel_set (Eo *obj, Eina_Bool visible) |
Enable/disable the "ok" and "cancel" buttons on a given file selector widget. More... | |
EOAPI Eina_Bool | elm_obj_fileselector_buttons_ok_cancel_get (const Eo *obj) |
Get whether the "ok" and "cancel" buttons on a given file selector widget are being shown. More... | |
A file selector is a widget that allows a user to navigate through a file system, reporting file selections back via its API.
It contains shortcut buttons for home directory (~
) and to jump one directory upwards (..), as well as cancel/ok buttons to confirm/cancel a given selection. After either one of those two former actions, the file selector will issue its "done"
smart callback.
There's a text entry on it, too, showing the name of the current selection. There's the possibility of making it editable, so it is useful on file saving dialogs on applications, where one gives a file name to save contents to, in a given directory in the system. This custom file name will be reported on the "done"
smart callback (explained in sequence).
Finally, it has a view to display file system items into in two possible forms:
If Elementary is built with support of the Ethumb thumbnailing library, the second form of view will display preview thumbnails of files which it supports.
This widget inherits from the Layout one, so that all the functions acting on it also work for file selector objects.
This widget emits the following signals, besides the ones sent from Layout :
"activated"
- the user activated a file. This can happen by double-clicking or pressing Enter key. (event_info
is a pointer to the activated file path)"selected"
- the user has clicked on a file (when not in folders-only mode) or directory (when in folders-only mode)"selected,invalid"
- the user has tried to access wrong path which does not exist."directory,open"
- the list has been populated with new content (event_info
is a pointer to the directory's path, a stringshared string)"done"
- the user has clicked on the "ok" or "cancel" buttons (event_info
is a pointer to the selection's path, a stringshared string)"focused"
- When the fileselector has received focus. (since 1.9)"unfocused"
- When the fileselector has lost focus. (since 1.9)For text, elm_layout_text_set() will work here on:
"ok"
- OK button label if the ok button is set. "cancel"
- Cancel button label if the cancel button is set. #define ELM_FILESELECTOR_EVENT_DONE (&(_ELM_FILESELECTOR_EVENT_DONE)) |
Called when OK button was pressed.
Defines how a file selector widget is to layout its contents (file system entries).
Fileselector sorting modes.
Defines how a file selector widget is to layout its contents (file system entries).
Fileselector sorting modes.
Evas_Object * elm_fileselector_add | ( | Evas_Object * | parent | ) |
Add a new file selector widget to the given parent Elementary (container) object.
parent | The parent object |
NULL
, on errorsThis function inserts a new file selector widget on the canvas.
References EINA_SAFETY_ON_NULL_RETURN_VAL.
void elm_fileselector_is_save_set | ( | Evas_Object * | obj, |
Eina_Bool | is_save | ||
) |
Enable/disable the file name entry box where the user can type in a name for a file, in a given file selector widget.
obj | The file selector object |
is_save | EINA_TRUE to make the file selector a "saving
dialog", EINA_FALSE otherwise. Default is EINA_TRUE . |
Having the entry editable is useful on file saving dialogs on applications, where one gives a file name to save contents to, in a given directory in the system. This custom file name will be reported on the "done"
smart callback.
Eina_Bool elm_fileselector_is_save_get | ( | const Evas_Object * | obj | ) |
Get whether the given file selector is in "saving dialog" mode.
obj | The file selector object |
EINA_TRUE
, if the file selector is in "saving dialog" mode, EINA_FALSE
otherwise (and on errors)References EINA_FALSE.
void elm_fileselector_folder_only_set | ( | Evas_Object * | obj, |
Eina_Bool | only | ||
) |
Enable/disable folder-only view for a given file selector widget.
obj | The file selector object |
only | EINA_TRUE to make obj only display directories, EINA_FALSE to make files to be displayed in it too |
If enabled, the widget's view will only display folder items, naturally.
Eina_Bool elm_fileselector_folder_only_get | ( | const Evas_Object * | obj | ) |
Get whether folder-only view is set for a given file selector widget.
obj | The file selector object |
EINA_TRUE
if obj
is only displaying directories, EINA_FALSE
if files are being displayed in it too (and on errors)References EINA_FALSE.
void elm_fileselector_expandable_set | ( | Evas_Object * | obj, |
Eina_Bool | expand | ||
) |
Enable/disable a tree view in the given file selector widget, if it's in ELM_FILESELECTOR_LIST
mode
obj | The file selector object |
expand | EINA_TRUE to enable tree view, EINA_FALSE to disable |
In a tree view, arrows are created on the sides of directories, allowing them to expand in place.
Eina_Bool elm_fileselector_expandable_get | ( | const Evas_Object * | obj | ) |
Get whether tree view is enabled for the given file selector widget.
obj | The file selector object |
EINA_TRUE
if obj
is in tree view, EINA_FALSE
otherwise (and or errors)References EINA_FALSE.
void elm_fileselector_path_set | ( | Evas_Object * | obj, |
const char * | path | ||
) |
Set, programmatically, the directory that a given file selector widget will display contents from.
obj | The file selector object |
path | The path to display in obj |
This will change the directory that obj
is displaying. It will also clear the text entry area on the obj
object, which displays select files' names.
References ELM_FILESELECTOR_CLASS, and ERR.
Referenced by elm_fileselector_button_path_set(), and elm_fileselector_entry_path_set().
const char * elm_fileselector_path_get | ( | const Evas_Object * | obj | ) |
Get the parent directory's path that a given file selector widget is displaying.
obj | The file selector object |
References ELM_FILESELECTOR_CLASS, and ERR.
Referenced by elm_fileselector_button_path_get(), and elm_fileselector_entry_path_get().
void elm_fileselector_mode_set | ( | Evas_Object * | obj, |
Elm_Fileselector_Mode | mode | ||
) |
Set the mode in which a given file selector widget will display (layout) file system entries in its view.
obj | The file selector object |
mode | The mode of the fileselector, being it one of ELM_FILESELECTOR_LIST (default) or ELM_FILESELECTOR_GRID. The first one, naturally, will display the files in a list. The latter will make the widget to display its entries in a grid form. |
Elm_Fileselector_Mode elm_fileselector_mode_get | ( | const Evas_Object * | obj | ) |
Get the mode in which a given file selector widget is displaying (layouting) file system entries in its view.
obj | The fileselector object |
References ELM_FILESELECTOR_LAST.
void elm_fileselector_multi_select_set | ( | Evas_Object * | obj, |
Eina_Bool | multi | ||
) |
Enable or disable multi-selection in the file selector widget.
obj | The file selector object |
multi | Multi-select enable/disable. Default is disabled. |
This enables (EINA_TRUE
) or disables (EINA_FALSE
) multi-selection in the list/grid of the file selector widget. This allows more than 1 item to be selected. To retrieve the list of selected paths, use elm_fileselector_selected_paths_get().
Eina_Bool elm_fileselector_multi_select_get | ( | const Evas_Object * | obj | ) |
Get if multi-selection in the file selector is enabled or disabled.
obj | The file selector object |
EINA_TRUE
= enabled/EINA_FALSE
= disabled). Default is EINA_FALSE
.References EINA_FALSE.
Eina_Bool elm_fileselector_selected_set | ( | Evas_Object * | obj, |
const char * | path | ||
) |
Set, programmatically, the currently selected file/directory in the given file selector widget.
obj | The file selector object |
path | The (full) path to a file or directory |
EINA_TRUE
on success, EINA_FALSE
on failure. The latter case occurs if the directory or file pointed to do not exist.References EINA_FALSE, ELM_FILESELECTOR_CLASS, and ERR.
Referenced by elm_fileselector_entry_selected_set().
const char * elm_fileselector_selected_get | ( | const Evas_Object * | obj | ) |
Get the currently selected item's (full) path, in the given file selector widget.
obj | The file selector object |
obj
object's text entry, if made, will appear on the return string of this function, naturally.References ELM_FILESELECTOR_CLASS, and ERR.
Referenced by elm_fileselector_entry_selected_get().
const Eina_List * elm_fileselector_selected_paths_get | ( | const Evas_Object * | obj | ) |
Get a list of selected paths in the file selector.
obj | The file selector object |
It returns a list of the selected paths. This list pointer is only valid so long as the selection doesn't change (no items are selected or unselected, or unselected implicitly by deletion). The list contains const char *. The order of the items in this list is the order which they were selected, i.e. the first item in this list is the first item that was selected, and so on.
References ELM_FILESELECTOR_CLASS, and ERR.
Eina_Bool elm_fileselector_mime_types_filter_append | ( | Evas_Object * | obj, |
const char * | mime_types, | ||
const char * | filter_name | ||
) |
Append mime types filter into filter list.
obj | The file selector object |
mime_types | comma(,) separated mime types to be allowed. |
filter_name | The name to be displayed, mime_types will be displayed if NULL |
EINA_TRUE
on success, EINA_FALSE
on failure.References EINA_FALSE.
Eina_Bool elm_fileselector_custom_filter_append | ( | Evas_Object * | obj, |
Elm_Fileselector_Filter_Func | func, | ||
void * | data, | ||
const char * | filter_name | ||
) |
Append custom filter into filter list.
obj | The file selector object |
func | The function to call when manipulating files and directories. |
data | The data to be passed to this func call. |
filter_name | The name to be displayed, "custom" will be displayed if NULL |
EINA_TRUE
on success, EINA_FALSE
on failure.References EINA_FALSE.
void elm_fileselector_filters_clear | ( | Evas_Object * | obj | ) |
Clear all filters registered.
obj | The file selector object |
void elm_fileselector_hidden_visible_set | ( | Evas_Object * | obj, |
Eina_Bool | visible | ||
) |
Enable or disable visibility of hidden files/directories in the file selector widget.
obj | The file selector object |
visible | Visibility of hidden files/directories. Default is disabled. |
This enables (EINA_TRUE
) or disables (EINA_FALSE
) visibility of hidden files/directories in the list/grid of the file selector widget.
Eina_Bool elm_fileselector_hidden_visible_get | ( | const Evas_Object * | obj | ) |
Get if hidden files/directories in the file selector widget are visible or not.
obj | The file selector object |
EINA_TRUE
= enabled/EINA_FALSE
= disabled). Default is EINA_FALSE
.References EINA_FALSE.
void elm_fileselector_thumbnail_size_set | ( | Evas_Object * | obj, |
Evas_Coord | w, | ||
Evas_Coord | h | ||
) |
Set the size for the thumbnail of the file selector widget's view.
obj | The file selector object |
w | The thumbnail's width. |
h | The thumbnail's height. |
void elm_fileselector_thumbnail_size_get | ( | const Evas_Object * | obj, |
Evas_Coord * | w, | ||
Evas_Coord * | h | ||
) |
Get the size for the thumbnail of a given file selector widget.
obj | The file selector object. |
w | Pointer to a variable where to store the thumbnail's width. |
h | Pointer to a variable where to store the thumbnail's height. |
NULL
pointers on the size values you're not interested in: they'll be ignored by the function.Elm_Fileselector_Sort elm_fileselector_sort_method_get | ( | const Evas_Object * | obj | ) |
Get the sort method of the file selector widget.
obj | The file selector object |
References ELM_FILESELECTOR_SORT_LAST.
void elm_fileselector_sort_method_set | ( | Evas_Object * | obj, |
Elm_Fileselector_Sort | sort | ||
) |
Set the sort method of the file selector widget.
obj | The file selector object |
sort | The sort method |
EOAPI void elm_obj_fileselector_buttons_ok_cancel_set | ( | Eo * | obj, |
Eina_Bool | visible | ||
) |
Enable/disable the "ok" and "cancel" buttons on a given file selector widget.
See also elm_obj_fileselector_buttons_ok_cancel_get.
[in] | obj | The object. |
[in] | visible | true to show buttons, false to hide. |
EOAPI Eina_Bool elm_obj_fileselector_buttons_ok_cancel_get | ( | const Eo * | obj | ) |
Get whether the "ok" and "cancel" buttons on a given file selector widget are being shown.
See also elm_obj_fileselector_buttons_ok_cancel_set for more details.
[in] | obj | The object. |
true
to show buttons, false
to hide.