1 /*
2  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3  * Copyright (C) 1999-2012 Michael Rasmussen and the Claws Mail team
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  *
18  */
19 
20 /*
21  * Edit address item data.
22  */
23 
24 #ifndef __EDITADDRESS_OTHER_ATTRIBUTES_LDAP_H__
25 #define __EDITADDRESS_OTHER_ATTRIBUTES_LDAP_H__
26 
27 #include <glib.h>
28 #include <glib/gi18n.h>
29 #include <gdk/gdkkeysyms.h>
30 #include <gtk/gtk.h>
31 
32 enum {
33 	ATTRIB_COL_NAME,
34 	ATTRIB_COL_VALUE,
35 	ATTRIB_COL_PTR,
36 	ATTRIB_N_COLS
37 };
38 
39 typedef struct _PersonEdit_dlg PersonEditDlg;
40 struct _PersonEdit_dlg {
41 	GtkWidget *container;
42 	GtkWidget *notebook;
43 	GtkWidget *ok_btn;
44 	GtkWidget *cancel_btn;
45 	GtkWidget *statusbar;	/* used when prefs_common.addressbook_use_editaddress_dialog is TRUE */
46 	GtkWidget *title;	/* used when prefs_common.addressbook_use_editaddress_dialog is FALSE */
47 	gint status_cid;
48 
49 	/* User data tab */
50 	GtkWidget *image;
51 	gboolean picture_set;
52 	GtkWidget *entry_name;
53 	GtkWidget *entry_first;
54 	GtkWidget *entry_last;
55 	GtkWidget *entry_nick;
56 
57 	/* EMail data tab */
58 	GtkWidget *entry_email;
59 	GtkWidget *entry_alias;
60 	GtkWidget *entry_remarks;
61 	GtkWidget *view_email;
62 	GtkWidget *email_up;
63 	GtkWidget *email_down;
64 	GtkWidget *email_del;
65 	GtkWidget *email_mod;
66 	GtkWidget *email_add;
67 
68 	/* Attribute data tab */
69 	GtkWidget *entry_atname;
70 	GtkWidget *entry_atvalue;
71 	GtkWidget *view_attrib;
72 	GtkWidget *attrib_add;
73 	GtkWidget *attrib_del;
74 	GtkWidget *attrib_mod;
75 
76 	gboolean editNew;
77 	gboolean read_only;
78 	gboolean ldap;
79 };
80 
81 #ifdef USE_LDAP
82 
83 static const char *ATTRIBUTE[] = {
84 	"telephoneNumber",
85 	/*"description (Remarks)",*/
86 	"title",
87 	"telexNumber",
88 	"facsimileTelephoneNumber",
89 	"street",
90 	"postOfficeBox",
91 	"postalCode",
92 	"postalAddress",
93 	"st", /* state or province */
94 	"l", /* locality Name */
95 	"departmentNumber",
96 	"homePhone",
97 	"homePostalAddress",
98 	"initials",
99 	"labeledURI",
100 	"mobile",
101 	"pager",
102 	"roomNumber",
103 	"jpegPhoto",
104 	NULL
105 };
106 
107 static const int ATTRIBUTE_SIZE = (sizeof(ATTRIBUTE) / sizeof(*ATTRIBUTE)) - 1;
108 
109 /* Function proto types */
110 void addressbook_edit_person_page_attrib_ldap(PersonEditDlg *personEditDlg, gint pageNum, gchar *pageLbl);
111 int get_attribute_index(const gchar *string_literal);
112 
113 #endif	/* USE_LDAP */
114 
115 #endif /* __EDITADDRESS_OTHER_ATTRIBUTES_LDAP_H__ */
116