Statistics
| Revision:

root / src / addrcache.h @ 291

History | View | Annotate | Download (5.5 kB)

1 1 hiro
/*
2 1 hiro
 * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3 1 hiro
 * Copyright (C) 2001 Match Grun
4 1 hiro
 *
5 1 hiro
 * This program is free software; you can redistribute it and/or modify
6 1 hiro
 * it under the terms of the GNU General Public License as published by
7 1 hiro
 * the Free Software Foundation; either version 2 of the License, or
8 1 hiro
 * (at your option) any later version.
9 1 hiro
 *
10 1 hiro
 * This program is distributed in the hope that it will be useful,
11 1 hiro
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 1 hiro
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 1 hiro
 * GNU General Public License for more details.
14 1 hiro
 *
15 1 hiro
 * You should have received a copy of the GNU General Public License
16 1 hiro
 * along with this program; if not, write to the Free Software
17 1 hiro
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 1 hiro
 */
19 1 hiro
20 1 hiro
/*
21 1 hiro
 * Definitions for address cache.
22 1 hiro
 */
23 1 hiro
24 1 hiro
#ifndef __ADDRCACHE_H__
25 1 hiro
#define __ADDRCACHE_H__
26 1 hiro
27 1 hiro
#include <time.h>
28 1 hiro
#include <stdio.h>
29 1 hiro
#include <glib.h>
30 1 hiro
#include "addritem.h"
31 1 hiro
32 1 hiro
/* Address cache */
33 1 hiro
typedef struct _AddressCache AddressCache;
34 1 hiro
35 1 hiro
struct _AddressCache {
36 1 hiro
        gint       nextID;
37 1 hiro
        gboolean   dataRead;
38 1 hiro
        gboolean   modified;
39 1 hiro
        time_t     modifyTime;
40 1 hiro
        GHashTable *itemHash;
41 1 hiro
        GList      *tempList;
42 1 hiro
        ItemFolder *rootFolder;
43 1 hiro
};
44 1 hiro
45 1 hiro
/* Function prototypes */
46 1 hiro
AddressCache *addrcache_create();
47 1 hiro
ItemFolder *addrcache_get_root_folder        ( AddressCache *cache );
48 1 hiro
GList *addrcache_get_list_folder        ( AddressCache *cache );
49 1 hiro
GList *addrcache_get_list_person        ( AddressCache *cache );
50 1 hiro
51 1 hiro
void addrcache_refresh                        ( AddressCache *cache );
52 1 hiro
/* void addrcache_empty                        ( AddressCache *cache ); */
53 1 hiro
void addrcache_clear                        ( AddressCache *cache );
54 1 hiro
void addrcache_free                        ( AddressCache *cache );
55 1 hiro
gboolean addrcache_check_file                ( AddressCache *cache, gchar *path );
56 1 hiro
gboolean addrcache_mark_file                ( AddressCache *cache, gchar *path );
57 1 hiro
58 1 hiro
void addrcache_print_item_list                ( GList *list, FILE *stream );
59 1 hiro
void addrcache_print                        ( AddressCache *cache, FILE *stream );
60 1 hiro
void addrcache_dump_hash                ( AddressCache *cache, FILE *stream );
61 1 hiro
62 1 hiro
void addrcache_id_person                ( AddressCache *cache, ItemPerson *person );
63 1 hiro
void addrcache_id_group                        ( AddressCache *cache, ItemGroup *group );
64 1 hiro
void addrcache_id_folder                ( AddressCache *cache, ItemFolder *folder );
65 1 hiro
void addrcache_id_email                        ( AddressCache *cache, ItemEMail *email );
66 1 hiro
void addrcache_id_attribute                ( AddressCache *cache, UserAttribute *attrib );
67 1 hiro
68 1 hiro
gboolean addrcache_hash_add_person        ( AddressCache *cache, ItemPerson *person );
69 1 hiro
gboolean addrcache_hash_add_group        ( AddressCache *cache, ItemGroup *group );
70 1 hiro
gboolean addrcache_hash_add_folder        ( AddressCache *cache, ItemFolder *folder );
71 1 hiro
72 1 hiro
gboolean addrcache_folder_add_person        ( AddressCache *cache, ItemFolder *folder, ItemPerson *item );
73 1 hiro
gboolean addrcache_folder_add_folder        ( AddressCache *cache, ItemFolder *folder, ItemFolder *item );
74 1 hiro
gboolean addrcache_folder_add_group        ( AddressCache *cache, ItemFolder *folder, ItemGroup *item );
75 1 hiro
76 1 hiro
gboolean addrcache_add_person                ( AddressCache *cache, ItemPerson *person );
77 1 hiro
gboolean addrcache_add_group                ( AddressCache *cache, ItemGroup *group );
78 1 hiro
gboolean addrcache_person_add_email        ( AddressCache *cache, ItemPerson *person, ItemEMail *email );
79 1 hiro
gboolean addrcache_group_add_email        ( AddressCache *cache, ItemGroup *group, ItemEMail *email );
80 1 hiro
gboolean addrcache_add_folder                ( AddressCache *cache, ItemFolder *folder );
81 1 hiro
82 1 hiro
AddrItemObject *addrcache_get_object        ( AddressCache *cache, const gchar *uid );
83 1 hiro
ItemPerson *addrcache_get_person        ( AddressCache *cache, const gchar *uid );
84 1 hiro
ItemGroup *addrcache_get_group                ( AddressCache *cache, const gchar *uid );
85 1 hiro
ItemEMail *addrcache_get_email                ( AddressCache *cache, const gchar *uid, const gchar *eid );
86 1 hiro
87 1 hiro
UserAttribute *addrcache_person_remove_attrib_id        ( AddressCache *cache, const gchar *uid,
88 1 hiro
                                                          const gchar *aid );
89 1 hiro
UserAttribute *addrcache_person_remove_attribute        ( AddressCache *cache, ItemPerson *person,
90 1 hiro
                                                          UserAttribute *attrib );
91 1 hiro
92 1 hiro
ItemGroup *addrcache_remove_group_id                ( AddressCache *cache, const gchar *uid );
93 1 hiro
ItemGroup *addrcache_remove_group                ( AddressCache *cache, ItemGroup *group );
94 1 hiro
95 1 hiro
ItemPerson *addrcache_remove_person_id                ( AddressCache *cache, const gchar *uid );
96 1 hiro
ItemPerson *addrcache_remove_person                ( AddressCache *cache, ItemPerson *person );
97 1 hiro
ItemEMail *addrcache_person_remove_email_id        ( AddressCache *cache, const gchar *uid, const gchar *eid );
98 1 hiro
ItemEMail *addrcache_person_remove_email        ( AddressCache *cache, ItemPerson *person, ItemEMail *email );
99 1 hiro
100 1 hiro
GList *addrcache_folder_get_address_list        ( AddressCache *cache, ItemFolder *folder );
101 1 hiro
GList *addrcache_folder_get_person_list                ( AddressCache *cache, ItemFolder *folder );
102 1 hiro
GList *addrcache_folder_get_group_list                ( AddressCache *cache, ItemFolder *folder );
103 1 hiro
GList *addrcache_folder_get_folder_list                ( AddressCache *cache, ItemFolder *folder );
104 1 hiro
105 1 hiro
GList *addrcache_get_address_list                ( AddressCache *cache );
106 1 hiro
GList *addrcache_get_person_list                ( AddressCache *cache );
107 1 hiro
GList *addrcache_get_group_list                        ( AddressCache *cache );
108 1 hiro
GList *addrcache_get_folder_list                ( AddressCache *cache );
109 1 hiro
110 1 hiro
GList *addrcache_get_group_for_person                ( AddressCache *cache, ItemPerson *person );
111 1 hiro
112 1 hiro
ItemFolder *addrcache_find_root_folder                ( ItemFolder *folder );
113 1 hiro
GList *addrcache_get_all_persons                ( AddressCache *cache );
114 1 hiro
GList *addrcache_get_all_groups                        ( AddressCache *cache );
115 1 hiro
116 1 hiro
ItemFolder *addrcache_remove_folder                ( AddressCache *cache, ItemFolder *folder );
117 1 hiro
ItemFolder *addrcache_remove_folder_delete        ( AddressCache *cache, ItemFolder *folder );
118 1 hiro
119 1 hiro
ItemPerson *addrcache_add_contact                ( AddressCache *cache, ItemFolder *folder,
120 1 hiro
                                                  const gchar *name, const gchar *address,
121 1 hiro
                                                  const gchar *remarks );
122 1 hiro
123 1 hiro
#endif /* __ADDRCACHE_H__ */