#ifndef USE_MC_MODULE__HOTLIST_PRIVATE_H
#error "newer directly include this file!"
#endif
#ifndef MC_MODULE__HOTLIST_PRIVATE_H
#define MC_MODULE__HOTLIST_PRIVATE_H

#include <glib.h>

enum e_hotlist_type {
    HL_TYPE_GROUP,
    HL_TYPE_ENTRY,
    HL_TYPE_COMMENT,
    HL_TYPE_DOTDOT
};


typedef struct s_hotlist_state {
    /* these parameters are intended to be user configurable  */
    int		expanded;	/* expanded view of all groups at startup */

    /* these reflect run time state */
    int		loaded;		/* hotlist is loaded */
    int		readonly;	/* hotlist readonly */
    int		file_error;	/* parse error while reading file */
    int		running;	/* we are running dlg (and have to
    				   update listbox */
    int		moving;		/* we are in moving hotlist currently */
    int		modified;	/* hotlist was modified */
    int		type;		/* LIST_HOTLIST || LIST_VFSLIST */
    time_t	mtime;		/* Last modified time */
} ts_hotlist_state;


typedef struct s__hotlist_element {
    enum  e_hotlist_type type;
    char *directory;
    char *label;
    int hotkey;
    struct s_hotlist_element *parent;
    GList *list;
} ts_hotlist_element;

typedef struct s_hotlist {
    ts_hotlist_element	*root;
    ts_hotlist_element	*current;
    ts_hotlist_state	state;
} ts_hotlist;

extern ts_hotlist *Gf_default_hotlist; // for Controller. Must be FIXED!

/* ************************************************************************** */
/* declarations of private functions */

// MODEL
void hotlist_m_loadall(ts_hotlist **, int);
void hotlist_m_free(ts_hotlist **_hotlist);
int hotlist_m_init(ts_hotlist **_hotlist);
int hotlist_m_load_from_file(ts_hotlist *_hotlist, char *_filename);

char *hotlist_m_get_file_name(char *);
int hotlist_m_is_needed_load(ts_hotlist *, char *);

ts_hotlist_element *hotlist_m_element_create(ts_hotlist_element *);
ts_hotlist_element *hotlist_m_element_get_child_by_index(ts_hotlist_element *, int);
void hotlist_m_element_set_label(ts_hotlist_element *, char *);
void hotlist_m_element_set_directory(ts_hotlist_element *, char *);
void hotlist_m_element_set_hotkey(ts_hotlist_element *, int);
void hotlist_m_element_set_type(ts_hotlist_element *, enum  e_hotlist_type);
char *hotlist_m_get_param_from_string(char *, const char *);

// VIEW
void hotlist_v_main_window_show(ts_hotlist *_hotlist);


#endif
