/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
/*
 * Chroma widget set
 * (C) 2005 M. Derezynski <internalerror@gmail.com> 
 *
 */

#ifndef CHROMA_LIST_H
#define CHROMA_LIST_H

/*
 * Potentially, include other headers on which this header depends.
 */

#include <gtk/gtk.h>
#include <gtk/gtkwidget.h>
#include <libchroma/chroma-vscrollbar.h>
#include <libchroma/chroma-list-column.h>

#define CHROMA_TYPE_LIST		  (chroma_list_get_type ())
#define CHROMA_LIST(obj)		  (G_TYPE_CHECK_INSTANCE_CAST ((obj), CHROMA_TYPE_LIST, ChromaList))
#define CHROMA_LIST_CLASS(klass)	  (G_TYPE_CHECK_CLASS_CAST ((klass), CHROMA_TYPE_LIST, ChromaListClass))
#define CHROMA_IS_LIST(obj)               (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CHROMA_TYPE_LIST))
#define CHROMA_IS_LIST_CLASS(klass)	  (G_TYPE_CHECK_CLASS_TYPE ((klass), CHROMA_TYPE_LIST))
#define CHROMA_LIST_GET_CLASS(obj)	  (G_TYPE_INSTANCE_GET_CLASS ((obj), CHROMA_TYPE_LIST, ChromaListClass))

typedef struct _ChromaList ChromaList;
typedef struct _ChromaListClass ChromaListClass;
typedef struct _ChromaListPrivate ChromaListPrivate;

struct _ChromaList {
	GtkWidget widget;

        ChromaListPrivate *private;
};

struct _ChromaListClass {

	GtkWidgetClass parent_class;

	void (*changed)           (ChromaList *list);
	void (*row_activated)     (ChromaList *list, gint _idx);
	void (*cursor_position)   (ChromaList *list, gint _idx);
};

typedef enum {
	CHROMA_LIST_ALIGN_LEFT,
	CHROMA_LIST_ALIGN_CENTER
} ChromaListAlignMode;

typedef enum {
	CHROMA_LIST_DROP_ROWS,
	CHROMA_LIST_DROP_WHOLE,
} ChromaListDropMode;

/* used by CHROMA_TYPE_LIST */
GType
chroma_list_get_type (void);

GtkWidget*
chroma_list_new (void);

gint
chroma_list_get_drop_position (ChromaList *self);

gint
chroma_list_get_n_item_display (ChromaList *self);

gint
chroma_list_get_n_items (ChromaList *self);
 
void
chroma_list_set_model (ChromaList *self, GtkTreeModel *model); 

void
chroma_list_set_adjustment (ChromaList *self, ChromaVScrollbar *adjustment);

const GtkTreeModel* 
chroma_list_get_model (ChromaList *self);

const ChromaListColumn*
chroma_list_get_column (ChromaList *self, gint _idx);

void
chroma_list_set_column_xalign (ChromaList *self, gint _idx, gdouble xalign);

void
chroma_list_set_column_yalign (ChromaList *self, gint _idx, gdouble yalign);

void
chroma_list_set_column_cell_data_func (ChromaList *self, gint column, ChromaListColumnCellDataFunc cell_data_func); 

void
chroma_list_set_column_width (ChromaList *self, gint column, gint width);
	
gint
chroma_list_get_last_selected (ChromaList *self);

void
chroma_list_set_last_selected (ChromaList *self, gint _idx);
	
GList*
chroma_list_get_selected_paths (ChromaList *self);

gint
chroma_list_get_row_height (ChromaList *self);
 
void
chroma_list_select_nth (ChromaList *self, gint _idx, gboolean selected);

void
chroma_list_select_all (ChromaList *self);

void
chroma_list_unselect_all (ChromaList *self);

void
chroma_list_invert_selection (ChromaList *self);

#if 0
void
chroma_list_select_name (ChromaList *self, const gchar *name);

gchar*
chroma_list_get_selected_name (ChromaList *self);
#endif

/* Parameters */
#if 0
void
chroma_list_set_font_information (ChromaList *self, BmpFontInformation *font_information);

void
chroma_list_set_adjustment (ChromaList *self, ChromaVScrollbar *adjustment);
#endif
 
void
chroma_list_set_use_numbers (ChromaList *self, gboolean use_numbers); 

void
chroma_list_set_selection_mode (ChromaList *self, GtkSelectionMode selection_mode);
	
void
chroma_list_set_drop_mode (ChromaList *self, ChromaListDropMode mode);

void
chroma_list_set_change_on_select (ChromaList *self, gboolean change_on_select);
/* END Parameters */

#endif /* CHROMA_LIST_H */



