Fix bug 3793: segfault when autocompletion asks for master passphrase
[claws.git] / src / addrindex.h
index d58d42f244fd285006f44f88452ce6a7e98a9b94..2db902a90f60c4a5c0e5bc581926f9c87c43a640 100644 (file)
@@ -1,10 +1,10 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 2001-2003 Match Grun
+ * Copyright (C) 2001-2012 Match Grun and the Claws Mail team
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * the Free Software Foundation; either version 3 of the License, or
  * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
@@ -13,8 +13,8 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * 
  */
 
 /*
@@ -91,6 +91,11 @@ struct _AddressInterface {
        void (*stopSearch)( void * );
 };
 
+#ifdef G_OS_WIN32
+/* W32 headers define INTERFACE to "struct".  */
+#undef interface
+#endif
+
 typedef struct _AddressDataSource AddressDataSource;
 struct _AddressDataSource {
        AddrItemObject obj;
@@ -103,23 +108,15 @@ void addrindex_initialize         ( void );
 void addrindex_teardown                        ( void );
 
 AddressIndex *addrindex_create_index   ( void );
-AddressIndex *addrindex_get_object     ( void );
 void addrindex_set_file_path           ( AddressIndex *addrIndex,
                                          const gchar *value );
 void addrindex_set_file_name           ( AddressIndex *addrIndex,
                                          const gchar *value );
-void addrindex_set_dirty               ( AddressIndex *addrIndex,
-                                         const gboolean value );
-gboolean addrindex_get_loaded          ( AddressIndex *addrIndex );
 
 GList *addrindex_get_interface_list    ( AddressIndex *addrIndex );
 void addrindex_free_index              ( AddressIndex *addrIndex );
 void addrindex_print_index             ( AddressIndex *addrIndex, FILE *stream );
 
-AddressInterface *addrindex_get_interface      ( AddressIndex *addrIndex,
-                                                 AddressIfType ifType );
-
-AddressDataSource *addrindex_create_datasource ( AddressIfType ifType );
 
 AddressDataSource *addrindex_index_add_datasource      ( AddressIndex *addrIndex,
                                                          AddressIfType ifType,
@@ -130,14 +127,10 @@ AddressDataSource *addrindex_index_remove_datasource      ( AddressIndex *addrIndex,
 void addrindex_free_datasource         ( AddressDataSource *ds );
 gchar *addrindex_get_cache_id          ( AddressIndex *addrIndex,
                                          AddressDataSource *ds );
-AddressDataSource *addrindex_get_datasource    ( AddressIndex *addrIndex,
-                                                 const gchar *cacheID );
 AddressCache *addrindex_get_cache      ( AddressIndex *addrIndex,
                                          const gchar *cacheID );
 
 gint addrindex_read_data               ( AddressIndex *addrIndex );
-gint addrindex_write_to                        ( AddressIndex *addrIndex,
-                                         const gchar *newFile );
 gint addrindex_save_data               ( AddressIndex *addrIndex );
 gint addrindex_create_new_books                ( AddressIndex *addrIndex );
 gint addrindex_save_all_books          ( AddressIndex *addrIndex );
@@ -148,14 +141,10 @@ gboolean addrindex_ds_get_read_flag       ( AddressDataSource *ds );
 gint addrindex_ds_get_status_code      ( AddressDataSource *ds );
 gint addrindex_ds_read_data            ( AddressDataSource *ds );
 ItemFolder *addrindex_ds_get_root_folder( AddressDataSource *ds );
-GList *addrindex_ds_get_list_folder    ( AddressDataSource *ds );
-GList *addrindex_ds_get_list_person    ( AddressDataSource *ds );
 gchar *addrindex_ds_get_name           ( AddressDataSource *ds );
 void addrindex_ds_set_access_flag      ( AddressDataSource *ds,
                                          gboolean *value );
 gboolean addrindex_ds_get_readonly     ( AddressDataSource *ds );
-GList *addrindex_ds_get_all_persons    ( AddressDataSource *ds );
-GList *addrindex_ds_get_all_groups     ( AddressDataSource *ds );
 
 /* Search support */
 gint addrindex_setup_search            ( const gchar *searchTerm,
@@ -170,13 +159,31 @@ gint addrindex_setup_static_search        ( AddressDataSource *ds,
 
 gboolean addrindex_start_search                ( const gint queryID );
 void addrindex_stop_search             ( const gint queryID );
+gint addrindex_setup_explicit_search   ( AddressDataSource *ds, 
+                                         const gchar *searchTerm, 
+                                         ItemFolder *folder,
+                                         void *callBackEnd,
+                                         void *callBackEntry );
 void addrindex_remove_results          ( AddressDataSource *ds,
                                          ItemFolder *folder );
 
 gboolean addrindex_load_completion(
                gint (*callBackFunc)
                        ( const gchar *, const gchar *, 
-                         const gchar *, const gchar * ) );
+                         const gchar *, const gchar *, GList * ),
+                       gchar *folderpath );
+
+gboolean addrindex_load_person_attribute( const gchar *attr,
+               gint (*callBackFunc)
+                       ( ItemPerson *, const gchar * ) );
+
+gboolean addrindex_load_person_ds( gint (*callBackFunc)
+                       ( ItemPerson *, AddressDataSource * ) );
+gchar *addrindex_get_picture_file(const gchar *emailaddr);             
+
+#ifdef USE_LDAP
+GSList *addrindex_get_password_protected_ldap_servers();
+#endif
 
 #endif /* __ADDRINDEX_H__ */