2011-11-28 [pawel] 3.7.10cvs106
[claws.git] / src / addrbook.h
index 4882f57f24cb839cad0a4f3af12d445ee0b451e7..863a8b0a2389297cc43e8f54737b51735fcc5bd2 100644 (file)
@@ -4,7 +4,7 @@
  *
  * 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/>.
+ * 
  */
 
 /*
 
 #include "addritem.h"
 #include "addrcache.h"
+#include "adbookbase.h"
 
-// Address book file.
+/* Address book file */
 typedef struct _AddressBookFile AddressBookFile;
+
 struct _AddressBookFile {
-       gchar *name;
-       gchar *path;
-       gchar *fileName;
+       AddressBookType type;
        AddressCache *addressCache;
-       gint  retVal;
-       gint  maxValue;
-       GList *tempList;
+       gint       retVal;
+       gchar      *path;
+       gchar      *fileName;
+       gint       maxValue;
+       GList      *tempList;
        GHashTable *tempHash;
-       gboolean readFlag;
-       gboolean dirtyFlag;
-       gboolean modifyFlag;
-       gboolean accessFlag;
-       jmp_buf jumper;
+       jmp_buf    jumper;
 };
 
-// Function prototypes
+/* Function prototypes */
 
 AddressBookFile *addrbook_create_book  ( void );
-void addrbook_empty_book               ( AddressBookFile *book );
+
 void addrbook_free_book                        ( AddressBookFile *book );
-void addrbook_print_book               ( AddressBookFile *book, FILE *stream );
-void addrbook_dump_hash                        ( AddressBookFile *book, FILE *stream );
 void addrbook_dump_book                        ( AddressBookFile *book, FILE *stream );
 void addrbook_set_name                 ( AddressBookFile *book, const gchar *value );
 void addrbook_set_path                 ( AddressBookFile *book, const gchar *value );
 void addrbook_set_file                 ( AddressBookFile *book, const gchar *value );
-void addrbook_set_accessed             ( AddressBookFile *book, const gboolean value );
 gboolean addrbook_get_modified         ( AddressBookFile *book );
 gboolean addrbook_get_accessed         ( AddressBookFile *book );
+void addrbook_set_accessed             ( AddressBookFile *book, const gboolean value );
 gboolean addrbook_get_read_flag                ( AddressBookFile *book );
 gint addrbook_get_status               ( AddressBookFile *book );
 ItemFolder *addrbook_get_root_folder   ( AddressBookFile *book );
 GList *addrbook_get_list_folder                ( AddressBookFile *book );
 GList *addrbook_get_list_person                ( AddressBookFile *book );
 gchar *addrbook_get_name               ( AddressBookFile *book );
+gboolean addrbook_get_dirty            ( AddressBookFile *book );
+void addrbook_set_dirty                        ( AddressBookFile *book, const gboolean value );
 
 ItemPerson *addrbook_remove_person     ( AddressBookFile *book, ItemPerson *person );
 ItemGroup *addrbook_remove_group       ( AddressBookFile *book, ItemGroup *group );
@@ -78,11 +76,6 @@ ItemEMail *addrbook_person_remove_email      ( AddressBookFile *book, ItemPerson *per
 gint addrbook_read_data                        ( AddressBookFile *book );
 gint addrbook_save_data                        ( AddressBookFile *book );
 
-ItemEMail *addrbook_move_email_before  ( AddressBookFile *book, ItemPerson *person,
-                                         ItemEMail *itemMove, ItemEMail *itemTarget );
-ItemEMail *addrbook_move_email_after   ( AddressBookFile *book, ItemPerson *person,
-                                         ItemEMail *itemMove, ItemEMail *itemTarget );
-
 void addrbook_update_address_list      ( AddressBookFile *book, ItemPerson *person,
                                          GList *listEMail );
 ItemPerson *addrbook_add_address_list  ( AddressBookFile *book, ItemFolder *folder,
@@ -94,26 +87,23 @@ ItemGroup *addrbook_add_group_list  ( AddressBookFile *book, ItemFolder *folder,
                                          GList *listEMail );
 ItemFolder *addrbook_add_new_folder    ( AddressBookFile *book, ItemFolder *parent );
 
-void addrbook_update_attrib_list       ( AddressBookFile *book, ItemPerson *person, GList *listAttrib );
-void addrbook_add_attrib_list          ( AddressBookFile *book, ItemPerson *person, GList *listAttrib );
-
-ItemFolder *addrbook_remove_folder     ( AddressBookFile *book, ItemFolder *folder );
-ItemFolder *addrbook_remove_folder_delete( AddressBookFile *book, ItemFolder *folder );
+void addrbook_update_attrib_list       ( AddressBookFile *book, ItemPerson *person,
+                                         GList *listAttrib );
+void addrbook_add_attrib_list          ( AddressBookFile *book, ItemPerson *person,
+                                         GList *listAttrib );
 
 GList *addrbook_get_bookfile_list      ( AddressBookFile *book );
 gchar *addrbook_gen_new_file_name      ( gint fileNum );
 gint addrbook_test_read_file           ( AddressBookFile *book, gchar *fileName );
 
 GList *addrbook_get_all_persons                ( AddressBookFile *book );
+GList *addrbook_get_all_groups         ( AddressBookFile *book );
 
 ItemPerson *addrbook_add_contact       ( AddressBookFile *book, ItemFolder *folder,
                                          const gchar *name, const gchar *address,
                                          const gchar *remarks );
 
-#endif /* __ADDRBOOK_H__ */
-
-/*
-* End of Source.
-*/
-
+gchar *addrbook_guess_next_file                ( AddressBookFile *book );
+void addrbook_delete_book_file         ( AddressBookFile *book );
 
+#endif /* __ADDRBOOK_H__ */