e-book-backend-db-cache.h: Avoid DB typedef.
[platform/upstream/evolution-data-server.git] / addressbook / libedata-book / e-book-backend-db-cache.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3  *
4  * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
5  *
6  * Authors: Devashish Sharma <sdevashish@novell.com>
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of version 2 of the GNU Lesser General Public
10  * License as published by the Free Software Foundation.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  */
21
22 #if !defined (__LIBEDATA_BOOK_H_INSIDE__) && !defined (LIBEDATA_BOOK_COMPILATION)
23 #error "Only <libedata-book/libedata-book.h> should be included directly."
24 #endif
25
26 #ifndef E_BOOK_BACKEND_DB_CACHE_H
27 #define E_BOOK_BACKEND_DB_CACHE_H
28
29 #include <libebook/libebook.h>
30
31 G_BEGIN_DECLS
32
33 /* Avoid including <db.h> in a public header file. */
34 struct __db;
35
36 EContact * e_book_backend_db_cache_get_contact (struct __db *db, const gchar *uid);
37 gchar *e_book_backend_db_cache_get_filename (struct __db *db);
38 void e_book_backend_db_cache_set_filename (struct __db *db, const gchar *filename);
39 gboolean e_book_backend_db_cache_add_contact (struct __db *db,
40                                            EContact *contact);
41 gboolean e_book_backend_db_cache_remove_contact (struct __db *db,
42                                               const gchar *uid);
43 gboolean e_book_backend_db_cache_check_contact (struct __db *db, const gchar *uid);
44 GList *   e_book_backend_db_cache_get_contacts (struct __db *db, const gchar *query);
45 gboolean e_book_backend_db_cache_exists (const gchar *uri);
46 void     e_book_backend_db_cache_set_populated (struct __db *db);
47 gboolean e_book_backend_db_cache_is_populated (struct __db *db);
48 GPtrArray * e_book_backend_db_cache_search (struct __db *db, const gchar *query);
49 void e_book_backend_db_cache_set_time (struct __db *db, const gchar *t);
50 gchar * e_book_backend_db_cache_get_time (struct __db *db);
51
52 G_END_DECLS
53
54 #endif
55