1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 * pas-backend-summary.h
4 * Copyright 2000, 2001, Ximian, Inc.
7 * Chris Toshok <toshok@ximian.com>
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public
11 * License, version 2, as published by the Free Software Foundation.
13 * This library is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Library General Public License for more details.
18 * You should have received a copy of the GNU Library General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
24 #ifndef __E_BOOK_BACKEND_SUMMARY_H__
25 #define __E_BOOK_BACKEND_SUMMARY_H__
28 #include <glib-object.h>
29 #include <libedata-book/e-data-book-types.h>
30 #include <libebook/e-contact.h>
34 #define E_TYPE_BACKEND_SUMMARY (e_book_backend_summary_get_type ())
35 #define E_BOOK_BACKEND_SUMMARY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TYPE_BACKEND_SUMMARY, EBookBackendSummary))
36 #define E_BOOK_BACKEND_SUMMARY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_BOOK_BACKEND_TYPE, EBookBackendSummaryClass))
37 #define E_IS_BACKEND_SUMMARY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TYPE_BACKEND_SUMMARY))
38 #define E_IS_BACKEND_SUMMARY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TYPE_BACKEND_SUMMARY))
39 #define E_BOOK_BACKEND_SUMMARY_GET_CLASS(k) (G_TYPE_INSTANCE_GET_CLASS ((obj), E_TYPE_BACKEND_SUMMARY, EBookBackendSummaryClass))
41 typedef struct _EBookBackendSummaryPrivate EBookBackendSummaryPrivate;
43 struct _EBookBackendSummary{
44 GObject parent_object;
45 EBookBackendSummaryPrivate *priv;
48 struct _EBookBackendSummaryClass{
49 GObjectClass parent_class;
52 EBookBackendSummary* e_book_backend_summary_new (const char *summary_path,
53 int flush_timeout_millis);
54 GType e_book_backend_summary_get_type (void);
56 /* returns FALSE if the load fails for any reason (including that the
57 summary is out of date), TRUE if it succeeds */
58 gboolean e_book_backend_summary_load (EBookBackendSummary *summary);
59 /* returns FALSE if the save fails, TRUE if it succeeds (or isn't required due to no changes) */
60 gboolean e_book_backend_summary_save (EBookBackendSummary *summary);
62 void e_book_backend_summary_add_contact (EBookBackendSummary *summary, EContact *contact);
63 void e_book_backend_summary_remove_contact (EBookBackendSummary *summary, const char *id);
64 gboolean e_book_backend_summary_check_contact (EBookBackendSummary *summary, const char *id);
66 void e_book_backend_summary_touch (EBookBackendSummary *summary);
68 /* returns TRUE if the summary's mtime is >= @t. */
69 gboolean e_book_backend_summary_is_up_to_date (EBookBackendSummary *summary, time_t t);
71 gboolean e_book_backend_summary_is_summary_query (EBookBackendSummary *summary, const char *query);
72 GPtrArray* e_book_backend_summary_search (EBookBackendSummary *summary, const char *query);
73 char* e_book_backend_summary_get_summary_vcard (EBookBackendSummary *summary, const char *id);
77 #endif /* __E_BOOK_BACKEND_SUMMARY_H__ */