finch/libgnt/gntfilesel.h

Wed, 02 May 2007 15:38:14 +0000

author
Sadrul Habib Chowdhury <sadrul@pidgin.im>
date
Wed, 02 May 2007 15:38:14 +0000
changeset 16837
d3b8ba967fdc
parent 16049
0118c8161389
child 17586
5beb8d987e84
permissions
-rw-r--r--

Fix context menu unusualness in the buddylist.

15902
b2dad43782a1 File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
1 #ifndef GNT_FILE_SEL_H
b2dad43782a1 File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
2 #define GNT_FILE_SEL_H
b2dad43782a1 File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
3
b2dad43782a1 File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
4 #include "gntwindow.h"
b2dad43782a1 File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
5 #include "gnt.h"
b2dad43782a1 File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
6 #include "gntcolors.h"
b2dad43782a1 File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
7 #include "gntkeys.h"
b2dad43782a1 File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
8
b2dad43782a1 File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
9 #define GNT_TYPE_FILE_SEL (gnt_file_sel_get_gtype())
b2dad43782a1 File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
10 #define GNT_FILE_SEL(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GNT_TYPE_FILE_SEL, GntFileSel))
b2dad43782a1 File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
11 #define GNT_FILE_SEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GNT_TYPE_FILE_SEL, GntFileSelClass))
b2dad43782a1 File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
12 #define GNT_IS_FILE_SEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GNT_TYPE_FILE_SEL))
b2dad43782a1 File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
13 #define GNT_IS_FILE_SEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GNT_TYPE_FILE_SEL))
b2dad43782a1 File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
14 #define GNT_FILE_SEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GNT_TYPE_FILE_SEL, GntFileSelClass))
b2dad43782a1 File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
15
b2dad43782a1 File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
16 #define GNT_FILE_SEL_FLAGS(obj) (GNT_FILE_SEL(obj)->priv.flags)
b2dad43782a1 File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
17 #define GNT_FILE_SEL_SET_FLAGS(obj, flags) (GNT_FILE_SEL_FLAGS(obj) |= flags)
b2dad43782a1 File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
18 #define GNT_FILE_SEL_UNSET_FLAGS(obj, flags) (GNT_FILE_SEL_FLAGS(obj) &= ~(flags))
b2dad43782a1 File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
19
15986
49c0e6c8c116 Allow selecting multiple files from the file-select dialog.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 15985
diff changeset
20 typedef struct _GntFileSel GntFileSel;
49c0e6c8c116 Allow selecting multiple files from the file-select dialog.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 15985
diff changeset
21 typedef struct _GntFileSelPriv GntFileSelPriv;
49c0e6c8c116 Allow selecting multiple files from the file-select dialog.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 15985
diff changeset
22 typedef struct _GntFileSelClass GntFileSelClass;
16049
0118c8161389 Allow using different methods for reading directory entries.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16000
diff changeset
23 typedef struct _GntFile GntFile;
15902
b2dad43782a1 File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
24
15986
49c0e6c8c116 Allow selecting multiple files from the file-select dialog.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 15985
diff changeset
25 struct _GntFileSel
15902
b2dad43782a1 File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
26 {
b2dad43782a1 File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
27 GntWindow parent;
b2dad43782a1 File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
28
b2dad43782a1 File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
29 GntWidget *dirs; /* list of files */
b2dad43782a1 File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
30 GntWidget *files; /* list of directories */
b2dad43782a1 File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
31 GntWidget *location; /* location entry */
b2dad43782a1 File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
32
b2dad43782a1 File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
33 GntWidget *select; /* select button */
b2dad43782a1 File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
34 GntWidget *cancel; /* cancel button */
b2dad43782a1 File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
35
b2dad43782a1 File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
36 char *current; /* Full path of the current location */
16000
0bb1f85ebd2c fix file saving
Richard Nelson <wabz@pidgin.im>
parents: 15989
diff changeset
37 char *suggest; /* Suggested filename */
15902
b2dad43782a1 File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
38 /* XXX: someone should make these useful */
b2dad43782a1 File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
39 gboolean must_exist; /* Make sure the selected file (the name entered in 'location') exists */
b2dad43782a1 File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
40 gboolean dirsonly; /* Show only directories */
15986
49c0e6c8c116 Allow selecting multiple files from the file-select dialog.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 15985
diff changeset
41 gboolean multiselect;
49c0e6c8c116 Allow selecting multiple files from the file-select dialog.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 15985
diff changeset
42 GList *tags; /* List of tagged files when multiselect is set */
16049
0118c8161389 Allow using different methods for reading directory entries.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16000
diff changeset
43
0118c8161389 Allow using different methods for reading directory entries.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16000
diff changeset
44 gboolean (*read_fn)(const char *path, GList **files, GError **error);
15902
b2dad43782a1 File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
45 };
b2dad43782a1 File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
46
15986
49c0e6c8c116 Allow selecting multiple files from the file-select dialog.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 15985
diff changeset
47 struct _GntFileSelClass
15902
b2dad43782a1 File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
48 {
b2dad43782a1 File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
49 GntWindowClass parent;
b2dad43782a1 File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
50
b2dad43782a1 File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
51 void (*file_selected)(GntFileSel *sel, const char *path, const char *filename);
b2dad43782a1 File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
52 void (*gnt_reserved1)(void);
b2dad43782a1 File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
53 void (*gnt_reserved2)(void);
b2dad43782a1 File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
54 void (*gnt_reserved3)(void);
b2dad43782a1 File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
55 void (*gnt_reserved4)(void);
b2dad43782a1 File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
56 };
b2dad43782a1 File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
57
16049
0118c8161389 Allow using different methods for reading directory entries.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16000
diff changeset
58 typedef enum _GntFileType
0118c8161389 Allow using different methods for reading directory entries.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16000
diff changeset
59 {
0118c8161389 Allow using different methods for reading directory entries.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16000
diff changeset
60 GNT_FILE_REGULAR,
0118c8161389 Allow using different methods for reading directory entries.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16000
diff changeset
61 GNT_FILE_DIR
0118c8161389 Allow using different methods for reading directory entries.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16000
diff changeset
62 } GntFileType;
0118c8161389 Allow using different methods for reading directory entries.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16000
diff changeset
63
0118c8161389 Allow using different methods for reading directory entries.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16000
diff changeset
64 struct _GntFile
0118c8161389 Allow using different methods for reading directory entries.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16000
diff changeset
65 {
0118c8161389 Allow using different methods for reading directory entries.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16000
diff changeset
66 char *fullpath;
0118c8161389 Allow using different methods for reading directory entries.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16000
diff changeset
67 char *basename;
0118c8161389 Allow using different methods for reading directory entries.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16000
diff changeset
68 GntFileType type;
0118c8161389 Allow using different methods for reading directory entries.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16000
diff changeset
69 unsigned long size;
0118c8161389 Allow using different methods for reading directory entries.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16000
diff changeset
70 };
0118c8161389 Allow using different methods for reading directory entries.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16000
diff changeset
71
15902
b2dad43782a1 File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
72 G_BEGIN_DECLS
b2dad43782a1 File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
73
b2dad43782a1 File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
74 GType gnt_file_sel_get_gtype(void);
b2dad43782a1 File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
75
15972
894a15d885ec This was giving me a warning saying the function wasn't previously declared
Mark Doliner <markdoliner@pidgin.im>
parents: 15911
diff changeset
76 GntWidget *gnt_file_sel_new(void);
15902
b2dad43782a1 File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
77
b2dad43782a1 File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
78 gboolean gnt_file_sel_set_current_location(GntFileSel *sel, const char *path);
b2dad43782a1 File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
79
15911
942565fe33f0 Directory only selection.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 15902
diff changeset
80 void gnt_file_sel_set_dirs_only(GntFileSel *sel, gboolean dirs);
942565fe33f0 Directory only selection.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 15902
diff changeset
81
942565fe33f0 Directory only selection.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 15902
diff changeset
82 gboolean gnt_file_sel_get_dirs_only(GntFileSel *sel);
942565fe33f0 Directory only selection.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 15902
diff changeset
83
15912
7401338df45b Use the file selector for request-file.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 15911
diff changeset
84 void gnt_file_sel_set_must_exist(GntFileSel *sel, gboolean must);
7401338df45b Use the file selector for request-file.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 15911
diff changeset
85
7401338df45b Use the file selector for request-file.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 15911
diff changeset
86 gboolean gnt_file_sel_get_must_exist(GntFileSel *sel);
7401338df45b Use the file selector for request-file.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 15911
diff changeset
87
7401338df45b Use the file selector for request-file.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 15911
diff changeset
88 char *gnt_file_sel_get_selected_file(GntFileSel *sel); /* The returned value should be free'd */
7401338df45b Use the file selector for request-file.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 15911
diff changeset
89
15986
49c0e6c8c116 Allow selecting multiple files from the file-select dialog.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 15985
diff changeset
90 GList *gnt_file_sel_get_selected_multi_files(GntFileSel *sel);
49c0e6c8c116 Allow selecting multiple files from the file-select dialog.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 15985
diff changeset
91
49c0e6c8c116 Allow selecting multiple files from the file-select dialog.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 15985
diff changeset
92 void gnt_file_sel_set_multi_select(GntFileSel *sel, gboolean set);
49c0e6c8c116 Allow selecting multiple files from the file-select dialog.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 15985
diff changeset
93
16000
0bb1f85ebd2c fix file saving
Richard Nelson <wabz@pidgin.im>
parents: 15989
diff changeset
94 void gnt_file_sel_set_suggested_filename(GntFileSel *sel, const char *suggest);
0bb1f85ebd2c fix file saving
Richard Nelson <wabz@pidgin.im>
parents: 15989
diff changeset
95
16049
0118c8161389 Allow using different methods for reading directory entries.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16000
diff changeset
96 void gnt_file_sel_set_read_fn(GntFileSel *sel, gboolean (*read_fn)(const char *path, GList **files, GError **error));
0118c8161389 Allow using different methods for reading directory entries.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16000
diff changeset
97
0118c8161389 Allow using different methods for reading directory entries.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16000
diff changeset
98 GntFile* gnt_file_new(const char *name, unsigned long size);
0118c8161389 Allow using different methods for reading directory entries.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16000
diff changeset
99
0118c8161389 Allow using different methods for reading directory entries.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16000
diff changeset
100 GntFile* gnt_file_new_dir(const char *name);
0118c8161389 Allow using different methods for reading directory entries.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16000
diff changeset
101
15902
b2dad43782a1 File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
102 G_END_DECLS
b2dad43782a1 File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
103
b2dad43782a1 File selector dialog. Still in an experimental state. When properly complete, this can be used for file/folder-request etc.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
104 #endif /* GNT_FILE_SEL_H */
15987
71d668c3d56d merge of 'e4c15762aafac1e097402a9bca2e7acfad7ff589'
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 15913 15986
diff changeset
105

mercurial