1998-11-25 02:01:09 +08:00
|
|
|
#ifndef GTK_LDAPTREEITEM_H
|
|
|
|
#define GTK_LDAPTREEITEM_H
|
|
|
|
#include "gtk.h"
|
1998-12-02 23:18:47 +08:00
|
|
|
#include "utils.h"
|
1998-11-25 02:01:09 +08:00
|
|
|
#include <My_Window.h>
|
1998-12-02 23:18:47 +08:00
|
|
|
#include <Gtk_LdapTree.h>
|
1998-11-25 02:01:09 +08:00
|
|
|
#include <lber.h>
|
|
|
|
#include <ldap.h>
|
1998-11-29 04:25:09 +08:00
|
|
|
#include "icons/root_node.h"
|
|
|
|
#include "icons/branch_node.h"
|
|
|
|
#include "icons/leaf_node.h"
|
1998-12-04 09:11:12 +08:00
|
|
|
#include "icons/alias_node.h"
|
1998-12-10 21:05:05 +08:00
|
|
|
#include "icons/rfc822mailgroup_node.h"
|
1998-11-29 04:25:09 +08:00
|
|
|
#include "icons/general_node.h"
|
2000-01-03 20:23:15 +08:00
|
|
|
#include "icons/monitor.h"
|
1998-11-27 08:56:29 +08:00
|
|
|
|
|
|
|
#define ROOT_NODE 1
|
|
|
|
#define BRANCH_NODE 2
|
|
|
|
#define LEAF_NODE 3
|
1998-11-25 02:01:09 +08:00
|
|
|
|
|
|
|
class My_Window;
|
1998-12-02 23:18:47 +08:00
|
|
|
class Gtk_LdapTree;
|
1998-11-25 02:01:09 +08:00
|
|
|
|
|
|
|
class Gtk_LdapTreeItem : public Gtk_TreeItem {
|
|
|
|
public:
|
|
|
|
char *dn;
|
|
|
|
char *rdn;
|
1998-11-29 04:25:09 +08:00
|
|
|
char *objectClass;
|
2000-01-03 20:23:15 +08:00
|
|
|
char *aliasedObjectName;
|
1998-11-25 02:01:09 +08:00
|
|
|
LDAP *ld;
|
|
|
|
LDAPMessage *result_identifier;
|
|
|
|
My_Window *par;
|
|
|
|
Gtk_Notebook *notebook;
|
1998-11-27 08:56:29 +08:00
|
|
|
Gtk_HBox *xpm_label;
|
2000-01-12 04:53:38 +08:00
|
|
|
Gtk_Menu *menu;
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
TARGET_STRING,
|
|
|
|
TARGET_ROOTWIN,
|
|
|
|
TARGET_URL
|
|
|
|
};
|
|
|
|
bool have_drag;
|
|
|
|
|
|
|
|
//Functions
|
1998-11-25 02:01:09 +08:00
|
|
|
Gtk_LdapTreeItem();
|
1998-12-02 23:18:47 +08:00
|
|
|
Gtk_LdapTreeItem(char *c, My_Window *w, LDAP *ld);
|
1998-11-25 02:01:09 +08:00
|
|
|
Gtk_LdapTreeItem(GtkTreeItem *t);
|
1998-11-29 04:25:09 +08:00
|
|
|
~Gtk_LdapTreeItem();
|
2000-01-12 04:53:38 +08:00
|
|
|
void setDnd();
|
2000-01-03 20:23:15 +08:00
|
|
|
gchar* getAttribute(char *c);
|
1998-12-02 23:18:47 +08:00
|
|
|
Gtk_LdapTree* getSubtree(LDAP *ld, int i);
|
1998-11-27 08:56:29 +08:00
|
|
|
void setType(int t);
|
|
|
|
int getDetails();
|
2000-01-12 04:53:38 +08:00
|
|
|
void createPopupMenu();
|
1998-11-29 04:25:09 +08:00
|
|
|
int showDetails();
|
1999-02-13 07:45:35 +08:00
|
|
|
// void show_impl();
|
2000-01-12 04:53:38 +08:00
|
|
|
// void select_impl();
|
1998-11-25 02:01:09 +08:00
|
|
|
void collapse_impl();
|
|
|
|
void expand_impl();
|
2000-01-12 04:53:38 +08:00
|
|
|
void click();
|
|
|
|
// gint button_press_event_impl(GdkEventButton *p0);
|
|
|
|
void item_drag_data_received (GdkDragContext *context,
|
|
|
|
gint x, gint y, GtkSelectionData *data,
|
|
|
|
guint info, guint32 time);
|
|
|
|
gboolean target_drag_drop ( GdkDragContext *context,
|
|
|
|
gint x, gint y, guint time);
|
|
|
|
|
|
|
|
void source_drag_data_get(GdkDragContext *context,
|
|
|
|
GtkSelectionData *selection_data,
|
|
|
|
guint info, guint32 time);
|
|
|
|
void source_drag_data_delete(GdkDragContext *context);
|
|
|
|
void target_drag_leave(GdkDragContext *context, guint time);
|
1998-11-25 02:01:09 +08:00
|
|
|
};
|
2000-01-12 04:53:38 +08:00
|
|
|
|
|
|
|
static GtkTargetEntry target_table[] = {
|
|
|
|
{ "STRING", 0, Gtk_LdapTreeItem::TARGET_STRING },
|
|
|
|
{ "text/plain", 0, Gtk_LdapTreeItem::TARGET_STRING },
|
|
|
|
{ "text/uri-list", 0, Gtk_LdapTreeItem::TARGET_URL },
|
|
|
|
{ "application/x-rootwin-drop", 0, Gtk_LdapTreeItem::TARGET_ROOTWIN }
|
|
|
|
};
|
|
|
|
|
|
|
|
static guint n_targets = sizeof(target_table) / sizeof(target_table[0]);
|
1998-11-25 02:01:09 +08:00
|
|
|
#endif
|