#ifndef EFM_H
# define EFM_H 1

# include <Elementary.h>

#include "efm_config.h"

typedef enum {
   EFM_VIEW_MODE_ICONS,
   EFM_VIEW_MODE_ICONS_CUSTOM,
   EFM_VIEW_MODE_LIST,
   EFM_VIEW_MODE_LIST_DETAILED
} Efm_View_Mode;

typedef enum {
   EFM_SORT_MODE_FLAGS          = (0xffff << 16), // upper 16 bits for flags
   // flags - apper 16 bits
   EFM_SORT_MODE_DIRS_FIRST     = ( 1 << 16), // show dirs first then files
   EFM_SORT_MODE_NOCASE         = ( 1 << 17), // don't account for case when sorting by label or path
   EFM_SORT_MODE_LABEL_NOT_PATH = ( 1 << 18), // use label either in path filename or inside a desktop file
   // mask for field
   EFM_SORT_MODE_MASK           = 0xffff, // lower 16 bits is the sort field
   // fields
   EFM_SORT_MODE_NAME           = ( 0 <<  0),
   EFM_SORT_MODE_SIZE           = ( 1 <<  0),
   EFM_SORT_MODE_DATE           = ( 2 <<  0),
   EFM_SORT_MODE_MIME           = ( 3 <<  0),
   EFM_SORT_MODE_USER           = ( 4 <<  0),
   EFM_SORT_MODE_GROUP          = ( 5 <<  0),
   EFM_SORT_MODE_PERMISSIONS    = ( 6 <<  0),
} Efm_Sort_Mode;

typedef enum {
   EFM_FOCUS_DIR_UP,
   EFM_FOCUS_DIR_DOWN,
   EFM_FOCUS_DIR_LEFT,
   EFM_FOCUS_DIR_RIGHT,
   EFM_FOCUS_DIR_PGDN,
   EFM_FOCUS_DIR_PGUP
} Efm_Focus_Dir;

Evas_Object  *efm_add(Evas_Object *parent);
void          efm_scroller_set(Evas_Object *obj, Evas_Object *scroller);
Evas_Object  *efm_scroller_get(Evas_Object *obj);
Evas_Object  *efm_detail_header_get(Evas_Object *obj);
void          efm_path_set(Evas_Object *obj, const char *path);
const char   *efm_path_get(Evas_Object *obj);
void          efm_path_view_mode_set(Evas_Object *obj, Efm_View_Mode mode);
Efm_View_Mode efm_path_view_mode_get(Evas_Object *obj);
void          efm_path_sort_mode_set(Evas_Object *obj, Efm_Sort_Mode mode);
Efm_Sort_Mode efm_path_sort_mode_get(Evas_Object *obj);
Evas_Coord    efm_column_min_get(Evas_Object *obj, int col);

// XXX: set/get column sizes
// XXX: callback when column sizes change
// XXX: set/get icon size
// XXX: hidden files show set/get

#define DBG(...)            EINA_LOG_DOM_DBG(_log_dom, __VA_ARGS__)
#define INF(...)            EINA_LOG_DOM_INFO(_log_dom, __VA_ARGS__)
#define WRN(...)            EINA_LOG_DOM_WARN(_log_dom, __VA_ARGS__)
#define ERR(...)            EINA_LOG_DOM_ERR(_log_dom, __VA_ARGS__)
#define CRI(...)            EINA_LOG_DOM_CRIT(_log_dom, __VA_ARGS__)
extern int _log_dom;

#endif
