2012-08-01 14:03:33 -07:00
|
|
|
#ifndef ELM_WIDGET_FILESELECTOR_H
|
|
|
|
#define ELM_WIDGET_FILESELECTOR_H
|
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
#include "Elementary.h"
|
2012-08-01 14:03:33 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @addtogroup Widget
|
|
|
|
* @{
|
|
|
|
*
|
|
|
|
* @section elm-fileselector-class The Elementary Fileselector Class
|
|
|
|
*
|
|
|
|
* Elementary, besides having the @ref Fileselector widget, exposes its
|
|
|
|
* foundation -- the Elementary Fileselector Class -- in order to create other
|
|
|
|
* widgets which are a fileselector with some more logic on top.
|
|
|
|
*/
|
|
|
|
|
2013-06-18 17:00:41 -07:00
|
|
|
typedef struct _Elm_Fileselector_Filter Elm_Fileselector_Filter;
|
|
|
|
|
2012-08-01 14:03:33 -07:00
|
|
|
/**
|
|
|
|
* Base layout smart data extended with fileselector instance data.
|
|
|
|
*/
|
|
|
|
typedef struct _Elm_Fileselector_Smart_Data Elm_Fileselector_Smart_Data;
|
|
|
|
struct _Elm_Fileselector_Smart_Data
|
|
|
|
{
|
|
|
|
EINA_REFCOUNT;
|
|
|
|
|
2013-06-18 17:00:41 -07:00
|
|
|
Evas_Object *obj;
|
|
|
|
Evas_Object *path_entry;
|
|
|
|
Evas_Object *files_list;
|
|
|
|
Evas_Object *files_grid;
|
|
|
|
Evas_Object *up_button;
|
|
|
|
Evas_Object *home_button;
|
|
|
|
Evas_Object *spinner;
|
|
|
|
Evas_Object *filter_hoversel;
|
|
|
|
Evas_Object *ok_button;
|
|
|
|
Evas_Object *cancel_button;
|
|
|
|
|
|
|
|
Eina_List *filter_list;
|
|
|
|
Elm_Fileselector_Filter *current_filter;
|
2012-08-01 14:03:33 -07:00
|
|
|
|
2013-06-18 17:00:41 -07:00
|
|
|
const char *path;
|
|
|
|
const char *selection;
|
|
|
|
Ecore_Idler *sel_idler;
|
2012-08-01 14:03:33 -07:00
|
|
|
|
2013-06-18 17:00:41 -07:00
|
|
|
const char *path_separator;
|
2012-08-01 14:03:33 -07:00
|
|
|
|
|
|
|
#ifdef HAVE_EIO
|
2013-06-18 17:00:41 -07:00
|
|
|
Eio_File *current;
|
2012-08-01 14:03:33 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
Elm_Fileselector_Mode mode;
|
|
|
|
|
|
|
|
Eina_Bool only_folder : 1;
|
|
|
|
Eina_Bool expand : 1;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct sel_data
|
|
|
|
{
|
|
|
|
Evas_Object *fs;
|
|
|
|
const char *path;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct _Listing_Request Listing_Request;
|
|
|
|
struct _Listing_Request
|
|
|
|
{
|
|
|
|
Elm_Fileselector_Smart_Data *sd;
|
|
|
|
Elm_Object_Item *parent_it;
|
|
|
|
|
|
|
|
Evas_Object *obj;
|
|
|
|
const char *path;
|
|
|
|
Eina_Bool first : 1;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
ELM_DIRECTORY = 0,
|
|
|
|
ELM_FILE_IMAGE = 1,
|
|
|
|
ELM_FILE_UNKNOW = 2,
|
|
|
|
ELM_FILE_LAST
|
|
|
|
} Elm_Fileselector_Type;
|
|
|
|
|
2013-06-18 17:00:41 -07:00
|
|
|
struct _Elm_Fileselector_Filter
|
|
|
|
{
|
|
|
|
const char *filter_name;
|
|
|
|
Elm_Fileselector_Smart_Data *sd;
|
|
|
|
|
|
|
|
char **mime_types;
|
|
|
|
};
|
|
|
|
|
2012-08-01 14:03:33 -07:00
|
|
|
/**
|
|
|
|
* @}
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define ELM_FILESELECTOR_DATA_GET(o, sd) \
|
2013-04-24 04:41:37 -07:00
|
|
|
Elm_Fileselector_Smart_Data * sd = eo_data_scope_get(o, ELM_OBJ_FILESELECTOR_CLASS)
|
2012-08-01 14:03:33 -07:00
|
|
|
|
|
|
|
#define ELM_FILESELECTOR_DATA_GET_OR_RETURN(o, ptr) \
|
|
|
|
ELM_FILESELECTOR_DATA_GET(o, ptr); \
|
|
|
|
if (!ptr) \
|
|
|
|
{ \
|
|
|
|
CRITICAL("No widget data for object %p (%s)", \
|
|
|
|
o, evas_object_type_get(o)); \
|
|
|
|
return; \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define ELM_FILESELECTOR_DATA_GET_OR_RETURN_VAL(o, ptr, val) \
|
|
|
|
ELM_FILESELECTOR_DATA_GET(o, ptr); \
|
|
|
|
if (!ptr) \
|
|
|
|
{ \
|
|
|
|
CRITICAL("No widget data for object %p (%s)", \
|
|
|
|
o, evas_object_type_get(o)); \
|
|
|
|
return val; \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define ELM_FILESELECTOR_CHECK(obj) \
|
2012-11-25 22:32:53 -08:00
|
|
|
if (!eo_isa((obj), ELM_OBJ_FILESELECTOR_CLASS)) \
|
2012-08-01 14:03:33 -07:00
|
|
|
return
|
|
|
|
|
|
|
|
#endif
|