2 * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3 * Copyright (C) 1999,2000 Hiroyuki Yamamoto
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 2 of the License, or
8 * (at your option) any later version.
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.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 #ifndef __ADDRESSBOOK_H__
21 #define __ADDRESSBOOK_H__
24 #include <gtk/gtkwidget.h>
25 #include <gtk/gtkitemfactory.h>
26 #include <gtk/gtkctree.h>
28 #include "addressitem.h"
39 #define ADDRESS_GROUP(obj) ((AddressGroup *)obj)
40 #define ADDRESS_FOLDER(obj) ((AddressFolder *)obj)
41 #define ADDRESS_VCARD(obj) ((AddressVCard *)obj)
42 #define ADDRESS_JPILOT(obj) ((AddressJPilot *)obj)
43 #define ADDRESS_CATEGORY(obj) ((AddressCategory *)obj)
44 #define ADDRESS_LDAP(obj) ((AddressLDAP *)obj)
49 typedef struct _AddressBook AddressBook;
66 GtkWidget *tree_popup;
67 GtkWidget *list_popup;
68 GtkItemFactory *tree_factory;
69 GtkItemFactory *list_factory;
70 GtkItemFactory *menu_factory;
73 GtkCTreeNode *personal;
77 GtkCTreeNode *selected;
82 Compose *target_compose;
86 typedef struct _AddressGroup AddressGroup;
93 /* Group contains only Items */
97 typedef struct _AddressFolder AddressFolder;
104 /* Folder contains Groups and Items */
108 typedef struct _AddressVCard AddressVCard;
116 /* Folder contains only VCards */
121 typedef struct _AddressJPilot AddressJPilot;
122 struct _AddressJPilot
127 JPilotFile *pilotFile;
129 /* Folder contains only JPilotFiles */
130 /* Folder contains only Items for each category */
134 typedef struct _AddressCategory AddressCategory;
135 struct _AddressCategory
140 JPilotFile *pilotFile;
141 AddressItem *category;
143 /* Category contains only Items */
149 typedef struct _AddressLDAP AddressLDAP;
155 SyldapServer *ldapServer;
157 /* Folder contains only SyldapServers */
162 struct _AddressFileSelection {
163 GtkWidget *fileSelector;
166 typedef struct _AddressFileSelection AddressFileSelection;
168 void addressbook_open (Compose *target);
169 void addressbook_set_target_compose (Compose *target);
170 Compose *addressbook_get_target_compose (void);
171 void addressbook_export_to_file (void);
173 /* provisional API for accessing the address book */
175 void addressbook_access (void);
176 void addressbook_unaccess (void);
178 const gchar *addressbook_get_personal_folder_name (void);
179 const gchar *addressbook_get_common_folder_name (void);
181 AddressObject *addressbook_find_group_by_name (const gchar *name);
182 AddressObject *addressbook_find_contact (const gchar *name, const gchar *address);
183 GList *addressbook_get_group_list (void);
184 gint addressbook_add_contact (const gchar *group, const gchar *name,
185 const gchar *address, const gchar *remarks);
187 gboolean addressbook_add_contact_by_menu(GtkWidget *submenu,
189 const gchar *address,
190 const gchar *remarks);
192 #endif /* __ADDRESSBOOK_H__ */