]> git.sur5r.net Git - openldap/blob - contrib/gtk-tool/Gtk_LdapTreeItem.h
some minor changes - d'n'd support forthcoming
[openldap] / contrib / gtk-tool / Gtk_LdapTreeItem.h
1 #ifndef GTK_LDAPTREEITEM_H
2 #define GTK_LDAPTREEITEM_H
3 #include "gtk.h"
4 #include "utils.h"
5 #include <My_Window.h>
6 #include <Gtk_LdapTree.h>
7 #include <lber.h>
8 #include <ldap.h>
9 #include "icons/root_node.h"
10 #include "icons/branch_node.h"
11 #include "icons/leaf_node.h"
12 #include "icons/alias_node.h"
13 #include "icons/rfc822mailgroup_node.h"
14 #include "icons/general_node.h"
15 #include "icons/monitor.h"
16
17 #define ROOT_NODE 1
18 #define BRANCH_NODE 2
19 #define LEAF_NODE 3
20
21 class My_Window;
22 class Gtk_LdapTree;
23
24 class Gtk_LdapTreeItem : public Gtk_TreeItem {
25 public:
26         char *dn;
27         char *rdn;
28         char *objectClass;
29         char *aliasedObjectName;
30         LDAP *ld;
31         LDAPMessage *result_identifier;
32         My_Window *par;
33         Gtk_Notebook *notebook;
34         Gtk_HBox *xpm_label;
35         Gtk_Menu *menu;
36         enum
37         {
38                 TARGET_STRING,
39                 TARGET_ROOTWIN,
40                 TARGET_URL
41         };
42         bool have_drag;
43
44         //Functions
45         Gtk_LdapTreeItem();
46         Gtk_LdapTreeItem(char *c, My_Window *w, LDAP *ld);
47         Gtk_LdapTreeItem(GtkTreeItem *t);
48         ~Gtk_LdapTreeItem();
49         void setDnd();
50         gchar* getAttribute(char *c);
51         Gtk_LdapTree* getSubtree(LDAP *ld, int i);
52         void setType(int t);
53         int getDetails();
54         void createPopupMenu();
55         int showDetails();
56 //      void show_impl();
57 //      void select_impl();
58         void collapse_impl();
59         void expand_impl();
60         void click();
61 //      gint button_press_event_impl(GdkEventButton *p0);
62         void item_drag_data_received (GdkDragContext *context,
63                                 gint x, gint y, GtkSelectionData *data,
64                                 guint info, guint32 time);
65         gboolean target_drag_drop ( GdkDragContext *context,
66                                 gint x, gint y, guint time);
67
68         void source_drag_data_get(GdkDragContext *context,
69                                GtkSelectionData *selection_data,
70                                guint info, guint32 time);
71         void source_drag_data_delete(GdkDragContext *context);
72         void target_drag_leave(GdkDragContext *context, guint time);
73 };
74
75 static GtkTargetEntry target_table[] = {
76         { "STRING",     0, Gtk_LdapTreeItem::TARGET_STRING },
77         { "text/plain", 0, Gtk_LdapTreeItem::TARGET_STRING },
78         { "text/uri-list", 0, Gtk_LdapTreeItem::TARGET_URL },
79         { "application/x-rootwin-drop", 0, Gtk_LdapTreeItem::TARGET_ROOTWIN }
80 };
81
82 static guint n_targets = sizeof(target_table) / sizeof(target_table[0]);
83 #endif