diff finch/libgnt/gntfilesel.h @ 15988:e05e5b148723

Allow using different methods for reading directory entries.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Wed, 04 Apr 2007 08:33:50 +0000
parents 0f1ab43db297
children 8410511f4dbb
line wrap: on
line diff
--- a/finch/libgnt/gntfilesel.h	Wed Apr 04 03:50:15 2007 +0000
+++ b/finch/libgnt/gntfilesel.h	Wed Apr 04 08:33:50 2007 +0000
@@ -20,6 +20,7 @@
 typedef struct _GntFileSel			GntFileSel;
 typedef struct _GntFileSelPriv		GntFileSelPriv;
 typedef struct _GntFileSelClass		GntFileSelClass;
+typedef struct _GntFile             GntFile;
 
 struct _GntFileSel
 {
@@ -39,6 +40,8 @@
 	gboolean dirsonly;   /* Show only directories */
     gboolean multiselect;
     GList *tags;         /* List of tagged files when multiselect is set */
+
+	gboolean (*read_fn)(const char *path, GList **files, GError **error);
 };
 
 struct _GntFileSelClass
@@ -52,6 +55,20 @@
 	void (*gnt_reserved4)(void);
 };
 
+typedef enum _GntFileType
+{
+	GNT_FILE_REGULAR,
+	GNT_FILE_DIR
+} GntFileType;
+
+struct _GntFile
+{
+	char *fullpath;
+	char *basename;
+	GntFileType type;
+	unsigned long size;
+};
+
 G_BEGIN_DECLS
 
 GType gnt_file_sel_get_gtype(void);
@@ -76,6 +93,12 @@
 
 void gnt_file_sel_set_suggested_filename(GntFileSel *sel, const char *suggest);
 
+void gnt_file_sel_set_read_fn(GntFileSel *sel, gboolean (*read_fn)(const char *path, GList **files, GError **error));
+
+GntFile* gnt_file_new(const char *name, unsigned long size);
+
+GntFile* gnt_file_new_dir(const char *name);
+
 G_END_DECLS
 
 #endif /* GNT_FILE_SEL_H */