r1996: Cope slightly better with invalid filenames in various places (reported by
[rox-filer.git] / ROX-Filer / src / gtksavebox.h
blobcf578f14328b4084c64789ba1a66b3d1395ef5a7
1 /*
2 * $Id$
4 * SaveBox widget for the ROX desktop project
5 * By Thomas Leonard, <tal197@users.sourceforge.net>.
6 */
8 #ifndef __GTK_SAVEBOX_H__
9 #define __GTK_SAVEBOX_H__
12 #include <gdk/gdk.h>
13 #include <gtk/gtkdialog.h>
14 #include <gtk/gtkselection.h>
17 #ifdef __cplusplus
18 extern "C" {
19 #endif /* __cplusplus */
21 /* This is for the 'info' value of the GtkTargetList.
22 * It's for the XdndDirectSave0 target - ignore requests for this target
23 * because they're handled internally by the widget. Don't use this
24 * value for anything else!
26 #define GTK_TARGET_XDS 0x584453
28 #define GTK_TYPE_SAVEBOX (gtk_savebox_get_type ())
30 #define GTK_SAVEBOX(obj) \
31 (GTK_CHECK_CAST ((obj), GTK_TYPE_SAVEBOX, GtkSavebox))
33 #define GTK_SAVEBOX_CLASS(klass) \
34 (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_SAVEBOX, GtkSaveboxClass))
36 #define GTK_IS_SAVEBOX(obj) \
37 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_SAVEBOX))
39 #define GTK_IS_SAVEBOX_CLASS(klass) \
40 (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_SAVEBOX))
43 typedef struct _GtkSavebox GtkSavebox;
44 typedef struct _GtkSaveboxClass GtkSaveboxClass;
45 typedef struct _GtkSaveboxButton GtkSaveboxButton;
47 enum {
48 GTK_XDS_SAVED, /* Done the save - no problem */
49 GTK_XDS_SAVE_ERROR, /* Error during save - reported */
50 GTK_XDS_NO_HANDLER, /* Used internally (sanity checking) */
53 struct _GtkSavebox
55 GtkDialog dialog;
57 GtkWidget *discard_area; /* Normally hidden */
58 GtkWidget *drag_box; /* Event box - contains pixmap, or NULL */
59 GtkWidget *icon; /* The pixmap widget */
60 GtkWidget *entry; /* Where the pathname goes */
62 GtkTargetList *targets; /* Formats that we can save in */
63 gboolean using_xds; /* Have we sent XDS reply 'S' or 'F' yet? */
64 gboolean data_sent; /* Did we send any data at all this drag? */
67 struct _GtkSaveboxClass
69 GtkDialogClass parent_class;
71 gint (*save_to_file) (GtkSavebox *savebox, guchar *pathname);
72 void (*saved_to_uri) (GtkSavebox *savebox, guchar *uri);
76 GType gtk_savebox_get_type (void);
77 GtkWidget* gtk_savebox_new (const gchar *action);
78 void gtk_savebox_set_icon (GtkSavebox *savebox,
79 GdkPixbuf *pixbuf);
80 void gtk_savebox_set_pathname (GtkSavebox *savebox,
81 const gchar *pathname);
82 void gtk_savebox_set_has_discard (GtkSavebox *savebox, gboolean setting);
85 #ifdef __cplusplus
87 #endif /* __cplusplus */
90 #endif /* __GTK_SAVEBOX_H__ */