1 /* Mail Summary tree widget for Claws Mail */
3 #ifndef __GTK_SCTREE_H__
4 #define __GTK_SCTREE_H__
7 #include "gtk/gtkcmctree.h"
9 /* This code is based on "gtkflist.{h,c}" from mc-4.5.42 .*/
11 #define TYPE_GTK_SCTREE (gtk_sctree_get_type ())
12 #define GTK_SCTREE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_GTK_SCTREE, GtkSCTree))
13 #define GTK_SCTREE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_GTK_SCTREE, GtkSCTreeClass))
14 #define GTK_IS_SCTREE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_GTK_SCTREE))
15 #define GTK_IS_SCTREE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_GTK_SCTREE))
18 typedef struct _GtkSCTree GtkSCTree
;
19 typedef struct _GtkSCTreeClass GtkSCTreeClass
;
24 /* The anchor row for range selections */
25 GtkCMCTreeNode
*anchor_row
;
27 /* Mouse button and position saved on button press */
28 gint dnd_press_button
;
29 gint dnd_press_x
, dnd_press_y
;
31 /* Delayed selection information */
32 gint dnd_select_pending
;
33 guint dnd_select_pending_state
;
34 gint dnd_select_pending_row
;
38 /* (dis)allow fancy color stripes */
39 gboolean show_stripes
;
40 gboolean always_expand_recursively
;
41 gboolean force_additive_sel
;
45 struct _GtkSCTreeClass
{
46 GtkCMCTreeClass parent_class
;
48 /* Signal: invoke the popup menu for rows */
49 void (* row_popup_menu
) (GtkSCTree
*sctree
, GdkEventButton
*event
);
51 /* Signal: invoke the popup menu for empty areas */
52 void (* empty_popup_menu
) (GtkSCTree
*sctree
, GdkEventButton
*event
);
54 /* Signal: open the file in the selected row */
55 void (* open_row
) (GtkSCTree
*sctree
);
57 /* Signal: initiate a drag and drop operation */
58 void (* start_drag
) (GtkSCTree
*sctree
, gint button
, GdkEvent
*event
);
62 GType
gtk_sctree_get_type (void);
64 GtkWidget
*gtk_sctree_new_with_titles (gint columns
,
67 void gtk_sctree_select (GtkSCTree
*sctree
,
68 GtkCMCTreeNode
*node
);
69 void gtk_sctree_select_with_state (GtkSCTree
*sctree
,
72 void gtk_sctree_unselect_all (GtkSCTree
*sctree
);
74 void gtk_sctree_set_anchor_row (GtkSCTree
*sctree
,
75 GtkCMCTreeNode
*node
);
77 void gtk_sctree_remove_node (GtkSCTree
*sctree
,
78 GtkCMCTreeNode
*node
);
80 void gtk_sctree_set_stripes(GtkSCTree
*sctree
, gboolean show_stripes
);
81 void gtk_sctree_set_recursive_expand(GtkSCTree
*sctree
, gboolean rec_exp
);
83 /***********************************************************
84 * Tree sorting functions *
85 ***********************************************************/
87 void gtk_sctree_sort_node (GtkCMCTree
*ctree
, GtkCMCTreeNode
*node
);
89 void gtk_sctree_sort_recursive (GtkCMCTree
*ctree
, GtkCMCTreeNode
*node
);
91 GtkCMCTreeNode
* gtk_sctree_insert_node (GtkCMCTree
*ctree
,
92 GtkCMCTreeNode
*parent
,
93 GtkCMCTreeNode
*sibling
,
96 GdkPixbuf
*pixbuf_closed
,
97 GdkPixbuf
*pixbuf_opened
,
100 void gtk_sctree_set_node_info (GtkCMCTree
*ctree
,
101 GtkCMCTreeNode
*node
,
104 GdkPixbuf
*pixbuf_closed
,
105 GdkPixbuf
*pixbuf_opened
,
109 gtk_sctree_insert_gnode (GtkCMCTree
*ctree
,
110 GtkCMCTreeNode
*parent
,
111 GtkCMCTreeNode
*sibling
,
113 GtkCMCTreeGNodeFunc func
,
116 void gtk_sctree_set_column_tooltip (GtkSCTree
*sctree
,
119 void gtk_sctree_set_use_markup (GtkSCTree
*sctree
,
123 /* This assumes that x and y coordinates are inside the clist_window.
124 * Returns true if the coordinates are inside a tree expander on
125 * one of the rows. */
127 gtk_sctree_is_hot_spot (GtkSCTree
*ctree
,
130 #endif /* __GTK_SCTREE_H__ */