1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 * A class to cache address book conents on local file system
5 * Copyright (C) 2004 Novell, Inc.
7 * Authors: Sivaiah Nallagatla <snallagatla@ximian.com>
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.
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.
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.
23 #ifndef E_BOOK_BACKEND_CACHE_H
24 #define E_BOOK_BACKEND_CACHE_H
26 #include "libedataserver/e-file-cache.h"
27 #include <libebook/e-contact.h>
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))
37 typedef struct _EBookBackendCachePrivate EBookBackendCachePrivate;
41 EBookBackendCachePrivate *priv;
45 EFileCacheClass parent_class;
46 } EBookBackendCacheClass;
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,
53 gboolean e_book_backend_cache_remove_contact (EBookBackendCache *cache,
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);