Fix FSF address (Tobias Mueller, #470445)
[platform/upstream/evolution-data-server.git] / addressbook / libedata-book / e-book-backend-cache.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /* 
3  *  A class to cache address book conents on local file system
4  * 
5  * Copyright (C) 2004 Novell, Inc.
6  *
7  * Authors: Sivaiah Nallagatla <snallagatla@ximian.com>
8  *
9  * This program is free software; you can redistribute it and/or
10  * modify it under the terms of version 2 of the GNU Lesser General Public
11  * License as published by the Free Software Foundation.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21  */
22
23 #ifndef E_BOOK_BACKEND_CACHE_H
24 #define E_BOOK_BACKEND_CACHE_H
25
26 #include "libedataserver/e-file-cache.h"
27 #include <libebook/e-contact.h>
28
29 G_BEGIN_DECLS
30
31 #define E_TYPE_BOOK_BACKEND_CACHE            (e_book_backend_cache_get_type ())
32 #define E_BOOK_BACKEND_CACHE(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_BOOK_BACKEND_CACHE, EBookBackendCache))
33 #define E_BOOK_BACKEND_CACHE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_BOOK_BACKEND_CACHE, EBookBackendCacheClass))
34 #define E_IS_BOOK_BACKEND_CACHE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_BOOK_BACKEND_CACHE))
35 #define E_IS_BOOK_BACKEND_CACHE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_BOOK_BACKEND_CACHE))
36
37 typedef struct _EBookBackendCachePrivate EBookBackendCachePrivate;
38
39 typedef struct {
40         EFileCache parent;
41         EBookBackendCachePrivate *priv;
42 } EBookBackendCache;
43
44 typedef struct {
45         EFileCacheClass parent_class;
46 } EBookBackendCacheClass;
47
48 GType e_book_backend_cache_get_type (void);
49 EBookBackendCache* e_book_backend_cache_new (const char *uri);
50 EContact* e_book_backend_cache_get_contact (EBookBackendCache *cache, const char *uid);
51 gboolean e_book_backend_cache_add_contact (EBookBackendCache *cache,
52                                            EContact *contact);
53 gboolean e_book_backend_cache_remove_contact (EBookBackendCache *cache,
54                                               const char *uid);
55 gboolean e_book_backend_cache_check_contact (EBookBackendCache *cache, const char *uid);
56 GList*   e_book_backend_cache_get_contacts (EBookBackendCache *cache, const char *query);
57 gboolean e_book_backend_cache_exists (const char *uri);
58 void     e_book_backend_cache_set_populated (EBookBackendCache *cache);
59 gboolean e_book_backend_cache_is_populated (EBookBackendCache *cache);
60 void e_book_backend_cache_set_time (EBookBackendCache *cache, const char *t);
61 char *e_book_backend_cache_get_time (EBookBackendCache *cache);
62 GPtrArray* e_book_backend_cache_search (EBookBackendCache *cache, const char *query);
63
64
65
66
67 G_END_DECLS
68
69 #endif